{% load combo %}

<h2>Transport</h2>
<div class="cell--body">

{% if json.data and not json.err %}

{% with json.data as data %}

<h3>Synthèse</h3>

{% if data.cumuls %}
<ul>
  {% for cumul in data.cumuls %}
    <li>{{ cumul.type }} : {{ cumul.duree }}</li>
  {% endfor %}
</ul>
{% endif %}

{% if data.attestations %}
<div class="pk-table-wrapper">
<table class="pk-data-table pk-table-headers pk-table-borders pk-table-zebra" style="width:100%;">
  <tr>
    <th>Transporteur</th>
    <th>Type</th>
    <th>Statut</th>
    <th>Durée proposée</th>
    <th>Durée validée</th>
    <th>Durée réelle</th>
    <th>Date de début</th>
    <th>Date de fin</th>
    <th>Date attestation</th>
  </tr>
  {% for att in data.attestations %}
  <tr>
    <td>{{ att.libelle }}</td>
    <td>{{ att.type }}</td>
    <td>{{ att.statut }}</td>
    <td>{% if att.duree_prop %}{{ att.duree_prop }}{% endif %}</td>
    <td>{% if att.duree_val %}{{ att.duree_val }}{% endif %}</td>
    <td>{% if att.duree %}{{ att.duree }}{% endif %}</td>
    <td>{{ att.date_deb_grat|date:"d/m/Y"|default:"" }}</td>
    <td>{{ att.date_fin_grat|date:"d/m/Y"|default:"" }}</td>
    <td>{{ att.date_edit_attest|date:"d/m/Y"|default:"" }}</td>
  </tr>
  {% endfor %}
</table>
</div>
{% endif %}

{% endwith %}

{% else %}
<p>Aucune information.</p>
{% endif %}

</div>
