From: David ‘Bombe’ Roden Date: Thu, 15 Sep 2011 16:07:19 +0000 (+0200) Subject: Add title to pages. X-Git-Tag: 0.0.1~1 X-Git-Url: https://git.pterodactylus.net/?p=WoTNS.git;a=commitdiff_plain;h=e9ef6a599832031c17a61bdefa059e682fc96dd1 Add title to pages. --- diff --git a/src/main/java/net/pterodactylus/wotns/ui/web/AddTargetPage.java b/src/main/java/net/pterodactylus/wotns/ui/web/AddTargetPage.java index fb44cb5..64b134c 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/AddTargetPage.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/AddTargetPage.java @@ -41,7 +41,7 @@ public class AddTargetPage extends BasicPage { * @param template */ public AddTargetPage(Template template, WebInterface webInterface) { - super(webInterface, "addTarget.html", template); + super(webInterface, "addTarget.html", null, template); } /** diff --git a/src/main/java/net/pterodactylus/wotns/ui/web/BasicPage.java b/src/main/java/net/pterodactylus/wotns/ui/web/BasicPage.java index 082081c..ba2537e 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/BasicPage.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/BasicPage.java @@ -39,10 +39,13 @@ public class BasicPage extends FreenetTemplatePage { protected final IdentityManager identityManager; - public BasicPage(WebInterface webInterface, String path, Template template) { + private final String title; + + public BasicPage(WebInterface webInterface, String path, String title, Template template) { super(path, webInterface.getTemplateContextFactory(), template, "noPermission.html"); this.webInterface = webInterface; this.identityManager = webInterface.getWoTNSPlugin().getIdentityManager(); + this.title = title; } // @@ -68,6 +71,14 @@ public class BasicPage extends FreenetTemplatePage { * {@inheritDoc} */ @Override + protected String getPageTitle(FreenetRequest request) { + return title; + } + + /** + * {@inheritDoc} + */ + @Override protected Collection getStyleSheets() { return Arrays.asList("css/main.css"); } diff --git a/src/main/java/net/pterodactylus/wotns/ui/web/EditTargetPage.java b/src/main/java/net/pterodactylus/wotns/ui/web/EditTargetPage.java index 3ee6715..b8f009d 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/EditTargetPage.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/EditTargetPage.java @@ -40,7 +40,7 @@ public class EditTargetPage extends BasicPage { * @param template */ public EditTargetPage(Template template, WebInterface webInterface) { - super(webInterface, "editTarget.html", template); + super(webInterface, "editTarget.html", null, template); } /** diff --git a/src/main/java/net/pterodactylus/wotns/ui/web/EnableIdentityPage.java b/src/main/java/net/pterodactylus/wotns/ui/web/EnableIdentityPage.java index 8518de7..f8d4a9d 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/EnableIdentityPage.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/EnableIdentityPage.java @@ -37,7 +37,7 @@ public class EnableIdentityPage extends BasicPage { * @param template */ public EnableIdentityPage(Template template, WebInterface webInterface) { - super(webInterface, "enableIdentity.html", template); + super(webInterface, "enableIdentity.html", null, template); } /** diff --git a/src/main/java/net/pterodactylus/wotns/ui/web/IndexPage.java b/src/main/java/net/pterodactylus/wotns/ui/web/IndexPage.java index 172cfa8..be94346 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/IndexPage.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/IndexPage.java @@ -40,7 +40,7 @@ public class IndexPage extends BasicPage { * @param template */ public IndexPage(Template template, WebInterface webInterface) { - super(webInterface, "index.html", template); + super(webInterface, "index.html", "Web of Trust Name Service", template); } // diff --git a/src/main/java/net/pterodactylus/wotns/ui/web/ManagePage.java b/src/main/java/net/pterodactylus/wotns/ui/web/ManagePage.java index 1681fbd..6a4200e 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/ManagePage.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/ManagePage.java @@ -36,7 +36,7 @@ public class ManagePage extends BasicPage { * @param template */ public ManagePage(Template template, WebInterface webInterface) { - super(webInterface, "manage.html", template); + super(webInterface, "manage.html", "Manage - Web of Trust Name Service", template); } /** diff --git a/src/main/java/net/pterodactylus/wotns/ui/web/ResolverPage.java b/src/main/java/net/pterodactylus/wotns/ui/web/ResolverPage.java index 1a4f687..6db3b6a 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/ResolverPage.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/ResolverPage.java @@ -35,7 +35,7 @@ public class ResolverPage extends BasicPage { private final Resolver resolver; public ResolverPage(Template unknownNameTemplate, WebInterface webInterface, Resolver resolver) { - super(webInterface, "", unknownNameTemplate); + super(webInterface, "", "Error - Web of Trust Name Service", unknownNameTemplate); this.resolver = resolver; }