50 lines
No EOL
1.6 KiB
HTML
50 lines
No EOL
1.6 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Newsletter list - {{ SITE_LONG_NAME }}{% endblock %}
|
|
{% block content_title %}Newsletter list{% endblock %}
|
|
|
|
{% block media %}
|
|
<style>
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
{% if request.user.is_authenticated %}
|
|
<form method="POST" action="" class="form-area">
|
|
{% csrf_token %}
|
|
{{ formset.management_form }}
|
|
<table class="table">
|
|
<tr>
|
|
<th>Newsletter</th>
|
|
<th>Subscribe</th>
|
|
</tr>
|
|
{% for form in formset.forms %}
|
|
<tr>
|
|
<td>{{ form.id }}
|
|
<a href="{{ url('newsletter_archive', form.instance.newsletter.slug) }}">
|
|
{{ form.instance.newsletter.title }}</a>
|
|
</td>
|
|
<td>{{ form.subscribed }}</d>
|
|
</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 %} |