{% extends "forum/profile.html" %}
{% load i18n %}

{% block profile_content %}
<div class="messages">
    <header>
        <h5>
            You got {{ new_messages.count }} new message{{ new_messages.count|pluralize }}.
        </h5>
    </header>
    {% if object_list %}
    <table>
        <thead>
            <tr>
                <th class="messages_subject">
                    <a href="#">{% trans "Subject" %}</a></th>
                <th class="messages_author">
                    <a href="#">{% trans "Author" %}</a></th>
                <th class="messages_date">
                    <a href="#">{% trans "Date" %}</a></th>
            </tr>
        </thead>
        <tbody>
            {% for message in object_list %}
            <tr class='{{ forloop.counter0|divisibleby:"2"|default:"mark" }}'>
                <td class="messages_subject">
                    {% if not message.was_read %}
                        <span class="label radius">new</span>
                    {% else %}
                        <span class="label success radius">read</span>
                    {% endif %}
                    <a href='{{ message.get_absolute_url }}'>{{ message }}</a>
                </td>
                <td class="messages_author">
                    {% with message.author as author %}
                    <a href='{{ author.get_absolute_url }}'>{{ author }}</a>
                    {% endwith %}
                </td>
                <td class="messages_date">{{ message.creation_time }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
    {% endif %}
</div>
{% endblock %}