X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FViewSonePage.java;h=f540ba2e52f4f61733d9c02977268e39b0626373;hb=1bd4979e2d3da9d4e9f400f054e6e1d91890669b;hp=257d2b22036531b24f02cae66495557f59ecc845;hpb=de7568a82eb4150bf6d2b0553841b7b69f84c968;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/pages/ViewSonePage.java b/src/main/java/net/pterodactylus/sone/web/pages/ViewSonePage.java index 257d2b2..f540ba2 100644 --- a/src/main/java/net/pterodactylus/sone/web/pages/ViewSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/pages/ViewSonePage.java @@ -32,9 +32,9 @@ import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.template.SoneAccessor; +import net.pterodactylus.sone.utils.Pagination; import net.pterodactylus.sone.web.WebInterface; import net.pterodactylus.sone.web.page.FreenetRequest; -import net.pterodactylus.util.collection.Pagination; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; @@ -92,7 +92,8 @@ public class ViewSonePage extends SoneTemplatePage { List sonePosts = sone.get().getPosts(); sonePosts.addAll(webInterface.getCore().getDirectedPosts(sone.get().getId())); Collections.sort(sonePosts, Post.NEWEST_FIRST); - Pagination postPagination = new Pagination(sonePosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(parseInt(request.getHttpRequest().getParam("postPage"), 0)); + Pagination postPagination = new Pagination(sonePosts, webInterface.getCore().getPreferences().getPostsPerPage()); + postPagination.setPage(parseInt(request.getHttpRequest().getParam("postPage"), 0)); templateContext.set("postPagination", postPagination); templateContext.set("posts", postPagination.getItems()); Set replies = sone.get().getReplies(); @@ -114,7 +115,8 @@ public class ViewSonePage extends SoneTemplatePage { }); - Pagination repliedPostPagination = new Pagination(posts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(parseInt(request.getHttpRequest().getParam("repliedPostPage"), 0)); + Pagination repliedPostPagination = new Pagination(posts, webInterface.getCore().getPreferences().getPostsPerPage()); + repliedPostPagination.setPage(parseInt(request.getHttpRequest().getParam("repliedPostPage"), 0)); templateContext.set("repliedPostPagination", repliedPostPagination); templateContext.set("repliedPosts", repliedPostPagination.getItems()); }