pinax/messages/inbox.html

{% extends "pinax/messages/base.html" %}

{% load i18n %}
{% load pinax_messages_tags %}

{% block head_title %}Messages{% endblock %}

{% block body_class %}{{ block.super }} pinax-messages-inbox{% endblock %}

{% block body %}
<div class="pinax-messages-inbox-container">
    <h2 class="with-actions">
        Inbox
        <a class="button" href="{% url "pinax_messages:message_create" %}">
            <i class="fas fa-envelope"></i>
            New Message
        </a>
    </h2>

    <section class="mailbox">
        {% for thread in threads %}
            <div class="thread {% if thread|unread:user %}unread{% endif %}">
                <a href="{{thread.get_absolute_url}}">
                    <div class="participants">{{ thread.users.all|join:", " }}</div>
                    <div class="latest-message">
                        <p class="subject">{{ thread.subject }}</p>
                        <p class="content">{{ thread.latest_message.content }}</p>
                    </div>
                </a>
            </div>
        {% empty %}
            <div class="no-messages">You have no messages.</div>
        {% endfor %}
    </section>
</div>
{% endblock %}