label_form.html
1.28 KB
{% extends "base_page.html" %}
{# Set the title that will be used in base_page #}
{% if label['id'] and label['id'] != '' %}
{% set subtitle = "Modifier le label "+ label['name'] %}
{% else %}
{% set subtitle = "Ajouter un nouveau label" %}
{% endif %}
{% block content %}
<!-- Invisible span to define wich ul and a in the navbar are actived -->
<span id="nav_actived" style="display: none">admin,label_edit</span>
<form id="label_form" class="pdc-form" action="{{ url_for('main.label_edit') }}" method="post">
{% if label['id'] and label['id'] != '' %}
<input class="form-control" id="label_id" name="label_id" type="hidden" value="{{ label['id'] }}">
{% endif %}
<div class="form-group">
<label for="name">Nom</label>
<input class="form-control" id="name" name="name" type="text" value="{{ label['name'] }}">
</div>
<div class="form-group">
<label for="categories">Categories</label>
<select id="categories" name="categories" class="form-control" multiple>
{% for c in categories %}
<option value="{{ c.id }}" {{ "selected" if c.name in label['categories'] }}>{{ c.name }}</option>
{% endfor %}
</select>
</div>
<input class="pdc-form-submit" type="submit" value="Valider">
</form>
{% endblock %}