From e5e319db6c0af2845b004bbd812b68f25b4b371a Mon Sep 17 00:00:00 2001 From: TheVillageGuy <47496248+TheVillageGuy@users.noreply.github.com> Date: Sat, 14 Dec 2024 18:09:39 +0100 Subject: [PATCH 1/4] Update front.html.twig Add border to non federated notifications for admins and moderators This allows admins/moderators (when they receive notifications in the future) to quickly see if there has been any activity by local users on their instance --- templates/notifications/front.html.twig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/notifications/front.html.twig b/templates/notifications/front.html.twig index 6612eee1a..265bc4a83 100644 --- a/templates/notifications/front.html.twig +++ b/templates/notifications/front.html.twig @@ -46,7 +46,10 @@ {% for notification in notifications %} -
+
{%- with { notification: notification, From 4c8733dd9d6429cf33b1e0477e65082dd9c1ebb6 Mon Sep 17 00:00:00 2001 From: TheVillageGuy <47496248+TheVillageGuy@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:52:48 +0100 Subject: [PATCH 2/4] Add title to div Title shows entry as local and author --- templates/notifications/front.html.twig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/templates/notifications/front.html.twig b/templates/notifications/front.html.twig index 265bc4a83..93766ead9 100644 --- a/templates/notifications/front.html.twig +++ b/templates/notifications/front.html.twig @@ -42,13 +42,23 @@
-
{% for notification in notifications %}
{%- with { From 2b80d3d66119a6591cb07288694d8468bbc42f2f Mon Sep 17 00:00:00 2001 From: TheVillageGuy <47496248+TheVillageGuy@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:13:52 +0100 Subject: [PATCH 3/4] Update front.html.twig remove bordering from here --- templates/notifications/front.html.twig | 31 +++++++------------------ 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/templates/notifications/front.html.twig b/templates/notifications/front.html.twig index 93766ead9..36200c730 100644 --- a/templates/notifications/front.html.twig +++ b/templates/notifications/front.html.twig @@ -46,29 +46,14 @@ {% for notification in notifications %}
-
- {%- with { - notification: notification, - showMagazine: false, - } only -%} - {{ block(notification.type) }} - {%- endwith -%} -
- {{ component('date', {date: notification.createdAt}) }} + {%- with { + notification: notification, + showMagazine: false, + } only -%} + {{ block(notification.type) }} + {%- endwith -%} +
+ {{ component('date', {date: notification.createdAt}) }}
{% endfor %} {% if(notifications.haveToPaginate is defined and notifications.haveToPaginate) %} From 044cb0fc3c186eeed63d76076d866699b13f177e Mon Sep 17 00:00:00 2001 From: TheVillageGuy <47496248+TheVillageGuy@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:17:50 +0100 Subject: [PATCH 4/4] move bordering to this file Saves a lot of var checking and gives more potential for future visual improvements in the notifications --- templates/notifications/_blocks.html.twig | 55 +++++++++++++++++++++-- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/templates/notifications/_blocks.html.twig b/templates/notifications/_blocks.html.twig index 4e9a157e4..d36861d69 100644 --- a/templates/notifications/_blocks.html.twig +++ b/templates/notifications/_blocks.html.twig @@ -1,106 +1,152 @@ {% block entry_created_notification %} - {{ component('user_inline', {user: notification.entry.user}) }} {{ 'added_new_thread'|trans|lower }} - {{ notification.entry.shortTitle }} + {% if not notification.entry.magazine.apId and (app.user.admin or notification.entry.magazine.userIsModerator(app.user)) %} + style="border-color:var(--kbin-upvoted-color);" + {% set titleString = 'notification_created_on_this_instance'|trans %} + {% set titleString = titleString ~ notification.entry.user.username %} + title="{{ titleString }}" + {% endif %}>
+ {{ component('user_inline', {user: notification.entry.user}) }} {{ 'added_new_thread'|trans|lower }} - {{ notification.entry.shortTitle ~ modString }} {% endblock entry_created_notification %} {% block entry_edited_notification %} + >
{{ component('user_inline', {user: notification.entry.user}) }} {{ 'edited_thread'|trans|lower }} - {{ notification.entry.shortTitle }} {% endblock entry_edited_notification %} {% block entry_deleted_notification %} + >
{{ notification.entry.shortTitle }} {% if notification.entry.isTrashed %}{{ 'removed'|trans|lower }}{% else %}{{ 'deleted'|trans|lower }}{% endif %} {% endblock entry_deleted_notification %} {% block entry_mentioned_notification %} + >
{{ component('user_inline', {user: notification.entry.user}) }} {{ 'mentioned_you'|trans|lower }} - {{ notification.entry.shortTitle }} {% endblock entry_mentioned_notification %} {% block entry_comment_created_notification %} + {% if not notification.comment.magazine.apId and (app.user.admin or notification.comment.magazine.userIsModerator(app.user)) %} + style="border-color:var(--kbin-upvoted-color);" + {% set titleString = 'notification_created_on_this_instance'|trans %} + {% set titleString = titleString ~ notification.comment.user.username %} + title="{{ titleString }}" + {% endif %}>
{{ component('user_inline', {user: notification.comment.user}) }} {{ 'added_new_comment'|trans|lower }} - {{ notification.comment.shortTitle }} {% endblock entry_comment_created_notification %} {% block entry_comment_edited_notification %} + >
{{ component('user_inline', {user: notification.comment.user}) }} {{ 'edited_comment'|trans|lower }} - {{ notification.comment.shortTitle }} {% endblock entry_comment_edited_notification %} {% block entry_comment_reply_notification %} + >
{{ component('user_inline', {user: notification.comment.user}) }} {{ 'replied_to_your_comment'|trans|lower }} - {{ notification.comment.shortTitle }} {% endblock entry_comment_reply_notification %} {% block entry_comment_deleted_notification %} + >
{{ 'comment'|trans }} {{ notification.comment.shortTitle }} - {% if notification.comment.isTrashed %}{{ 'removed'|trans|lower }}{% else %}{{ 'deleted'|trans|lower }}{% endif %} {% endblock entry_comment_deleted_notification %} {% block entry_comment_mentioned_notification %} + >
{{ component('user_inline', {user: notification.comment.user}) }} {{ 'mentioned_you'|trans|lower }} - {{ notification.comment.shortTitle }} {% endblock entry_comment_mentioned_notification %} {% block post_created_notification %} + {% if not notification.post.magazine.apId and (app.user.admin or notification.post.magazine.userIsModerator(app.user)) %} + style="border-color:var(--kbin-upvoted-color);" + {% set titleString = 'notification_created_on_this_instance'|trans %} + {% set titleString = titleString ~ notification.post.user.username %} + title="{{ titleString }}" + {% endif %}>
{{ component('user_inline', {user: notification.post.user}) }} {{ 'added_new_post'|trans|lower }} - {{ notification.post.shortTitle }} {% endblock post_created_notification %} {% block post_edited_notification %} + >
{{ component('user_inline', {user: notification.post.user}) }} {{ 'edit_post'|trans|lower }} - {{ notification.post.shortTitle }} {% endblock post_edited_notification %} {% block post_deleted_notification %} + >
{{ 'post'|trans }} {{ notification.post.shortTitle }} - {% if notification.comment.isTrashed %}{{ 'removed'|trans|lower }}{% else %}{{ 'deleted'|trans|lower }}{% endif %} {% endblock post_deleted_notification %} {% block post_mentioned_notification %} + >
{{ component('user_inline', {user: notification.post.user}) }} {{ 'mentioned_you'|trans|lower }} - {{ notification.post.shortTitle }} {% endblock post_mentioned_notification %} {% block post_comment_created_notification %} + {% if not notification.comment.magazine.apId and (app.user.admin or notification.comment.magazine.userIsModerator(app.user)) %} + style="border-color:var(--kbin-upvoted-color);" + {% set titleString = 'notification_created_on_this_instance'|trans %} + {% set titleString = titleString ~ notification.comment.user.username %} + title="{{ titleString }}" + {% endif %}>
{{ component('user_inline', {user: notification.comment.user}) }} {{ 'added_new_comment'|trans|lower }} - {{ notification.comment.shortTitle }} {% endblock post_comment_created_notification %} {% block post_comment_edited_notification %} + >
{{ component('user_inline', {user: notification.comment.user}) }} {{ 'edited_comment'|trans|lower }} - {{ notification.comment.shortTitle }} {% endblock post_comment_edited_notification %} {% block post_comment_reply_notification %} + >
{{ component('user_inline', {user: notification.comment.user}) }} {{ 'replied_to_your_comment'|trans|lower }} - {{ notification.comment.shortTitle }} {% endblock post_comment_reply_notification %} {% block post_comment_deleted_notification %} + >
{{ 'comment'|trans }} {{ notification.comment.shortTitle }} - {% if notification.comment.isTrashed %}{{ 'removed'|trans|lower }}{% else %}{{ 'deleted'|trans|lower }}{% endif %} {% endblock post_comment_deleted_notification %} {% block post_comment_mentioned_notification %} + >
{{ component('user_inline', {user: notification.comment.user}) }} {{ 'mentioned_you'|trans|lower }} - {{ notification.comment.shortTitle }} {% endblock post_comment_mentioned_notification %} {% block message_notification %} - {{ component('user_inline', {user: notification.message.sender}) }} {{ 'wrote_message'|trans|lower }}
+ {{ component('user_inline', {user: notification.message.sender}) }} ✉ {{ 'wrote_message'|trans|lower }} {{ notification.message.title }} {% endblock message_notification %} {% block magazine_ban_notification %} + >
{{ component('user_inline', {user: notification.ban.bannedBy}) }} {{ 'banned'|trans|lower }}. {{ 'ban_expired'|trans }} {{ component('date', {date: notification.ban.expiredAt}) }}. {{ notification.ban.reason }} {% endblock magazine_ban_notification %} {% block reportlink %} + >
{% if notification.report.entry is defined and notification.report.entry is not same as null %} {% set entry = notification.report.entry %} @@ -125,6 +171,7 @@ {% endblock %} {% block report_created_notification %} + >
{{ component('user_inline', {user: notification.report.reporting}) }} {{ 'reported'|trans|lower }} {{ component('user_inline', {user: notification.report.reported}) }}
{{ 'report_subject'|trans }}: {{ block('reportlink') }}
{% if app.user.admin or app.user.moderator or notification.report.magazine.userIsModerator(app.user) %} @@ -133,6 +180,7 @@ {% endblock report_created_notification %} {% block report_rejected_notification %} + >
{{ 'own_report_rejected'|trans }}
{{ 'reported_user'|trans }}: {{ component('user_inline', {user: notification.report.reported}) }}
{{ 'report_subject'|trans }}: {{ block('reportlink') }}
@@ -142,6 +190,7 @@ {% endblock report_rejected_notification %} {% block report_approved_notification %} + >
{% if notification.report.reporting.id is same as app.user.id %} {{ 'own_report_accepted'|trans }}
{% elseif notification.report.reported.id is same as app.user.id %}