{% block main %}
<h1 class="gauche">Demande d'autorisation d'engagement de personnel</h1>
<a class="droite bouton-action" target="_blank" href="?mode=vpdf">Format impression</a>
-{% if dossier|est_editable:request.user %}<a class="droite bouton-action" href="{% url embauche dossier.poste.key dossier.id %}">Modifier</a>{% endif %}
+{% if dossier|est_editable:request.user %}
+<a class="droite bouton-action" href="{% url embauche dossier.poste.key dossier.id %}">Modifier</a>
+{% endif %}
<div class="visualClear"></div>
<h2 class="section">SECTION 1 - POSTE</h2>
<tbody>
<tr>
<th>Employé</th>
- <td colspan="5">{{ dossier.employe }}</td>
+ <td colspan="5">{{ dossier.employe }} ({{ dossier.employe.genre }})</td>
</tr>
</tbody>
</table>
<fieldset>
<h2>Pièces jointes</h2>
<ul>
- {% for pj in dossier.dossierpiece_set.all %}
- <li><a href="{{ pj.fichier.url }}" target="_blank">{{ pj.nom }}</a></li>
- {% endfor %}
+ {% for pj in dossier.dossierpiece_set.all %}
+ <li><a href="{% url dossier_piece pj.id pj.fichier.name|basename %}">{{ pj.nom }}</a></li>
+ {% endfor %}
</ul>
</fieldset>
</tr>
</table>
-<fieldset>
-<h2>Validations</h2>
+{% if dossier.valide %}
+<h2 class="section">CONTRATS</h2>
+
+<a class="droite bouton-action" href="{% url embauche_ajouter_contrat dossier_id=dossier.id %}"
+ >Ajouter un contrat</a>
+
+<table>
+ <thead>
+ <tr>
+ <th>Type</th>
+ <th>Fichier</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for contrat in dossier.contrats.all %}
+ <tr>
+ <td>{{ contrat.type }}</td>
+ <td><a href="{% url contrat contrat.id contrat.fichier.name|basename %}"
+ >{{ contrat.fichier.name|basename }}</a></td>
+ <td><a href="{% url contrat_supprimer contrat.id %}">Supprimer</a></td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="0">Aucun contrat pour l'instant</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% endif %}
+
+<h2 class="section">VALIDATIONS</h2>
<table>
<tr>
</table>
{{ validationForm.get_input_etats_as_buttons|safe }}
</form>
-</fieldset>
-
-{% endblock %}
+{% endblock %}