From b3055802d6dbb021ca5ebfa5e9445bdf458ae381 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 15 Sep 2011 17:56:54 +0200 Subject: [PATCH] Add stylesheet. --- src/main/java/net/pterodactylus/wotns/ui/web/BasicPage.java | 12 ++++++++++++ .../java/net/pterodactylus/wotns/ui/web/WebInterface.java | 3 +++ src/main/resources/static/css/main.css | 4 ++++ 3 files changed, 19 insertions(+) create mode 100644 src/main/resources/static/css/main.css 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 25efbe3..082081c 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/BasicPage.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/BasicPage.java @@ -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 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()); } + } diff --git a/src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java b/src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java index efcdced..cb9b40e 100644 --- a/src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/wotns/ui/web/WebInterface.java @@ -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("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 index 0000000..6ab29f4 --- /dev/null +++ b/src/main/resources/static/css/main.css @@ -0,0 +1,4 @@ +#wotns h1 { + font-size: 175%; + font-weight: bold; +} -- 2.7.4