From: David ‘Bombe’ Roden Date: Fri, 15 Oct 2010 19:50:31 +0000 (+0200) Subject: Use post accessor. X-Git-Tag: 0.1-RC1~315 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8b32d7e04676888e15f04046f148f02807cfa021;p=Sone.git Use post accessor. --- diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index ad7e510..994d501 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -29,9 +29,11 @@ import java.util.logging.Level; import java.util.logging.Logger; import net.pterodactylus.sone.core.Core; +import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.freenet.L10nFilter; import net.pterodactylus.sone.main.SonePlugin; +import net.pterodactylus.sone.template.PostAccessor; import net.pterodactylus.sone.template.SoneAccessor; import net.pterodactylus.sone.web.page.PageToadlet; import net.pterodactylus.sone.web.page.PageToadletFactory; @@ -143,6 +145,7 @@ public class WebInterface extends AbstractService { DefaultTemplateFactory templateFactory = new DefaultTemplateFactory(); templateFactory.addAccessor(Object.class, new ReflectionAccessor()); templateFactory.addAccessor(Sone.class, new SoneAccessor()); + templateFactory.addAccessor(Post.class, new PostAccessor(core())); templateFactory.addFilter("date", new DateFilter()); templateFactory.addFilter("l10n", new L10nFilter(l10n()));