import net.pterodactylus.sone.utils.paginate
import net.pterodactylus.sone.utils.parameters
import net.pterodactylus.sone.web.WebInterface
import net.pterodactylus.sone.utils.paginate
import net.pterodactylus.sone.utils.parameters
import net.pterodactylus.sone.web.WebInterface
import net.pterodactylus.util.template.Template
import net.pterodactylus.util.template.TemplateContext
import net.pterodactylus.util.template.Template
import net.pterodactylus.util.template.TemplateContext
/**
* The index page shows the main page of Sone. This page will contain the posts
* of all friends of the current user.
*/
/**
* The index page shows the main page of Sone. This page will contain the posts
* of all friends of the current user.
*/
-class IndexPage(template: Template, webInterface: WebInterface, private val postVisibilityFilter: PostVisibilityFilter) :
+@MenuName("Index")
+class IndexPage @Inject constructor(template: Template, webInterface: WebInterface, private val postVisibilityFilter: PostVisibilityFilter) :
LoggedInPage("index.html", template, "Page.Index.Title", webInterface) {
LoggedInPage("index.html", template, "Page.Index.Title", webInterface) {
- override fun handleRequest(freenetRequest: FreenetRequest, currentSone: Sone, templateContext: TemplateContext) {
+ override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) {
- posts.paginate(webInterface.core.preferences.postsPerPage)
- .turnTo(freenetRequest.parameters["page"]?.toIntOrNull() ?: 0)
+ posts.paginate(soneRequest.core.preferences.postsPerPage)
+ .turnTo(soneRequest.parameters["page"]?.toIntOrNull() ?: 0)