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

{% block table.tbody.row %}
  <tr class="js-mailbox-row {% cycle "odd" "even" as parity %}"
      data-id="{{ row.record.id }}"
  >
    {% for column, cell in row.items %}
      <td {{ column.attrs.td.as_html }}>
        {{ cell }}
        {% if column.name == 'filetype' and row.record.comment %}
          <span class="tooltip"><i class="fa fa-eye plus"></i>
            <p>{{ row.record.comment }}</p>
          </span>
        {% endif %}
      </td>
    {% endfor %}
  </tr>
  {% block replies %}
    {% for reply in row.record.document.replies.all %}
      <tr class="{{parity }} reply">
        <td class="reply" colspan="7">
          <a href="{% url 'outbox-by-document-message' document_id=reply.id %}">
            {% blocktrans with sender=reply|doc_real_sender date=reply.date|naturalday:"SHORT_DATE_FORMAT" time=reply.date|time:"H:i" %}Reply sent by {{ sender }} on {{ date }} at {{ time }}{% endblocktrans %}
          </a>
        </td>
      </tr>
    {% endfor %}
  {% endblock %}
{% endblock %}

{% block pagination %}
  <ul class="pagination">
    {% if table.page.has_previous %}
      {% block pagination.previous %}{{ block.super }}{% endblock pagination.previous %}
    {% endif %}

    {% if table.page.has_previous or table.page.has_next %}
      {% block pagination.current %}{{ block.super }}{% endblock pagination.current %}
    {% endif %}

    {% if table.page.has_next %}
      {% block pagination.next %}{{ block.super }}{% endblock pagination.next %}
    {% endif %}

    {% block pagination.cardinality %}
{% comment %}
Block of action buttons

Behaviour is in static/js/actions.js
{% endcomment %}

    {% endblock %}
  </ul>
{% endblock pagination %}
