{% extends postorius_base_template %}

{% load i18n %}
{% load nav_helpers %}

{% block subtitle %}
{% trans 'Subscriptions' %} | {{ user.username }}
{% endblock %}

{% block main %}

    {% user_nav 'subscriptions' 'List Subscriptions' %}
    {% if memberships %}
        <p>{% trans 'You are subscribed to the following mailing lists:' %}</p>
        <div class="table-responsive">
            <table class="table table-bordered table-striped">
                <thead>
                    <tr>
                        <th>{% trans 'List Name' %}</th>
                        <th>{% trans 'Subscription Address' %}</th>
                        <th>{% trans 'Delivery Mode' %}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for subscription in memberships %}
                        <tr>
                            <td><a href="{% url 'list_summary' subscription.list_id %}">{{ subscription.list_id }}</a></td>
                            <td>{{ subscription.address }}</td>
                            <td>{{ subscription.preferences.delivery_mode }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    {% else %}
        <p>{% trans 'You are not yet subscribed to any lists.' %}</p>
    {% endif %}
{% endblock main %}
