agent_edit.html 2.91 KB
{% extends "base_page.html" %}
{#  Set the title that will be used in base_page #}
{% if agent['agent_id'] != '' %}
  {% set subtitle = "Modifier l'agent "+ agent['fullname'] +":" %}
{% else %}
  {% set subtitle = "Ajouter un nouvel agent:" %}
{% endif %}
{% block content %}
  <form action="{{ url_for('main.agent_edit') }}" method="post">
    {% if agent %}
      <input class="form-control" id="agent_id" name="agent_id" type="hidden" value="{{ agent['agent_id'] }}">
    {% endif %}
    <div class="form-group">
      <label for="firstname">Nom</label>
      <input class="form-control" id="firstname" name="firstname" type="text" value="{{ agent['firstname'] }}">
    </div>
    <div class="form-group">
      <label for="secondname">Prénom</label>
      <input class="form-control" id="secondname" name="secondname" type="text" value="{{ agent['secondname'] }}">
    </div>
    <div class="form-group form-check form-check-inline">
      <label class="form-check-label" for="virtual">Virtuel</label>
      <input class="form-check-input" type="checkbox" id="virtual" name="virtual"
          {{ 'checked' if agent['virtual'] == 1 }} value="1">
    </div>
    <div class="form-group form-check form-check-inline">
      <label class="form-check-label" for="permanent">Permanent</label>
      <input class="form-check-input" type="checkbox" id="permanent" name="permanent"
          {{ 'checked' if agent['permanent'] == 1 }} value="1">
    </div>
    <div class="form-group">
      <label for="company_id">Structure</label>
      <select id="company_id" name="company_id" class="form-select">
        <option selected>---</option>
        {% for c in companies %}
          <option value="{{ c.id }}" {{ "selected" if c.id == agent['company_id'] }}>{{ c.name }}</option>
        {% endfor %}
      </select>
    </div>
    <div class="form-group">
      <label for="grade_id">Grade</label>
      <select id="grade_id" name="grade_id" class="form-select">
        <option selected>---</option>
        {% for g in grades %}
          <option value="{{ g.id }}" {{ "selected" if g.id == agent['grade_id'] }}>{{ g.name }}</option>
        {% endfor %}
      </select>
    </div>
    <div class="form-group">
      <label for="status_id">Statut</label>
      <select id="status_id" name="status_id" class="form-select">
        <option selected>---</option>
        {% for s in statuses %}
          <option value="{{ s.id }}" {{ "selected" if s.id == agent['status_id'] }}>{{ s.name }}</option>
        {% endfor %}
      </select>
    </div>
    <div class="form-group">
      <label for="bap_id">Bap</label>
      <select id="bap_id" name="bap_id" class="form-select">
        <option selected>---</option>
        {% for b in baps %}
          <option value="{{ b.id }}" {{ "selected" if b.id == agent['bap_id'] }}>{{ b.name }}</option>
        {% endfor %}
      </select>
    </div>
    <input class="btn btn-dark" type="submit" value="Valider">
  </form>
{% endblock %}