Add title to pages.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 15 Sep 2011 16:07:19 +0000 (18:07 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 15 Sep 2011 16:07:19 +0000 (18:07 +0200)
src/main/java/net/pterodactylus/wotns/ui/web/AddTargetPage.java
src/main/java/net/pterodactylus/wotns/ui/web/BasicPage.java
src/main/java/net/pterodactylus/wotns/ui/web/EditTargetPage.java
src/main/java/net/pterodactylus/wotns/ui/web/EnableIdentityPage.java
src/main/java/net/pterodactylus/wotns/ui/web/IndexPage.java
src/main/java/net/pterodactylus/wotns/ui/web/ManagePage.java
src/main/java/net/pterodactylus/wotns/ui/web/ResolverPage.java

index fb44cb5..64b134c 100644 (file)
@@ -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);
        }
 
        /**
index 082081c..ba2537e 100644 (file)
@@ -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<String> getStyleSheets() {
                return Arrays.asList("css/main.css");
        }
index 3ee6715..b8f009d 100644 (file)
@@ -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);
        }
 
        /**
index 8518de7..f8d4a9d 100644 (file)
@@ -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);
        }
 
        /**
index 172cfa8..be94346 100644 (file)
@@ -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);
        }
 
        //
index 1681fbd..6a4200e 100644 (file)
@@ -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);
        }
 
        /**
index 1a4f687..6db3b6a 100644 (file)
@@ -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;
        }