mailing.jinja 1.64 KB
Newer Older
Sli's avatar
Sli committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
{% extends "core/base.jinja" %}

{% block title %}
{% trans %}Mailing lists{% endtrans %}
{% endblock %}

{% block content %}
    {% if has_objects %}

    {% for mailing in object_list %}
    <h2>{% trans %}Mailing{% endtrans %} {{ mailing.email }}</h2>
    <table>
        <tr>
            <th>{% trans %}User{% endtrans %}</th>
            <th>{% trans %}Mail{%endtrans%}</th>
        </tr>
        {% for subscriber in mailing.subscriptions.all() %}
        <tr>
            {% if subscriber.user %}
            <td>{{ subscriber.user }}</td>
            {% else %}
            <td>{% trans %}Unregistered user{% endtrans %}</td>
            {% endif %}
            <td>{{ subscriber.email }}</td>
        </tr>
        {% endfor %}
    </table>
    {% endfor %}

    {% else %}
    <p>{% trans %}No mailing list existing for this club{% endtrans %}</p>
    {% endif %}

    {% if club.has_rights_in_club(user) %}

    {% if has_objects %}
        <h2>{% trans %}New member{% endtrans %}</h2>
        <form action="{{ url('club:mailing_subscription_create', club_id=club.id) }}" method="post" enctype="multipart/form-data">
            {% csrf_token %}
            {{ new_member.as_p() }}
            <p><input type="submit" value="{% trans %}Add to mailing list{% endtrans %}" /></p>
        </form>
    {% endif %}

    <h2>{% trans %}New mailing{% endtrans %}</h2>
    <form action="{{ url('club:mailing_create', club_id=club.id) }}" method="post" enctype="multipart/form-data">
        {% csrf_token %}
        {{ new_mailing.as_p() }}
        <p><input type="submit" value="{% trans %}Create mailing list{% endtrans %}" /></p>
    </form>
    {% endif %}

{% endblock %}