Add stylesheet.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 15 Sep 2011 15:56:54 +0000 (17:56 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 15 Sep 2011 15:56:54 +0000 (17:56 +0200)
src/main/java/net/pterodactylus/wotns/ui/web/BasicPage.java
src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java
src/main/resources/static/css/main.css [new file with mode: 0644]

index 25efbe3..082081c 100644 (file)
@@ -17,6 +17,9 @@
 
 package net.pterodactylus.wotns.ui.web;
 
+import java.util.Arrays;
+import java.util.Collection;
+
 import net.pterodactylus.util.template.Template;
 import net.pterodactylus.util.template.TemplateContext;
 import net.pterodactylus.util.web.Method;
@@ -65,9 +68,18 @@ public class BasicPage extends FreenetTemplatePage {
         * {@inheritDoc}
         */
        @Override
+       protected Collection<String> getStyleSheets() {
+               return Arrays.asList("css/main.css");
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
        protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
                super.processTemplate(request, templateContext);
                templateContext.set("ownIdentities", identityManager.getAllOwnIdentities());
                templateContext.set("formPassword", webInterface.getWoTNSPlugin().getToadletContainer().getFormPassword());
        }
+
 }
index efcdced..cb9b40e 100644 (file)
@@ -30,10 +30,12 @@ import net.pterodactylus.util.template.ReflectionAccessor;
 import net.pterodactylus.util.template.Template;
 import net.pterodactylus.util.template.TemplateContextFactory;
 import net.pterodactylus.util.template.TemplateParser;
+import net.pterodactylus.util.web.StaticPage;
 import net.pterodactylus.wotns.freenet.wot.Identity;
 import net.pterodactylus.wotns.main.IdentityComparator;
 import net.pterodactylus.wotns.main.WoTNSPlugin;
 import net.pterodactylus.wotns.template.IdentityAccessor;
+import net.pterodactylus.wotns.web.FreenetRequest;
 import net.pterodactylus.wotns.web.PageToadlet;
 import net.pterodactylus.wotns.web.PageToadletFactory;
 import freenet.clients.http.ToadletContainer;
@@ -104,6 +106,7 @@ public class WebInterface {
                pageToadlets.add(pageToadletFactory.createPageToadlet(new EnableIdentityPage(new Template(), this)));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new AddTargetPage(addTargetTemplate, this)));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new EditTargetPage(new Template(), this)));
+               pageToadlets.add(pageToadletFactory.createPageToadlet(new StaticPage<FreenetRequest>("css/", "/static/css/", "text/css")));
 
                ToadletContainer toadletContainer = wotNSPlugin.getToadletContainer();
                toadletContainer.getPageMaker().addNavigationCategory("/tns/index.html", "Navigation.Menu.Name", "Navigation.Menu.Tooltip", wotNSPlugin);
diff --git a/src/main/resources/static/css/main.css b/src/main/resources/static/css/main.css
new file mode 100644 (file)
index 0000000..6ab29f4
--- /dev/null
@@ -0,0 +1,4 @@
+#wotns h1 {
+       font-size: 175%;
+       font-weight: bold;
+}