diff --git a/dmoj/settings.py b/dmoj/settings.py index 08e3896..826311e 100644 --- a/dmoj/settings.py +++ b/dmoj/settings.py @@ -203,6 +203,7 @@ else: }, ('judge.BlogPost', 'fa-rss-square'), ('judge.Comment', 'fa-comment-o'), + ('judge.Ticket', 'fa-exclamation-circle'), ('flatpages.FlatPage', 'fa-file-text-o'), ('judge.Solution', 'fa-pencil'), ], @@ -238,6 +239,7 @@ INSTALLED_APPS += ( 'django_jinja', 'chat_box', 'channels', + 'newsletter', ) MIDDLEWARE = ( @@ -514,4 +516,16 @@ CHANNEL_LAYERS = { "hosts": [('0.0.0.0', 6379)], }, }, -} \ No newline at end of file +} + + +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 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 035bad7..9adbcce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,5 +33,6 @@ sqlparse channels channels-redis docker +django-newsletter python-memcached netaddr diff --git a/templates/newsletter/newsletter_list.html b/templates/newsletter/newsletter_list.html index 86b200c..8feeb70 100644 --- a/templates/newsletter/newsletter_list.html +++ b/templates/newsletter/newsletter_list.html @@ -2,23 +2,31 @@ {% block title %}Newsletter list - {{ SITE_LONG_NAME }}{% endblock %} {% block content_title %}Newsletter list{% endblock %} +{% block media %} + +{% endblock %} + {% block body %} {% if request.user.is_authenticated %}
{% csrf_token %} {{ formset.management_form }} - +
{% for form in formset.forms %} - - + {% endfor %}
Newsletter Subscribe
{{ form.id }}{{ form.newsletter }} + {{ form.id }} {{ form.instance.newsletter.title }} {{ form.subscribed }}{{ form.subscribed }}
diff --git a/templates/newsletter/submission_archive.html b/templates/newsletter/submission_archive.html index 49bdeda..4dd2689 100644 --- a/templates/newsletter/submission_archive.html +++ b/templates/newsletter/submission_archive.html @@ -1,11 +1,11 @@ {% extends "base.html" %} -{% block title %}{{ object.title }} - Newsletter Archive - {{ SITE_LONG_NAME }}{% endblock %} -{% block content_title %}Newsletter Archive: {{ object.title }}{% endblock %} +{% block title %}{{ newsletter }} - Newsletter Archive - {{ SITE_LONG_NAME }}{% endblock %} +{% block content_title %}Newsletter Archive: {{ newsletter }}{% endblock %} {% block body %}