project_form.html 1.37 KB
{% extends "base_page.html" %}

{#  Set the title that will be used in base_page #}
{% if project['id'] and project['id'] != '' %}
  {% set subtitle = "Modifier le projet "+ project['name'] %}
{% else %}
  {% set subtitle = "Ajouter un nouveau projet" %}
{% endif %}

{% block content %}

  <!-- Invisible span to define wich ul and a in the navbar are actived -->
  <span id="nav_actived" style="display: none">admin,project_edit</span>

  <form id="project_form" class="pdc-form" action="{{ url_for('main.project_edit') }}" method="post">
    {% if project['id'] and project['id'] != '' %}
      <input class="form-control" id="project_id" name="project_id" type="hidden" value="{{ project['id'] }}">
    {% endif %}
    <div class="form-group">
      <label for="name">Nom</label>
      <input class="form-control" id="name" name="name" type="text" value="{{ project['name'] }}">
    </div>
    {%  for c in categories %}
      <div class="form-group">
        <label for="{{ c.name }}">{{ c.name }}</label>
        <select id="{{ c.name }}" name="{{ c.name }}" class="form-control" multiple>
          {% for l in c.labels %}
            <option value="{{ l.id }}" {{ "selected" if l.name in project['labels'] }}>{{ l.name }}</option>
          {% endfor %}
        </select>
      </div>
    {%  endfor %}
    <input class="pdc-form-submit" type="submit" value="Valider">
  </form>
{% endblock %}