category_form.html
1.3 KB
{% extends "base_page.html" %}
{# Set the title that will be used in base_page #}
{% if category['id'] and category['id'] != '' %}
{% set subtitle = "Modifier la categorie "+ category['name'] %}
{% else %}
{% set subtitle = "Ajouter une nouvelle categorie" %}
{% endif %}
{% block content %}
<!-- Invisible span to define wich ul and a in the navbar are actived -->
<span id="nav_actived" style="display: none">admin,category_edit</span>
<form id="category_form" class="pdc-form" action="{{ url_for('main.category_edit') }}" method="post">
{% if category['id'] and category['id'] != '' %}
<input class="form-control" id="category_id" name="category_id" type="hidden" value="{{ category['id'] }}">
{% endif %}
<div class="form-group">
<label for="name">Nom</label>
<input class="form-control" id="name" name="name" type="text" value="{{ category['name'] }}">
</div>
<div class="form-group">
<label for="labels">Labels</label>
<select id="labels" name="labels" class="form-control" multiple>
{% for l in labels %}
<option value="{{ l.id }}" {{ "selected" if l.name in category['labels'] }}>{{ l.name }}</option>
{% endfor %}
</select>
</div>
<input class="pdc-form-submit" type="submit" value="Valider">
</form>
{% endblock %}