From 215eba5dca68e3c9586de3b593ea5f62271de36f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 24 Nov 2011 10:29:48 +0100 Subject: [PATCH] Include notification hash code in the template. --- src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java | 6 +++++- src/main/resources/templates/include/head.html | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java index 095db9e..3218b58 100644 --- a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java @@ -31,6 +31,8 @@ import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.sone.web.page.FreenetTemplatePage; import net.pterodactylus.util.collection.ListBuilder; import net.pterodactylus.util.collection.MapBuilder; +import net.pterodactylus.util.notify.Notification; +import net.pterodactylus.util.object.HashCode; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; import freenet.clients.http.SessionManager.Session; @@ -259,7 +261,9 @@ public class SoneTemplatePage extends FreenetTemplatePage { templateContext.set("latestEdition", webInterface.getCore().getUpdateChecker().getLatestEdition()); templateContext.set("latestVersion", webInterface.getCore().getUpdateChecker().getLatestVersion()); templateContext.set("latestVersionTime", webInterface.getCore().getUpdateChecker().getLatestVersionDate()); - templateContext.set("notifications", ListNotificationFilters.filterNotifications(webInterface.getNotifications().getNotifications(), currentSone)); + List notifications = ListNotificationFilters.filterNotifications(webInterface.getNotifications().getNotifications(), currentSone); + templateContext.set("notifications", notifications); + templateContext.set("notificationHash", HashCode.hashCode(notifications)); } /** diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html index cd9eddf..734697a 100644 --- a/src/main/resources/templates/include/head.html +++ b/src/main/resources/templates/include/head.html @@ -15,6 +15,8 @@
+ +