{% extends 'base.html' %}

{% block content %}
<div class="container-fluid mt-0">
    <h1>{{ _("Add Machine") }}</h1>
    <form method="POST" action="{{ url_for('create_machine') }}">
        <div class="mb-3">
            <label for="machine_name" class="form-label">{{ _("Machine Name") }}:</label>
            <input type="text" id="machine_name" name="machine_name" class="form-control" required />
        </div>
        <div class="mb-3">
            <label for="machine_type_id" class="form-label">{{ _("Machine Type") }}:</label>
            <select id="machine_type_id" name="machine_type_id" class="form-select">
                {% for machine_type in machine_types %}
                <option value="{{ machine_type.type_id }}">{{ machine_type.type_name }}</option>
                {% endfor %}
            </select>
        </div>
        <div class="mb-3">
            <label for="machine_hours" class="form-label">{{ _("Machine Hours") }}:</label>
            <input type="number" step="0.1" id="machine_hours" name="machine_hours" class="form-control" required />
        </div>
        <div class="mb-3 form-check">
            <input type="checkbox" id="blocked" name="blocked" class="form-check-input" />
            <label for="blocked" class="form-check-label">{{ _("Blocked") }}:</label>
        </div>
        <input type="submit" value="{{ _("Add Machine") }}" class="btn btn-primary" />
    </form>
</div>
{% endblock %}
