agent_edit.html
3.13 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{% 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 %}
<!-- Invisible span to define wich ul and a in the navbar are actived -->
<span id="nav_actived" style="display: none">cds,agent/create</span>
<form id="agent_form" class="pdc-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 col-sm-5 col-xl-3">
<input class="form-check-input " type="checkbox" id="virtual" name="virtual"
{{ 'checked' if agent['virtual'] == 1 }} value="1">
<label class="form-check-label " for="virtual">Virtuel</label>
</div>
<div class="form-group form-check form-check-inline col-sm-5 col-xl-3">
<input class="form-check-input " type="checkbox" id="permanent" name="permanent"
{{ 'checked' if agent['permanent'] == 1 }} value="1">
<label class="form-check-label " for="permanent">Permanent</label>
</div>
<div class="form-group">
<label for="company_id">Structure</label>
<select id="company_id" name="company_id" class="form-control">
<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-control">
<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-control">
<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-control">
<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="pdc-form-submit" type="submit" value="Valider">
</form>
{% endblock %}