diff options
Diffstat (limited to 'templates/newsletter/newsletter_list.html')
-rw-r--r-- | templates/newsletter/newsletter_list.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/templates/newsletter/newsletter_list.html b/templates/newsletter/newsletter_list.html new file mode 100644 index 0000000..2b48fa2 --- /dev/null +++ b/templates/newsletter/newsletter_list.html @@ -0,0 +1,41 @@ +{% extends "newsletter/common.html" %} + +{% load i18n %} + +{% block title %}{% trans "Newsletter list" %}{% endblock title %} + +{% block body %} +{% if user.is_authenticated %} +<form method="POST" action=""> + {% csrf_token %} + {{ formset.management_form }} + <table> + <tr> + <th>{% trans "Newsletter" %}</th> + {% if user %} + <th>{% trans "Subscribe" %}</th> + {% endif %} + </tr> + {% for form in formset.forms %} + <tr> + <td>{{ form.id }}{{ form.newsletter }} +<a href="{% url "newsletter_detail" form.instance.newsletter.slug %}">{{ form.instance.newsletter.title }}</a></td> + <td>{{ form.subscribed }}</td> + </tr> + {% endfor %} + </table> + <p><input id="id_submit" name="submit" value="{% trans "Update subscriptions" %}" type="submit" /></p> +</form> +{% else %} +<table> + <tr> + <th>{% trans "Newsletter" %}</th> + </tr> + {% for newsletter in object_list %} + <tr> + <td><a href="{% url "newsletter_detail" newsletter.slug %}">{{ newsletter.title }}</a></td> + </tr> + {% endfor %} +</table> +{% endif %} +{% endblock body %} |