Add contains filter to template contexts.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 10 May 2011 04:59:07 +0000 (06:59 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 10 May 2011 05:02:01 +0000 (07:02 +0200)
src/main/java/net/pterodactylus/sone/web/WebInterface.java

index 871a2eb..75caba2 100644 (file)
@@ -101,6 +101,7 @@ import net.pterodactylus.util.notify.Notification;
 import net.pterodactylus.util.notify.NotificationManager;
 import net.pterodactylus.util.notify.TemplateNotification;
 import net.pterodactylus.util.template.CollectionSortFilter;
+import net.pterodactylus.util.template.ContainsFilter;
 import net.pterodactylus.util.template.DateFilter;
 import net.pterodactylus.util.template.FormatFilter;
 import net.pterodactylus.util.template.HtmlFilter;
@@ -210,6 +211,7 @@ public class WebInterface implements CoreListener {
                templateContextFactory.addFilter("format", new FormatFilter());
                templateContextFactory.addFilter("sort", new CollectionSortFilter());
                templateContextFactory.addFilter("replyGroup", new ReplyGroupFilter());
+               templateContextFactory.addFilter("in", new ContainsFilter());
                templateContextFactory.addProvider(Provider.TEMPLATE_CONTEXT_PROVIDER);
                templateContextFactory.addProvider(new ClassPathTemplateProvider());
                templateContextFactory.addTemplateObject("formPassword", formPassword);