{% extends "orga/mails/base.html" %}
{% load bootstrap4 %}
{% load i18n %}
{% load url_replace %}
{% block mail_content %}

    <legend>{{ mails.count }} {% trans "sent e-mails" %}</legend>
    {% include "common/search_form.html" %}
    <table class="table table-condensed table-responsive-md">
        <thead>
            <tr>
                <th>
                    {% trans "Subject" %}
                    <a href="?{% url_replace request 'sort' '-subject' %}"><i class="fa fa-caret-down"></i></a>
                    <a href="?{% url_replace request 'sort' 'subject' %}"><i class="fa fa-caret-up"></i></a>
                </th>
                <th>
                    {% trans "To" %}
                    <a href="?{% url_replace request 'sort' '-to' %}"><i class="fa fa-caret-down"></i></a>
                    <a href="?{% url_replace request 'sort' 'to' %}"><i class="fa fa-caret-up"></i></a>
                </th>
                <th>
                    {% trans "Sent" %}
                    <a href="?{% url_replace request 'sort' '-sent' %}"><i class="fa fa-caret-down"></i></a>
                    <a href="?{% url_replace request 'sort' 'sent' %}"><i class="fa fa-caret-up"></i></a>
                </th>
            </tr>
        </thead>
        <tbody>
            {% for mail in mails %}
            <tr>
                <td>
                    <a href="{{ mail.urls.base }}">
                        {{ mail.subject }}
                    </a>
                </td>
                <td>
                    {{ mail.to }}
                </td>
                <td>
                    {{ mail.sent }}
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    {% include "orga/pagination.html" %}

{% endblock %}
