X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FSoneTemplatePage.java;h=9df00b770eba537410e9d611d813969c6912ea76;hb=3b841249495a097ab83f552c6d26b70e4b81d04e;hp=8c74865bb386d036658f1dd5bb899784ce81ca3b;hpb=3ccb94d05fd21ab7f388bab9081d97f2157c13c8;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java index 8c74865..9df00b7 100644 --- a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java @@ -1,5 +1,5 @@ /* - * Sone - SoneTemplatePage.java - Copyright © 2010–2012 David Roden + * Sone - SoneTemplatePage.java - Copyright © 2010–2013 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,17 +31,16 @@ import net.pterodactylus.sone.notify.ListNotificationFilters; import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.sone.web.page.FreenetTemplatePage; 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 com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; - import freenet.clients.http.SessionManager.Session; import freenet.clients.http.ToadletContext; import freenet.support.api.HTTPRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; + /** * Base page for the Sone web interface. * @@ -203,9 +202,6 @@ public class SoneTemplatePage extends FreenetTemplatePage { // TEMPLATEPAGE METHODS // - /** - * {@inheritDoc} - */ @Override protected String getPageTitle(FreenetRequest request) { if (pageTitleKey != null) { @@ -214,25 +210,16 @@ public class SoneTemplatePage extends FreenetTemplatePage { return ""; } - /** - * {@inheritDoc} - */ @Override protected List> getAdditionalLinkNodes(FreenetRequest request) { return ImmutableList.> builder().add(ImmutableMap. builder().put("rel", "search").put("type", "application/opensearchdescription+xml").put("title", "Sone").put("href", "http://" + request.getHttpRequest().getHeader("host") + "/Sone/OpenSearch.xml").build()).build(); } - /** - * {@inheritDoc} - */ @Override protected Collection getStyleSheets() { return Arrays.asList("css/sone.css"); } - /** - * {@inheritDoc} - */ @Override protected String getShortcutIcon() { return "images/icon.png"; @@ -248,9 +235,6 @@ public class SoneTemplatePage extends FreenetTemplatePage { return requireLogin; } - /** - * {@inheritDoc} - */ @Override protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException { super.processTemplate(request, templateContext); @@ -267,12 +251,9 @@ public class SoneTemplatePage extends FreenetTemplatePage { List notifications = ListNotificationFilters.filterNotifications(webInterface.getNotifications().getNotifications(), currentSone); Collections.sort(notifications, Notification.CREATED_TIME_SORTER); templateContext.set("notifications", notifications); - templateContext.set("notificationHash", HashCode.hashCode(notifications)); + templateContext.set("notificationHash", notifications.hashCode()); } - /** - * {@inheritDoc} - */ @Override protected String getRedirectTarget(FreenetRequest request) { if (requiresLogin() && (getCurrentSone(request.getToadletContext(), false) == null)) { @@ -300,17 +281,11 @@ public class SoneTemplatePage extends FreenetTemplatePage { return null; } - /** - * {@inheritDoc} - */ @Override protected boolean isFullAccessOnly() { return webInterface.getCore().getPreferences().isRequireFullAccess(); } - /** - * {@inheritDoc} - */ @Override public boolean isEnabled(ToadletContext toadletContext) { if (webInterface.getCore().getPreferences().isRequireFullAccess() && !toadletContext.isAllowedFullAccess()) {