Use post accessor.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 15 Oct 2010 19:50:31 +0000 (21:50 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 15 Oct 2010 19:50:31 +0000 (21:50 +0200)
src/main/java/net/pterodactylus/sone/web/WebInterface.java

index ad7e510..994d501 100644 (file)
@@ -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()));