From: David ‘Bombe’ Roden Date: Thu, 24 Nov 2011 09:29:48 +0000 (+0100) Subject: Include notification hash code in the template. X-Git-Tag: 0.7.5^2~4^2~11 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=215eba5dca68e3c9586de3b593ea5f62271de36f;p=Sone.git Include notification hash code in the template. --- 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 @@
+ +