NDOJ/templates/newsletter/newsletter_list.html

46 lines
1.7 KiB
HTML
Raw Permalink Normal View History

2020-01-21 06:35:58 +00:00
{% extends "base.html" %}
2020-08-02 22:52:44 +00:00
{% block title %} {{ _('Newsletter list') }} - {{ SITE_LONG_NAME }}{% endblock %}
{% block content_title %} {{ _('Newsletter list') }} {% endblock %}
2020-08-02 22:34:20 +00:00
2020-01-21 06:35:58 +00:00
{% block body %}
2020-08-02 22:52:44 +00:00
<h3> {{ _('Subscribe to get the latest emails about upcoming contests and events.')}} </h3>
<br/>
<div style="width: 50%; margin: auto;">
2020-01-21 06:35:58 +00:00
{% if request.user.is_authenticated %}
2020-08-02 22:52:44 +00:00
<form method="POST" action="" class="form-area" style="width:100%;">
2020-01-21 06:35:58 +00:00
{% 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>
2020-08-02 22:52:44 +00:00
<th>{{ _('Newsletter') }}</th>
<th>{{ _('Subscribe') }}</th>
2020-01-21 06:35:58 +00:00
</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>
2020-08-02 22:52:44 +00:00
<input id="id_submit" name="submit" value="{{_('Update subscriptions')}}" type="submit" style="float: right">
2020-01-21 06:35:58 +00:00
</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 %}
2020-08-02 22:52:44 +00:00
</div>
2020-01-21 06:35:58 +00:00
{% endblock %}