From e8129856046318952640567342e9bc0d66cfc816 Mon Sep 17 00:00:00 2001 From: Jonathan Weth <git@jonathanweth.de> Date: Sat, 14 Nov 2020 18:24:29 +0100 Subject: [PATCH] Move email templates and preferences for data checks to core --- aleksis/apps/alsijil/preferences.py | 21 --------- .../templates/templated_email/data_checks.css | 16 ------- .../templated_email/data_checks.email | 44 ------------------- 3 files changed, 81 deletions(-) delete mode 100644 aleksis/apps/alsijil/templates/templated_email/data_checks.css delete mode 100644 aleksis/apps/alsijil/templates/templated_email/data_checks.email diff --git a/aleksis/apps/alsijil/preferences.py b/aleksis/apps/alsijil/preferences.py index f45441da1..217dd1d51 100644 --- a/aleksis/apps/alsijil/preferences.py +++ b/aleksis/apps/alsijil/preferences.py @@ -59,24 +59,3 @@ class AllowOpenPeriodsOnSameDay(BooleanPreference): help_text = _( "Lessons in the past are not affected by this setting, you can open them whenever you want." ) - - -@site_preferences_registry.register -class DataChecksSendEmails(BooleanPreference): - """Enable email sending if data checks detect problems.""" - - section = alsijil - name = "data_checks_send_emails" - default = False - verbose_name = _("Send emails if data checks detect problems") - - -@site_preferences_registry.register -class DataChecksEmailsRecipients(ModelMultipleChoicePreference): - """Email recipients for data check problem emails.""" - - section = alsijil - name = "data_checks_recipients" - default = [] - model = Person - verbose_name = _("Email recipients for data checks problem emails") diff --git a/aleksis/apps/alsijil/templates/templated_email/data_checks.css b/aleksis/apps/alsijil/templates/templated_email/data_checks.css deleted file mode 100644 index b385b185e..000000000 --- a/aleksis/apps/alsijil/templates/templated_email/data_checks.css +++ /dev/null @@ -1,16 +0,0 @@ -body { - line-height: 1.5; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-weight: normal; - color: rgba(0, 0, 0, 0.87); -} - -.count { - text-align: right; - font-family: monospace; - font-size: 14pt; -} - -td, th { - padding: 10px; -} diff --git a/aleksis/apps/alsijil/templates/templated_email/data_checks.email b/aleksis/apps/alsijil/templates/templated_email/data_checks.email deleted file mode 100644 index 636dc27d3..000000000 --- a/aleksis/apps/alsijil/templates/templated_email/data_checks.email +++ /dev/null @@ -1,44 +0,0 @@ -{% load i18n %} - -{% block subject %} - {% trans "The system detected some new problems with your data." %} -{% endblock %} - -{% block plain %} - {% trans "Hello," %} - - {% blocktrans %} - the system detected some new problems with your data in the digital class register. - Please take some time to inspect them and solve the issues or mark them as ignored. - {% endblocktrans %} - - {% for result in results %} - {{ result.0.problem_name }}: {{ result.1 }} - {% endfor %} -{% endblock %} - -{% block html %} - <style> - {% include "templated_email/data_checks.css" %} - </style> - <p>{% trans "Hello," %}</p> - <p> - {% blocktrans %} - the system detected some new problems with your data in the digital class register. - Please take some time to inspect them and solve the issues or mark them as ignored. - {% endblocktrans %} - </p> - - <table> - <tr> - <th>{% trans "Problem description" %}</th> - <th>{% trans "Count of objects with new problems" %}</th> - </tr> - {% for result in results %} - <tr> - <td>{{ result.0.problem_name }}</td> - <td class="count">{{ result.1 }}</td> - </tr> - {% endfor %} - </table> -{% endblock %} -- GitLab