From 2910fcc1a4bf0347284a93d5f0632a7abc7715a4 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 6 Dec 2020 01:23:18 +0000 Subject: [PATCH] Improve notification description --- app/models.py | 12 ++++++------ app/templates/emails/notification.html | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/app/models.py b/app/models.py index 8893853..acb63ba 100644 --- a/app/models.py +++ b/app/models.py @@ -327,24 +327,24 @@ class NotificationType(enum.Enum): return self.name.lower() def get_description(self): - if self == NotificationType.OTHER: - return "Minor notifications not important enough for a dedicated category." - elif self == NotificationType.PACKAGE_EDIT: + if self == NotificationType.PACKAGE_EDIT: return "When another user edits your packages, releases, etc." elif self == NotificationType.PACKAGE_APPROVAL: return "Notifications from editors related to the package approval process." elif self == NotificationType.NEW_THREAD: return "When a thread is created on your package." elif self == NotificationType.NEW_REVIEW: - return "When a user posts a review." + return "When a user posts a review on your package." elif self == NotificationType.THREAD_REPLY: return "When someone replies to a thread you're watching." elif self == NotificationType.MAINTAINER: return "When your package's maintainers change." elif self == NotificationType.EDITOR_ALERT: - return "Important editor alerts." + return "For editors: Important alerts." elif self == NotificationType.EDITOR_MISC: - return "Miscellaneous editor alerts." + return "For editors: Minor notifications, including new threads." + elif self == NotificationType.OTHER: + return "Minor notifications not important enough for a dedicated category." else: return "" diff --git a/app/templates/emails/notification.html b/app/templates/emails/notification.html index 44fd228..f5891d9 100644 --- a/app/templates/emails/notification.html +++ b/app/templates/emails/notification.html @@ -2,17 +2,18 @@ {% block content %}

- {% if notification.package %} - {{ _("New notification on package %(package)s", package=notification.package.title) }} - {% else %} - {{ _("New notification") }} - {% endif %} + {{ notification.title }}

-

{{ _("Triggered by %(username)s", username=notification.causer.display_name) }}

+

- {{ notification.title }} + {% if notification.package %} + {{ _("From %(username)s and on package %(package)s.", + username=notification.causer.display_name, package=notification.package.title) }} + {% else %} + {{ _("From %(username)s.", username=notification.causer.display_name) }} + {% endif %}

@@ -33,5 +34,7 @@ | {{ _("Unsubscribe") }} - +
+ + {{ _("This is a '%(type)s' notification.", type=notification.type.getTitle()) }} {% endblock %}