From: David ‘Bombe’ Roden Date: Thu, 7 Apr 2011 19:06:37 +0000 (+0200) Subject: Display new-reply notification differently. X-Git-Tag: 0.6.1^2~18 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=93ca763a5e1b0f6a2ea94d4f2f0c536a0b1cdd5f;p=Sone.git Display new-reply notification differently. This fixes #35. --- diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 7c33803..7523d5f 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -53,6 +53,7 @@ import net.pterodactylus.sone.template.NotificationManagerAccessor; import net.pterodactylus.sone.template.ParserFilter; import net.pterodactylus.sone.template.PostAccessor; import net.pterodactylus.sone.template.ReplyAccessor; +import net.pterodactylus.sone.template.ReplyGroupFilter; import net.pterodactylus.sone.template.RequestChangeFilter; import net.pterodactylus.sone.template.SoneAccessor; import net.pterodactylus.sone.template.SubstringFilter; @@ -208,6 +209,7 @@ public class WebInterface implements CoreListener { templateContextFactory.addFilter("unknown", new UnknownDateFilter(getL10n(), "View.Sone.Text.UnknownDate")); templateContextFactory.addFilter("format", new FormatFilter()); templateContextFactory.addFilter("sort", new CollectionSortFilter()); + templateContextFactory.addFilter("replyGroup", new ReplyGroupFilter()); templateContextFactory.addProvider(Provider.TEMPLATE_CONTEXT_PROVIDER); templateContextFactory.addProvider(new ClassPathTemplateProvider()); templateContextFactory.addTemplateObject("formPassword", formPassword); diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index b8a8570..4e18d5d 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -287,7 +287,7 @@ Notification.NewPost.ShortText=New posts have been discovered. Notification.NewPost.Text=New posts have been discovered by the following Sones: Notification.NewPost.Button.MarkRead=Mark as read Notification.NewReply.ShortText=New replies have been discovered. -Notification.NewReply.Text=New replies have been discovered by the following Sones: +Notification.NewReply.Text=New replies have been discovered for posts by the following Sones: Notification.SoneIsBeingRescued.Text=The following Sones are currently being rescued: Notification.SoneRescued.Text=The following Sones have been rescued: Notification.SoneRescued.Text.RememberToUnlock=Please remember to control the posts and replies you have given and don’t forget to unlock your Sones! diff --git a/src/main/resources/templates/notify/newReplyNotification.html b/src/main/resources/templates/notify/newReplyNotification.html index 1253da5..ee8c410 100644 --- a/src/main/resources/templates/notify/newReplyNotification.html +++ b/src/main/resources/templates/notify/newReplyNotification.html @@ -10,9 +10,9 @@ + <%foreach replies reply><%/foreach> <%= Notification.NewReply.Text|l10n|html> - <%foreach replies reply> - - <% reply.sone.niceName|html><%notlast>,<%/notlast><%last>.<%/last> + <%foreach replies postGroup|replyGroup> + <% postGroup.key.sone.niceName|html> (<%foreach postGroup.value.sones sone><%sone.niceName|html><%notlast>, <%/notlast><%/foreach>)<%notlast>, <%/notlast><%last>.<%/last> <%/foreach>