X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FViewSonePage.kt;h=efaee3fb3099510966412c6aec9bc105e4a0a374;hp=e2de3e4edbb8fb1bbe7ce8351af957e9a982c268;hb=HEAD;hpb=110a933c2724aba6a604fc5eed6372ff1e1e6144 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt index e2de3e4..efaee3f 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt @@ -1,24 +1,22 @@ package net.pterodactylus.sone.web.pages -import net.pterodactylus.sone.data.Post -import net.pterodactylus.sone.data.PostReply +import net.pterodactylus.sone.data.* import net.pterodactylus.sone.main.* -import net.pterodactylus.sone.template.SoneAccessor -import net.pterodactylus.sone.utils.mapPresent -import net.pterodactylus.sone.utils.paginate -import net.pterodactylus.sone.utils.parameters -import net.pterodactylus.sone.web.WebInterface +import net.pterodactylus.sone.template.* +import net.pterodactylus.sone.utils.* +import net.pterodactylus.sone.web.* import net.pterodactylus.sone.web.page.* -import net.pterodactylus.util.template.TemplateContext -import java.net.URI -import javax.inject.Inject +import net.pterodactylus.util.template.* +import java.net.* +import javax.inject.* /** * Lets the user browser another Sone. */ @TemplatePath("/templates/viewSone.html") -class ViewSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer): - SoneTemplatePage("viewSone.html", webInterface, loaders, templateRenderer) { +@ToadletPath("viewSone.html") +class ViewSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : + SoneTemplatePage(webInterface, loaders, templateRenderer) { override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) { templateContext["soneId"] = soneRequest.parameters["sone"] @@ -53,7 +51,7 @@ class ViewSonePage @Inject constructor(webInterface: WebInterface, loaders: Load override fun getPageTitle(soneRequest: SoneRequest): String = soneRequest.parameters["sone"]!!.let(soneRequest.core::getSone)?.let { sone -> - "${SoneAccessor.getNiceName(sone)} - ${soneRequest.l10n.getString("Page.ViewSone.Title")}" - } ?: soneRequest.l10n.getString("Page.ViewSone.Page.TitleWithoutSone") + "${SoneAccessor.getNiceName(sone)} - ${translation.translate("Page.ViewSone.Title")}" + } ?: translation.translate("Page.ViewSone.Page.TitleWithoutSone") }