project_form.html
1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{% extends "base_page.html" %}
{# Make link with form_manager #}
{% set project = object_struct %}
{# Set the title that will be used in base_page #}
{% if project['id'] and project['id'] != '' and project['name'] != None %}
{% 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" placeholder="Nom de Projet"
value="{{ project['name'] if 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 %}
<div class="form-group">
<label for="status_id">État</label>
<select id="status_id" name="status_id" class="form-control">
{% for s in project_statuses %}
<option value="{{ s.id }}" {{ "selected" if s.id == project['status_id'] }}>{{ s.name }}</option>
{% endfor %}
</select>
</div>
<input class="pdc-form-submit" type="submit" value="Valider">
</form>
{% endblock %}