ajout PJ au dossier (NON TESTE, ajax fait disparaitre mon form...)
[auf_rh_dae.git] / project / dae / templates / dae / embauche.html
CommitLineData
139686f2
NC
1{% extends 'base.html' %}
2
3{% block extrahead %}
4 <script src="{{ MEDIA_URL }}js/jquery-1.5.1.min.js"
5 type="text/javascript"></script>
da3ca955 6
7 <style>
8 h2.section {
9 width:100%;
10 background-color: #D0E8F8;
11 text-align: center;
12 color: #5F5F5F;
13 margin: 50px 0px 26px 0px;
14 border-bottom: 3px solid #BBD8EC;
15 padding: 4px;
16 }
17 .row {padding: 10px 0px; clear: both; display:block;}
18 .row * {float: left; margin: 0px; padding: 0px; margin-right: 4px;}
19 .row li {list-style-type: none;}
20 .underline {text-decoration: underline;}
21 .clear {display: block; clear: both;}
22 .note {text-decoration: underline; font-style: italic; margin-left: 12px;}
23 .info {font-size:13px; font-style: italic;}
24 .noborder {border:none; margin:0; padding; 0}
25 tr.noborder td {border:none; padding-left: 0;}
26 .gauche { float:left; }
27 .droite { float:right; text-align:right; }
28 .clear { clear:both; width:100%; }
29 </style>
139686f2
NC
30{% endblock %}
31
32{% block title %}
33 Embauche
34{% endblock %}
35
36{% block main %}
da3ca955 37<h1>Demandes d'autorisation d'engagement de personnel</h1>
38<form action="" method="post">
39{% if step == 'poste' %}
40 <h2 class="section">SECTION 1 - POSTE</h2>
41 <fieldset>
42 <h2>Poste visé</h2>
43
44 <table cellspacing="0">
139686f2 45 {{ form.as_table }}
da3ca955 46 </table>
47 </fieldset>
139686f2 48
da3ca955 49 <script type="text/javascript">
139686f2
NC
50 $('#id_poste').change(function() {
51 window.location = '{% url embauche %}/' + $(this).val();
52 });
da3ca955 53 </script>
54{% else %}
55 <h2 class="section">SECTION 1 - POSTE</h2>
56 <fieldset>
57 <h2>Poste : {{ poste.nom }} ({{ poste.implantation.nom }})</h2>
58
59 </fieldset>
60
61 <h2 class="section">SECTION 2 - PERSONNEL ENGAGÉ</h2>
62 <fieldset>
63 <div>
64 <div class="gauche"><h2>Personne</h2></div>
65 <div class="droite">
66 <table class="droite">
67 <tbody>
68 <tr>
69 <th>Mobilité interne</th>
70 <td colspan="3"><input id="mobilite_interne" type="checkbox" name="mobilite_interne" /></td>
71 </tr>
72 </tbody>
73 </table>
74 </div>
75 </div>
76 <div class="clear"></div>
77 <table id="form-employe">
78 <tbody>
79 <tr>
80 <th>
81 Employé :<br />
82 {{ forms.employe.employe.errors }}
83 </th>
84 <td colspan="5">{{ forms.employe.employe }}</td>
85 </tr>
86 <tr>
87 <th>
88 {{ forms.employe.nom.label_tag }} :<br />
89 {{ forms.employe.nom.errors }}
90 </th>
91 <td>{{ forms.employe.nom }}</td>
92 <th>
93 {{ forms.employe.prenom.label_tag }} :<br />
94 {{ forms.employe.prenom.errors }}
95 </th>
96 <td>{{ forms.employe.prenom }}</td>
97 <th>
98 {{ forms.employe.genre.label_tag }} :<br />
99 {{ forms.employe.genre.errors }}
100 </th>
101 <td>{{ forms.employe.genre }}</td>
102 </tr>
103 </tbody>
104 </table>
105
106 <input type="hidden" id="poste" name="poste"
107 value="dae-{{ poste.id }}" />
108 <input type="hidden" id="implantation" name="implantation"
109 value="{{ poste.implantation_id }}" />
110 <input type="hidden" id="dossier" name="dossier"
111 value="{{ dossier.id }}" />
112 </fieldset>
113
114 <script type="text/javascript">
139686f2
NC
115 function activateEmployeDropDown() {
116 $('#id_employe').change(loadEmploye);
117 }
118
119 function loadEmploye() {
120 var employeUrl = '{% url employe %}/' + $(this).val();
121 $('#form-employe').html('<tr><td>Chargement...</td></tr>')
da3ca955 122 .load(employeUrl, activateEmployeDropDown);
139686f2 123 var dossierUrl = '{% url dossier %}/' + $('#poste').val() +
da3ca955 124 '/' + $(this).val();
139686f2 125 $('#form-dossier').html('<tr><td>Chargement...</td></tr>')
da3ca955 126 .load(dossierUrl, activateDossierDropDowns);
139686f2 127 }
139686f2 128 activateEmployeDropDown();
da3ca955 129 </script>
130
131 {% with forms.dossier as form %}
132 {% include "dae/embauche-dossier.html" %}
133 {% endwith %}
134
135 <h2 class="section">SECTION 3 - COÛT GLOBAL</h2>
136
137 <h2 class="section">SECTION 4 - JUSTIFICATION DE LA DEMANDE (OBLIGATOIRE)</h2>
138
139 <input type="submit" name="save" value="Sauvegarder" />
140{% endif %}
141</form>
139686f2
NC
142{% endblock %}
143