Improve notification description

This commit is contained in:
rubenwardy 2020-12-06 01:23:18 +00:00
parent 8ff61b4517
commit 2910fcc1a4
2 changed files with 17 additions and 14 deletions

View File

@ -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 ""

View File

@ -2,17 +2,18 @@
{% block content %}
<h2 style="margin-top: 0;">
{% if notification.package %}
{{ _("New notification on package %(package)s", package=notification.package.title) }}
{% else %}
{{ _("New notification") }}
{% endif %}
{{ notification.title }}
</h2>
<p><small>{{ _("Triggered by %(username)s", username=notification.causer.display_name) }}</small></p>
<p>
{{ 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 %}
</p>
<p>
@ -33,5 +34,7 @@
|
<a href="{{ abs_url_for('users.unsubscribe', token=sub.token) }}">
{{ _("Unsubscribe") }}
</a>
</a> <br>
{{ _("This is a '%(type)s' notification.", type=notification.type.getTitle()) }}
{% endblock %}