{% load combo %}

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

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

{% with json.data as data %}

<h3>En cours</h3>

<div class="pk-table-wrapper">
<table class="pk-data-table pk-table-headers pk-table-borders pk-table-zebra" style="width:100%;">
  <tr>
    <th>Nom</th>
    <th>Code SAC</th>
    <th>Date de préconisation</th>
    <th>Date de début</th>
    <th>Date de fin</th>
    <th>Validation</th>
  </tr>

  {% for action in data %}
  {% if action.clos == "Non" %}
  <tr>
    <td><a href="action/{{ action.id }}">{{ action.libelle|default:"" }}</a></td>
    <td>{{ action.sac|default:"" }}</td>
    <td>{{ action.date_preconisation|date:"d/m/Y"|default:"" }}</td>
    <td>{{ action.date_deb|date:"d/m/Y"|default:"" }}</td>
    <td>{{ action.date_fin|date:"d/m/Y"|default:"" }}</td>
    <td>{{ action.validation|default:"" }}</td>
  </tr>
  {% endif %}
  {% endfor %}
</table>
</div>

<h3>Terminées</h3>

<div class="pk-table-wrapper">
<table class="pk-data-table pk-table-headers pk-table-borders pk-table-zebra" style="width:100%;">
  <tr>
    <th>Nom</th>
    <th>Code SAC</th>
    <th>Date de préconisation</th>
    <th>Date de début</th>
    <th>Date de fin</th>
    <th>Validation</th>
  </tr>

  {% for action in data %}
  {% if action.clos == "Oui" %}
  <tr>
    <td><a href="action/{{ action.id }}">{{ action.libelle|default:"" }}</a></td>
    <td>{{ action.sac|default:"" }}</td>
    <td>{{ action.date_preconisation|date:"d/m/Y"|default:"" }}</td>
    <td>{{ action.date_deb|date:"d/m/Y"|default:"" }}</td>
    <td>{{ action.date_fin|date:"d/m/Y"|default:"" }}</td>
    <td>{{ action.validation|default:"" }}</td>
  </tr>
  {% endif %}
  {% endfor %}
</table>
</div>

{% endwith %}

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

</div>
