{% extends "django_tables2/table.html" %}
{% load django_tables2 %}
{% load i18n %}

{% block table.thead %}
  <thead>
    <tr>
      <th class="">Titre</th>
      <th class="creation">Date de création</th>
      <th class="expiration">Date d’expiration</th>
      <th class="action-column"></th>
    </tr>
  </thead>
{% endblock table.thead %}

{% block table.tbody.row %}
  <tr class="{{ forloop.counter|divisibleby:2|yesno:"even,odd" }} {{row.record.css_classes}}"
      data-url="{{row.record.get_download_url}}"
      > {# avoid cycle for Django 1.2-1.6 compatibility #}
    <td class="title">{{ row.record }}</td>
    <td class="creation">{{ row.record.created }}</td>
    <td class="expiration">{{ row.record.expiration_date|date:"SHORT_DATE_FORMAT" }}</td>
    <td class="action-column" rowspan={{ row.record.description|yesno:"2,1" }}>
      {% block action-column %}
      {% if include_edit_link %}
        <a class="icon-edit" data-popup href="{% url 'edit' pk=row.record.pk %}"></a>
      {% endif %}
      {% if row.record.deletable_by_user %}
        <a class="icon-remove" data-popup href="{% url 'delete' pk=row.record.pk %}"></a>
      {% endif %}
      {% endblock %}
   </td>
  </tr>
  {% if row.record.description %}
  <tr class="{{ forloop.counter|divisibleby:2|yesno:"even,odd" }} description-row">
      <td class="description" colspan={{table.columns|length|add:"1"}}>{{row.record.description}}</td>
  </tr>
  {% endif %}
{% endblock table.tbody.row %}

{% block pagination.cardinality %}
{% endblock %}

{% block table.tbody.empty_text %}
<tr class="empty"><td colspan="4">{{ table.empty_text }}</td></tr>
{% endblock %}
