X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FKnownSonesPage.kt;h=439a163b587410f1eb4fb7afb74c5dd49f5f1804;hp=65f48536565fd1b91c511215aded3f47a8d89f73;hb=afa3d007f883a710a94f74d21c179a006974bc7e;hpb=6a3f1fede0cda5cd6ed56204aa1dd37a19813cb9 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt index 65f4853..439a163 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt @@ -1,21 +1,21 @@ package net.pterodactylus.sone.web.pages -import net.pterodactylus.sone.data.Sone +import net.pterodactylus.sone.data.* import net.pterodactylus.sone.main.* -import net.pterodactylus.sone.utils.paginate -import net.pterodactylus.sone.utils.parameters -import net.pterodactylus.sone.web.WebInterface +import net.pterodactylus.sone.utils.* +import net.pterodactylus.sone.web.* import net.pterodactylus.sone.web.page.* -import net.pterodactylus.util.template.Template -import net.pterodactylus.util.template.TemplateContext -import javax.inject.Inject +import net.pterodactylus.util.template.* +import javax.inject.* /** * This page shows all known Sones. */ @MenuName("KnownSones") -class KnownSonesPage @Inject constructor(template: Template, webInterface: WebInterface, loaders: Loaders): - SoneTemplatePage("knownSones.html", webInterface, loaders, template = template, pageTitleKey = "Page.KnownSones.Title") { +@TemplatePath("/templates/knownSones.html") +@ToadletPath("knownSones.html") +class KnownSonesPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : + SoneTemplatePage(webInterface, loaders, templateRenderer, pageTitleKey = "Page.KnownSones.Title") { override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) { getCurrentSone(soneRequest.toadletContext).let { currentSone -> @@ -29,9 +29,9 @@ class KnownSonesPage @Inject constructor(template: Template, webInterface: WebIn .sortedWith( when (soneRequest.parameters["sort"]) { "images" -> Sone.IMAGE_COUNT_COMPARATOR - "name" -> Sone.NICE_NAME_COMPARATOR.reversed() + "name" -> niceNameComparator.reversed() "posts" -> Sone.POST_COUNT_COMPARATOR - else -> Sone.LAST_ACTIVITY_COMPARATOR + else -> lastActivityComparator }.let { comparator -> when (soneRequest.parameters["order"]) { "asc" -> comparator.reversed()