summaryrefslogtreecommitdiff
path: root/design/templates/newsletter/newsletter_list.html
blob: 2b48fa2f750d8dffc3bb2a267d75369eb0aa7903 (plain)
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
{% 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 %}