{% 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 %}<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>
<table>
<tbody>
<tr>
+ <th>Classement</th>
+ <th>Statut</th>
<th>Implantation</th>
<th>Employé</th>
<th>Poste</th>
</tr>
{% for dc in dossier.comparaisons.all %}
<tr>
+ <td>{{ dc.classement|default:"" }}</td>
+ <td>{{ dc.statut|default:"" }}</td>
<td>{{ dc.implantation }}</td>
<td>{{ dc.personne }}</td>
<td>{{ dc.poste }}</td>
- <td>{{ dc.montant }} {{ dc.devise }}</td>
- <td>{{ dc.montant_euros }} EUR</td>
+ <td>{{ dc.montant|floatformat:0 }} {{ dc.devise }}</td>
+ <td>{{ dc.montant_euros|floatformat:0 }} EUR</td>
</tr>
{% endfor %}
</tbody>
-<table>
-<fieldset>
+</table>
+</fieldset>
<div id="form-dossier">
<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>
<p>{{ poste.justification }}</p>
<h3>B - Justification de l'employé</h3>
-<table>
+<table class="justifications">
<tr>
<th>Nouvel employé</th>
<th>Renouvellement, prolongation, reclassement, mobilité interne</th>
<tr>
<td>
<h4>{{ dossier.justif_nouveau_statut_label }}</h4>
- {{ dossier.justif_nouveau_statut|default:"∅" }}
+ <p>{{ dossier.justif_nouveau_statut|default:"∅" }}
<h4>{{ dossier.justif_nouveau_tmp_remplacement_label }}</h4>
- {{ dossier.justif_nouveau_tmp_remplacement|default:"∅" }}
+ <p>{{ dossier.justif_nouveau_tmp_remplacement|default:"∅" }}</p>
<h4>{{ dossier.justif_nouveau_salaire_label }}</h4>
- {{ dossier.justif_nouveau_salaire|default:"∅" }}
+ <p>{{ dossier.justif_nouveau_salaire|default:"∅" }}</p>
<h4>{{ dossier.justif_nouveau_commentaire_label }}</h4>
- {{ dossier.justif_nouveau_commentaire|default:"∅" }}
+ <p>{{ dossier.justif_nouveau_commentaire|default:"∅" }}</p>
</td>
<td>
<h4>{{ dossier.justif_rempl_type_contrat_label }}</h4>
- {{ dossier.justif_rempl_type_contrat|default:"∅"}}
+ <p>{{ dossier.justif_rempl_type_contrat|default:"∅"}}</p>
<h4>{{ dossier.justif_rempl_statut_employe_label }}</h4>
- {{ dossier.justif_rempl_statut_employe|default:"∅"}}
+ <p>{{ dossier.justif_rempl_statut_employe|default:"∅"}}</p>
<h4>{{ dossier.justif_rempl_evaluation_label }}</h4>
- {{ dossier.justif_rempl_evaluation|default:"∅"}}
+ <p>{{ dossier.justif_rempl_evaluation|default:"∅"}}</p>
<h4>{{ dossier.justif_rempl_salaire_label }}</h4>
- {{ dossier.justif_rempl_salaire|default:"∅" }}
+ <p>{{ dossier.justif_rempl_salaire|default:"∅" }}</p>
<h4>{{ dossier.justif_rempl_commentaire_label }}</h4>
- {{ dossier.justif_rempl_commentaire|default:"∅" }}
+ <p>{{ dossier.justif_rempl_commentaire|default:"∅" }}</p>
</td>
</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 %}