From: David ‘Bombe’ Roden Date: Tue, 1 Feb 2011 10:04:04 +0000 (+0100) Subject: Add collection sort filter to template context factory. X-Git-Tag: 0.4.4^2~11 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=4de795c080aa19f1e9d83f33989d3052583693c1;ds=sidebyside Add collection sort filter to template context factory. --- diff --git a/pom.xml b/pom.xml index 3546ccc..795c972 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ net.pterodactylus utils - 0.8 + 0.8.1-SNAPSHOT junit diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index cc5fd5b..f8394cb 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -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);