X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FLikePage.kt;h=c8369e93fc445cc508f0583fb0211a27973c44b1;hp=02f5043af5a011b75227a463e52a04785ec60c36;hb=aaf780d3c2a6f5ce47295786f3963c8b93f6a145;hpb=cd72add62ab407336b471d4b7cda8e33dd2df5c6 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/LikePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/LikePage.kt index 02f5043..c8369e9 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/LikePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/LikePage.kt @@ -1,19 +1,19 @@ package net.pterodactylus.sone.web.pages -import net.pterodactylus.sone.data.Sone -import net.pterodactylus.sone.utils.isPOST -import net.pterodactylus.sone.utils.parameters -import net.pterodactylus.sone.web.WebInterface +import net.pterodactylus.sone.data.* +import net.pterodactylus.sone.main.* +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.* /** * Page that lets the user like [net.pterodactylus.sone.data.Post]s and [net.pterodactylus.sone.data.Reply]s. */ -class LikePage @Inject constructor(template: Template, webInterface: WebInterface) : - LoggedInPage("like.html", template, "Page.Like.Title", webInterface) { +@ToadletPath("like.html") +class LikePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : + LoggedInPage("Page.Like.Title", webInterface, loaders, templateRenderer) { override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { if (soneRequest.isPOST) { @@ -23,7 +23,7 @@ class LikePage @Inject constructor(template: Template, webInterface: WebInterfac "reply" -> currentSone.addLikedReplyId(soneRequest.parameters["reply", 36]!!) } } - throw RedirectException(soneRequest.parameters["returnPage", 256]!!) + redirectTo(soneRequest.parameters["returnPage", 256]!!) } }