Paginate bookmarks as per “posts per page” configuration option.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 23 Oct 2011 18:43:41 +0000 (20:43 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 23 Oct 2011 18:44:14 +0000 (20:44 +0200)
This fixes #247.

src/main/java/net/pterodactylus/sone/web/BookmarksPage.java

index ad1717b..41a3e65 100644 (file)
@@ -70,7 +70,7 @@ public class BookmarksPage extends SoneTemplatePage {
                });
                List<Post> sortedPosts = new ArrayList<Post>(loadedPosts);
                Collections.sort(sortedPosts, Post.TIME_COMPARATOR);
-               Pagination<Post> pagination = new Pagination<Post>(sortedPosts, 25).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("page"), 0));
+               Pagination<Post> pagination = new Pagination<Post>(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());