{% extends 'base.html' %}

{% block content %}
<div class="container-fluid mt-0">
  <h1>{{ _("Add Maintenance") }}</h1>
  <form method="POST" action="{{ url_for('add_maintenance') }}">
    <div class="mb-3">
      <label for="description" class="form-label">{{ _("Description of maintenance")}}:</label>
      <input type="text" id="description" name="description" class="form-control" required />
    </div>
    <div class="mb-3">
      <label for="lcd_message" class="form-label">{{ _("LCD Message")}}:</label>
      <input type="text" id="lcd_message" name="lcd_message" class="form-control" required maxlength="16"/>
    </div>
    <div class="mb-3">
      <label for="machine_id" class="form-label">{{ _("Machine to maintain") }}:</label>
      <select id="machine_id" name="machine_id" class="form-control" required>
        {% for machine in machines %}
        <option value="{{ machine.machine_id }}">{{ machine.machine_name }}</option>
        {% endfor %}
      </select>
    </div>
    <div class="mb-3">
      <label for="hours_between" class="form-label">{{ _("Number of use hours to trigger") }}:</label>
      <input type="number" id="hours_between" name="hours_between" class="form-control" required />
    </div>
    <div class="mb-3">
      <label for="instructions_url" class="form-label">{{ _("instructions_url") }}:</label>
      <input type="url" id="instructions_url" name="instructions_url" class="form-control" >
    </div>
    <input type="submit" value="{{ _("Add Maintenance") }}" class="btn btn-primary" />
  </form>
</div>
{% endblock %}