From 8f56ad9e996ac546ecfd4bc86b29481829eee177 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 2 Oct 2021 09:50:48 -0700 Subject: [PATCH] Adds report templates --- bookwyrm/templates/notifications/add.html | 35 +++++++++++ bookwyrm/templates/notifications/boost.html | 57 +++++++++++++++++ bookwyrm/templates/notifications/fav.html | 57 +++++++++++++++++ bookwyrm/templates/notifications/follow.html | 13 ++++ .../notifications/follow_request.html | 15 +++++ bookwyrm/templates/notifications/import.html | 12 ++++ bookwyrm/templates/notifications/item.html | 20 +++++- bookwyrm/templates/notifications/mention.html | 3 +- bookwyrm/templates/notifications/reply.html | 62 +++++++++++++++++++ bookwyrm/templates/notifications/report.html | 12 ++++ 10 files changed, 283 insertions(+), 3 deletions(-) create mode 100644 bookwyrm/templates/notifications/add.html create mode 100644 bookwyrm/templates/notifications/boost.html create mode 100644 bookwyrm/templates/notifications/fav.html create mode 100644 bookwyrm/templates/notifications/follow.html create mode 100644 bookwyrm/templates/notifications/follow_request.html create mode 100644 bookwyrm/templates/notifications/import.html create mode 100644 bookwyrm/templates/notifications/reply.html create mode 100644 bookwyrm/templates/notifications/report.html diff --git a/bookwyrm/templates/notifications/add.html b/bookwyrm/templates/notifications/add.html new file mode 100644 index 00000000..6ccabf41 --- /dev/null +++ b/bookwyrm/templates/notifications/add.html @@ -0,0 +1,35 @@ +{% extends 'notifications/item_layout.html' %} + +{% load i18n %} +{% load utilities %} + +{% block icon %} + +{% endblock %} + +{% block description %} +{% with book_path=notification.related_list_item.book.local_path %} +{% with book_title=notification.related_list_item.book|book_title %} +{% with list_path=notification.related_list_item.book_list.local_path %} +{% with list_name=notification.related_list_item.book_list.name %} + + {% if notification.related_list_item.approved %} + {% blocktrans trimmed %} + + added {{ book_title }} to your list "{{ list_name }}" + + {% endblocktrans %} + {% else %} + {% blocktrans trimmed %} + + suggested adding {{ book_title }} to your list "{{ list_name }}" + + {% endblocktrans %} + {% endif %} + +{% endwith %} +{% endwith %} +{% endwith %} +{% endwith %} +{% endblock %} + diff --git a/bookwyrm/templates/notifications/boost.html b/bookwyrm/templates/notifications/boost.html new file mode 100644 index 00000000..0653e8ee --- /dev/null +++ b/bookwyrm/templates/notifications/boost.html @@ -0,0 +1,57 @@ +{% extends 'notifications/item_layout.html' %} + +{% load i18n %} +{% load utilities %} + +{% block icon %} + +{% endblock %} + +{% block description %} + {% with related_status.book|book_title as book_title %} + {% with related_status.local_path as related_path %} + + {% if related_status.status_type == 'Review' %} + {% blocktrans trimmed %} + + boosted your review of {{ book_title }} + + {% endblocktrans %} + {% elif related_status.status_type == 'Comment' %} + {% blocktrans trimmed %} + + boosted your comment on{{ book_title }} + + {% endblocktrans %} + {% elif related_status.status_type == 'Quotation' %} + {% blocktrans trimmed %} + + boosted your quote from {{ book_title }} + + {% endblocktrans %} + {% else %} + {% blocktrans trimmed %} + + boosted your status + + {% endblocktrans %} + {% endif %} + + {% endwith %} + {% endwith %} +{% endblock %} + + +{% block preview %} +
+
+
+ {% include 'snippets/status_preview.html' with status=related_status %} +
+
+ {{ related_status.published_date|timesince }} + {% include 'snippets/privacy-icons.html' with item=related_status %} +
+
+
+{% endblock %} diff --git a/bookwyrm/templates/notifications/fav.html b/bookwyrm/templates/notifications/fav.html new file mode 100644 index 00000000..c9507067 --- /dev/null +++ b/bookwyrm/templates/notifications/fav.html @@ -0,0 +1,57 @@ +{% extends 'notifications/item_layout.html' %} + +{% load i18n %} +{% load utilities %} + +{% block icon %} + +{% endblock %} + +{% block description %} + {% with related_status.book|book_title as book_title %} + {% with related_status.local_path as related_path %} + + {% if related_status.status_type == 'Review' %} + {% blocktrans trimmed %} + + favorited your review of {{ book_title }} + + {% endblocktrans %} + {% elif related_status.status_type == 'Comment' %} + {% blocktrans trimmed %} + + favorited your comment on{{ book_title }} + + {% endblocktrans %} + {% elif related_status.status_type == 'Quotation' %} + {% blocktrans trimmed %} + + favorited your quote from {{ book_title }} + + {% endblocktrans %} + {% else %} + {% blocktrans trimmed %} + + favorited your status + + {% endblocktrans %} + {% endif %} + + {% endwith %} + {% endwith %} +{% endblock %} + + +{% block preview %} +
+
+
+ {% include 'snippets/status_preview.html' with status=related_status %} +
+
+ {{ related_status.published_date|timesince }} + {% include 'snippets/privacy-icons.html' with item=related_status %} +
+
+
+{% endblock %} diff --git a/bookwyrm/templates/notifications/follow.html b/bookwyrm/templates/notifications/follow.html new file mode 100644 index 00000000..8ae0caa7 --- /dev/null +++ b/bookwyrm/templates/notifications/follow.html @@ -0,0 +1,13 @@ +{% extends 'notifications/item_layout.html' %} + +{% load i18n %} +{% load utilities %} + +{% block icon %} + +{% endblock %} + +{% block description %} + {% trans "followed you" %} + {% include 'snippets/follow_button.html' with user=notification.related_user %} +{% endblock %} diff --git a/bookwyrm/templates/notifications/follow_request.html b/bookwyrm/templates/notifications/follow_request.html new file mode 100644 index 00000000..33c0bd1f --- /dev/null +++ b/bookwyrm/templates/notifications/follow_request.html @@ -0,0 +1,15 @@ +{% extends 'notifications/item_layout.html' %} + +{% load i18n %} +{% load utilities %} + +{% block icon %} + +{% endblock %} + +{% block description %} + {% trans "sent you a follow request" %} +
+ {% include 'snippets/follow_request_buttons.html' with user=notification.related_user %} +
+{% endblock %} diff --git a/bookwyrm/templates/notifications/import.html b/bookwyrm/templates/notifications/import.html new file mode 100644 index 00000000..1d311195 --- /dev/null +++ b/bookwyrm/templates/notifications/import.html @@ -0,0 +1,12 @@ +{% extends 'notifications/item_layout.html' %} + +{% load i18n %} + +{% block icon %} + +{% endblock %} + +{% block description %} + {% url 'import-status' notification.related_import.id as url %} + {% blocktrans %}Your import completed.{% endblocktrans %} +{% endblock %} diff --git a/bookwyrm/templates/notifications/item.html b/bookwyrm/templates/notifications/item.html index 29aaf709..6c2ab7fe 100644 --- a/bookwyrm/templates/notifications/item.html +++ b/bookwyrm/templates/notifications/item.html @@ -1,2 +1,20 @@ {# load the right template #} -{% include 'notifications/mention.html' %} +{% if notification.notification_type == 'MENTION' %} + {% include 'notifications/mention.html' %} +{% elif notification.notification_type == 'REPLY' %} + {% include 'notifications/reply.html' %} +{% elif notification.notification_type == 'BOOST' %} + {% include 'notifications/boost.html' %} +{% elif notification.notification_type == 'FAVORITE' %} + {% include 'notifications/fav.html' %} +{% elif notification.notification_type == 'FOLLOW' %} + {% include 'notifications/follow.html' %} +{% elif notification.notification_type == 'FOLLOW_REQUEST' %} + {% include 'notifications/follow_request.html' %} +{% elif notification.notification_type == 'IMPORT' %} + {% include 'notifications/import.html' %} +{% elif notification.notification_type == 'ADD' %} + {% include 'notifications/add.html' %} +{% elif notification.notification_type == 'REPORT' %} + {% include 'notifications/report.html' %} +{% endif %} diff --git a/bookwyrm/templates/notifications/mention.html b/bookwyrm/templates/notifications/mention.html index 58872ef8..c456afdb 100644 --- a/bookwyrm/templates/notifications/mention.html +++ b/bookwyrm/templates/notifications/mention.html @@ -44,14 +44,13 @@ {% endblock %} - {% block preview %}
{% include 'snippets/status_preview.html' with status=related_status %}
-
+
{{ related_status.published_date|timesince }} {% include 'snippets/privacy-icons.html' with item=related_status %}
diff --git a/bookwyrm/templates/notifications/reply.html b/bookwyrm/templates/notifications/reply.html new file mode 100644 index 00000000..d34a267b --- /dev/null +++ b/bookwyrm/templates/notifications/reply.html @@ -0,0 +1,62 @@ +{% extends 'notifications/item_layout.html' %} + +{% load i18n %} +{% load utilities %} + + +{% block icon %} + +{% endblock %} + + +{% block description %} + {% with related_status.reply_parent.book|book_title as book_title %} + {% with related_status.local_path as related_path %} + {% with related_status.reply_parent.local_path as parent_path %} + + {% if related_status.reply_parent.status_type == 'Review' %} + {% blocktrans trimmed %} + + replied to your review of {{ book_title }} + + {% endblocktrans %} + {% elif related_status.reply_parent.status_type == 'Comment' %} + {% blocktrans trimmed %} + + replied to your comment on {{ book_title }} + + {% endblocktrans %} + {% elif related_status.reply_parent.status_type == 'Quotation' %} + {% blocktrans trimmed %} + + replied to your quote from {{ book_title }} + + {% endblocktrans %} + {% else %} + {% blocktrans trimmed %} + + replied to your status + + {% endblocktrans %} + {% endif %} + + {% endwith %} + {% endwith %} + {% endwith %} +{% endblock %} + + + +{% block preview %} +
+
+
+ {% include 'snippets/status_preview.html' with status=related_status %} +
+
+ {{ related_status.published_date|timesince }} + {% include 'snippets/privacy-icons.html' with item=related_status %} +
+
+
+{% endblock %} diff --git a/bookwyrm/templates/notifications/report.html b/bookwyrm/templates/notifications/report.html new file mode 100644 index 00000000..ca0c877d --- /dev/null +++ b/bookwyrm/templates/notifications/report.html @@ -0,0 +1,12 @@ +{% extends 'notifications/item_layout.html' %} + +{% load i18n %} + +{% block icon %} + +{% endblock %} + +{% block description %} + {% url 'settings-report' notification.related_report.id as path %} + {% blocktrans %}A new report needs moderation.{% endblocktrans %} +{% endblock %}