X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FIndexPage.kt;h=35f0f75e7690a9a143f73e46b4a52141cf446205;hb=5ba707d40f9d2a20094aaabc21647aeec1feed46;hp=7753b4054c72af08e889f900bf91a3f414cb540a;hpb=cc13ef909d3b9e265918e396466c320ce63235ae;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt index 7753b40..35f0f75 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/IndexPage.kt @@ -1,10 +1,10 @@ package net.pterodactylus.sone.web.pages import net.pterodactylus.sone.notify.PostVisibilityFilter +import net.pterodactylus.sone.utils.Pagination import net.pterodactylus.sone.utils.parameters 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 @@ -28,8 +28,9 @@ class IndexPage(template: Template, webInterface: WebInterface, private val post .filter { postVisibilityFilter.isVisible(currentSone).apply(it) } .sortedByDescending { it.time } .let { posts -> - Pagination(posts, webInterface.core.preferences.postsPerPage) - .setPage(request.parameters["page"]?.toIntOrNull() ?: 0).let { pagination -> + Pagination(posts, webInterface.core.preferences.postsPerPage).apply { + page = request.parameters["page"]?.toIntOrNull() ?: 0 + }.let { pagination -> templateContext["pagination"] = pagination templateContext["posts"] = pagination.items }