From: David ‘Bombe’ Roden Date: Sun, 23 Oct 2011 18:43:41 +0000 (+0200) Subject: Paginate bookmarks as per “posts per page” configuration option. X-Git-Tag: 0.7.3^2~19 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2a86391bc31e41d082446545fbdf781aded6aedb;p=Sone.git Paginate bookmarks as per “posts per page” configuration option. This fixes #247. --- diff --git a/src/main/java/net/pterodactylus/sone/web/BookmarksPage.java b/src/main/java/net/pterodactylus/sone/web/BookmarksPage.java index ad1717b..41a3e65 100644 --- a/src/main/java/net/pterodactylus/sone/web/BookmarksPage.java +++ b/src/main/java/net/pterodactylus/sone/web/BookmarksPage.java @@ -70,7 +70,7 @@ public class BookmarksPage extends SoneTemplatePage { }); List sortedPosts = new ArrayList(loadedPosts); Collections.sort(sortedPosts, Post.TIME_COMPARATOR); - Pagination pagination = new Pagination(sortedPosts, 25).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("page"), 0)); + Pagination pagination = new Pagination(sortedPosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("page"), 0)); templateContext.set("pagination", pagination); templateContext.set("posts", pagination.getItems()); templateContext.set("postsNotLoaded", allPosts.size() != loadedPosts.size());