X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FIndexPage.java;h=1d40f4519abc8410708d102e55831827e7927594;hp=e5d5b7d4c9144163dd06ad42dff52fc873b41ad3;hb=9acbc5bdec4ccb752e0856a501568b0bb6161579;hpb=c4ae226ec5052116cefc542ae2017036a7bc6332 diff --git a/src/main/java/net/pterodactylus/sone/web/IndexPage.java b/src/main/java/net/pterodactylus/sone/web/IndexPage.java index e5d5b7d..1d40f45 100644 --- a/src/main/java/net/pterodactylus/sone/web/IndexPage.java +++ b/src/main/java/net/pterodactylus/sone/web/IndexPage.java @@ -58,8 +58,7 @@ public class IndexPage extends SoneTemplatePage { * {@inheritDoc} */ @Override - protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException { - super.processTemplate(request, templateContext); + protected void handleRequest(FreenetRequest request, TemplateContext templateContext) throws RedirectException { final Sone currentSone = getCurrentSone(request.getToadletContext()); Collection allPosts = new ArrayList(); allPosts.addAll(currentSone.getPosts()); @@ -79,7 +78,7 @@ public class IndexPage extends SoneTemplatePage { } allPosts = Collections2.filter(allPosts, postVisibilityFilter.isVisible(currentSone)); List sortedPosts = new ArrayList(allPosts); - Collections.sort(sortedPosts, Post.TIME_COMPARATOR); + Collections.sort(sortedPosts, Post.NEWEST_FIRST); Pagination pagination = new Pagination(sortedPosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(parseInt(request.getHttpRequest().getParam("page"), 0)); templateContext.set("pagination", pagination); templateContext.set("posts", pagination.getItems());