Sith/club/templates/club/mailing.jinja

57 lines
1.9 KiB
Plaintext
Raw Normal View History

2017-08-16 22:07:19 +00:00
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Mailing lists{% endtrans %}
{% endblock %}
{% block content %}
{% if has_objects %}
{% for mailing in object_list %}
2017-08-17 18:55:20 +00:00
<h2>{% trans %}Mailing{% endtrans %} {{ mailing.email }}
{%- if user.is_owner(mailing) -%}
2017-08-17 19:46:13 +00:00
<a href="{{ url('club:mailing_delete', mailing_id=mailing.id) }}"> - {% trans %}Delete{% endtrans %}</a>
2017-08-17 18:55:20 +00:00
{%- endif -%}
</h2>
<hr>
2017-08-16 22:07:19 +00:00
<table>
<tr>
<th>{% trans %}User{% endtrans %}</th>
2017-08-17 18:55:20 +00:00
<th colspan="2">{% trans %}Email{%endtrans%}</th>
2017-08-16 22:07:19 +00:00
</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>
2017-08-17 18:55:20 +00:00
<td><a href="{{ url('club:mailing_subscription_delete', mailing_subscription_id=subscriber.id) }}">{% trans %}Delete{% endtrans %}</a></td>
2017-08-16 22:07:19 +00:00
</tr>
{% endfor %}
</table>
{% endfor %}
{% else %}
<p>{% trans %}No mailing list existing for this club{% endtrans %}</p>
{% endif %}
{% 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 %}
2017-08-18 23:19:31 +00:00
{{ add_member.as_p() }}
2017-08-16 22:07:19 +00:00
<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 %}
2017-08-18 23:19:31 +00:00
{{ add_mailing.as_p() }}
2017-08-16 22:07:19 +00:00
<p><input type="submit" value="{% trans %}Create mailing list{% endtrans %}" /></p>
</form>
{% endblock %}