/*
- * Sone - BookmarksPage.java - Copyright © 2011–2015 David Roden
+ * Sone - BookmarksPage.java - Copyright © 2011–2016 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* {@inheritDoc}
*/
@Override
- protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
- super.processTemplate(request, templateContext);
+ protected void handleRequest(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
Set<Post> allPosts = webInterface.getCore().getBookmarkedPosts();
Collection<Post> loadedPosts = Collections2.filter(allPosts, new Predicate<Post>() {
}
});
List<Post> sortedPosts = new ArrayList<Post>(loadedPosts);
- Collections.sort(sortedPosts, Post.TIME_COMPARATOR);
+ Collections.sort(sortedPosts, Post.NEWEST_FIRST);
Pagination<Post> pagination = new Pagination<Post>(sortedPosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(parseInt(request.getHttpRequest().getParam("page"), 0));
templateContext.set("pagination", pagination);
templateContext.set("posts", pagination.getItems());