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=189b3eb3cd1d1c0aa099a62ada478a125d2041d2;hb=HEAD;hpb=2e6be6f2fb6afede009dacc48b8e3318e30e5057 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 189b3eb..efaee3f 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/ViewSonePage.kt @@ -14,8 +14,9 @@ import javax.inject.* * Lets the user browser another Sone. */ @TemplatePath("/templates/viewSone.html") +@ToadletPath("viewSone.html") class ViewSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : - SoneTemplatePage("viewSone.html", webInterface, loaders, templateRenderer) { + SoneTemplatePage(webInterface, loaders, templateRenderer) { override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) { templateContext["soneId"] = soneRequest.parameters["sone"] @@ -50,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") }