2020-01-21 06:35:58 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block title %}Newsletter list - {{ SITE_LONG_NAME }}{% endblock %}
|
|
|
|
{% block content_title %}Newsletter list{% endblock %}
|
|
|
|
|
2020-08-02 22:34:20 +00:00
|
|
|
{% block media %}
|
|
|
|
<style>
|
|
|
|
* {
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
{% endblock %}
|
|
|
|
|
2020-01-21 06:35:58 +00:00
|
|
|
{% block body %}
|
|
|
|
{% if request.user.is_authenticated %}
|
|
|
|
<form method="POST" action="" class="form-area">
|
|
|
|
{% csrf_token %}
|
|
|
|
{{ formset.management_form }}
|
2020-08-02 22:34:20 +00:00
|
|
|
<table class="table">
|
2020-01-21 06:35:58 +00:00
|
|
|
<tr>
|
|
|
|
<th>Newsletter</th>
|
|
|
|
<th>Subscribe</th>
|
|
|
|
</tr>
|
|
|
|
{% for form in formset.forms %}
|
|
|
|
<tr>
|
2020-08-02 22:34:20 +00:00
|
|
|
<td>{{ form.id }}
|
2020-01-21 06:35:58 +00:00
|
|
|
<a href="{{ url('newsletter_archive', form.instance.newsletter.slug) }}">
|
|
|
|
{{ form.instance.newsletter.title }}</a>
|
|
|
|
</td>
|
2020-08-02 22:34:20 +00:00
|
|
|
<td>{{ form.subscribed }}</d>
|
2020-01-21 06:35:58 +00:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
|
|
<p>
|
|
|
|
<input id="id_submit" name="submit" value="Update subscriptions" type="submit" style="float: right">
|
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
{% else %}
|
|
|
|
<table class="form-area">
|
|
|
|
<tr>
|
|
|
|
<th>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 %}
|