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;
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<Notification> notifications = ListNotificationFilters.filterNotifications(webInterface.getNotifications().getNotifications(), currentSone);
+ templateContext.set("notifications", notifications);
+ templateContext.set("notificationHash", HashCode.hashCode(notifications));
}
/**
<div id="notification-area">
+ <div id="notification-hash" class="hidden"><%= notificationHash|html></div>
+
<form id="notification-dismiss-template" class="hidden dismiss" action="dismissNotification.html" method="post">
<input type="hidden" name="formPassword" value="<% formPassword|html>" />
<input type="hidden" name="returnPage" value="<% request.uri|html>" />