Add newsletter
This commit is contained in:
parent
8f6507fdab
commit
991835e4f4
4 changed files with 30 additions and 7 deletions
|
@ -203,6 +203,7 @@ else:
|
||||||
},
|
},
|
||||||
('judge.BlogPost', 'fa-rss-square'),
|
('judge.BlogPost', 'fa-rss-square'),
|
||||||
('judge.Comment', 'fa-comment-o'),
|
('judge.Comment', 'fa-comment-o'),
|
||||||
|
('judge.Ticket', 'fa-exclamation-circle'),
|
||||||
('flatpages.FlatPage', 'fa-file-text-o'),
|
('flatpages.FlatPage', 'fa-file-text-o'),
|
||||||
('judge.Solution', 'fa-pencil'),
|
('judge.Solution', 'fa-pencil'),
|
||||||
],
|
],
|
||||||
|
@ -238,6 +239,7 @@ INSTALLED_APPS += (
|
||||||
'django_jinja',
|
'django_jinja',
|
||||||
'chat_box',
|
'chat_box',
|
||||||
'channels',
|
'channels',
|
||||||
|
'newsletter',
|
||||||
)
|
)
|
||||||
|
|
||||||
MIDDLEWARE = (
|
MIDDLEWARE = (
|
||||||
|
@ -514,4 +516,16 @@ CHANNEL_LAYERS = {
|
||||||
"hosts": [('0.0.0.0', 6379)],
|
"hosts": [('0.0.0.0', 6379)],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NEWSLETTER_CONFIRM_EMAIL = False
|
||||||
|
|
||||||
|
# Amount of seconds to wait between each email. Here 100ms is used.
|
||||||
|
NEWSLETTER_EMAIL_DELAY = 0.1
|
||||||
|
|
||||||
|
# Amount of seconds to wait between each batch. Here one minute is used.
|
||||||
|
NEWSLETTER_BATCH_DELAY = 60
|
||||||
|
|
||||||
|
# Number of emails in one batch
|
||||||
|
NEWSLETTER_BATCH_SIZE = 100
|
|
@ -33,5 +33,6 @@ sqlparse
|
||||||
channels
|
channels
|
||||||
channels-redis
|
channels-redis
|
||||||
docker
|
docker
|
||||||
|
django-newsletter
|
||||||
python-memcached
|
python-memcached
|
||||||
netaddr
|
netaddr
|
||||||
|
|
|
@ -2,23 +2,31 @@
|
||||||
{% block title %}Newsletter list - {{ SITE_LONG_NAME }}{% endblock %}
|
{% block title %}Newsletter list - {{ SITE_LONG_NAME }}{% endblock %}
|
||||||
{% block content_title %}Newsletter list{% endblock %}
|
{% block content_title %}Newsletter list{% endblock %}
|
||||||
|
|
||||||
|
{% block media %}
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<form method="POST" action="" class="form-area">
|
<form method="POST" action="" class="form-area">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ formset.management_form }}
|
{{ formset.management_form }}
|
||||||
<table>
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Newsletter</th>
|
<th>Newsletter</th>
|
||||||
<th>Subscribe</th>
|
<th>Subscribe</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for form in formset.forms %}
|
{% for form in formset.forms %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ form.id }}{{ form.newsletter }}
|
<td>{{ form.id }}
|
||||||
<a href="{{ url('newsletter_archive', form.instance.newsletter.slug) }}">
|
<a href="{{ url('newsletter_archive', form.instance.newsletter.slug) }}">
|
||||||
{{ form.instance.newsletter.title }}</a>
|
{{ form.instance.newsletter.title }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ form.subscribed }}</td>
|
<td>{{ form.subscribed }}</d>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block title %}{{ object.title }} - Newsletter Archive - {{ SITE_LONG_NAME }}{% endblock %}
|
{% block title %}{{ newsletter }} - Newsletter Archive - {{ SITE_LONG_NAME }}{% endblock %}
|
||||||
{% block content_title %}Newsletter Archive: {{ object.title }}{% endblock %}
|
{% block content_title %}Newsletter Archive: {{ newsletter }}{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for submission in latest %}
|
{% for submission in latest %}
|
||||||
<li><a href="{{ submission.get_absolute_url }}">{{ submission }}</a></li>
|
<li><a href="{{ submission.get_absolute_url() }}">{{ submission }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
Loading…
Reference in a new issue