{% extends 'pybb/base.html' %}
{% load url from future %}
{% load i18n pybb_tags %}

{% block private_messages %}{% endblock %}
{% block breadcrumb %}{% endblock %}

{% block content %}

{% with _('Messages') as label %}
    {% include "pybb/pagination.html" %}
{% endwith %}

<table class="table message-list">
    <thead>
        <tr class="message-row head-row">
            <th class="message-sender">
                {% trans "From" %}
            </th>
            <th class="message-subject">
                {% trans "Subject" %}
            </th>
            <th class="message-sent">
                {% trans "Sent" %}
            </th>
        </tr>
    </thead>
    {% for message in message_list %}
    <tr class="message-row{% if message.unread %} unread{% endif %}">
        <td class="message-sender">
            {% pybb_get_profile user=message.sender as sender %}
            <a href="{{ sender.get_absolute_url }}">{{ sender.get_display_name }}</a>
        </td>
        <td class="message-subject">
            <a href="{{ message.get_absolute_url }}">{{ message.subject }}</a>
        </td>
        <td class="message-sent">
            {% pybb_time message.sent %}
        </td>
    </tr>
    {% empty %}
    <td></td>
    <td>{% trans "You don't have any messages" %}</td>
    <td></td>
    {% endfor %}
</table>

{% endblock content %}
