Add collection sort filter to template context factory.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 1 Feb 2011 10:04:04 +0000 (11:04 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 2 Feb 2011 13:09:39 +0000 (14:09 +0100)
pom.xml
src/main/java/net/pterodactylus/sone/web/WebInterface.java

diff --git a/pom.xml b/pom.xml
index 3546ccc..795c972 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
                <dependency>
                        <groupId>net.pterodactylus</groupId>
                        <artifactId>utils</artifactId>
-                       <version>0.8</version>
+                       <version>0.8.1-SNAPSHOT</version>
                </dependency>
                <dependency>
                        <groupId>junit</groupId>
index cc5fd5b..f8394cb 100644 (file)
@@ -94,6 +94,7 @@ import net.pterodactylus.util.logging.Logging;
 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.DateFilter;
 import net.pterodactylus.util.template.FormatFilter;
 import net.pterodactylus.util.template.HtmlFilter;
@@ -201,6 +202,7 @@ public class WebInterface implements CoreListener {
                templateContextFactory.addFilter("parse", new ParserFilter(getCore(), templateContextFactory));
                templateContextFactory.addFilter("unknown", new UnknownDateFilter(getL10n(), "View.Sone.Text.UnknownDate"));
                templateContextFactory.addFilter("format", new FormatFilter());
+               templateContextFactory.addFilter("sort", new CollectionSortFilter());
                templateContextFactory.addPlugin("getpage", new GetPagePlugin());
                templateContextFactory.addPlugin("paginate", new PaginationPlugin());
                templateContextFactory.addProvider(Provider.TEMPLATE_CONTEXT_PROVIDER);