X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetReplyAjaxPage.kt;h=43960abcb834dbd04079147b3153b7e6259aebf9;hb=55b16eeec3c6ad9af4a77e1ee0efc4593f1875d3;hp=119a622db2ef580c308d34a9b75b01594fe72701;hpb=548e98afbe5696f0a05a6ac4aff8029cba1f7875;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.kt index 119a622..43960ab 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/GetReplyAjaxPage.kt @@ -6,15 +6,16 @@ import net.pterodactylus.sone.utils.jsonObject import net.pterodactylus.sone.utils.parameters import net.pterodactylus.sone.utils.render import net.pterodactylus.sone.web.WebInterface -import net.pterodactylus.sone.web.page.FreenetRequest +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.template.Template +import net.pterodactylus.util.template.TemplateContextFactory import javax.inject.Inject /** * This AJAX page returns the details of a reply. */ -class GetReplyAjaxPage @Inject constructor(webInterface: WebInterface, private val template: Template) : - LoggedInJsonPage("getReply.ajax", webInterface) { +@ToadletPath("getReply.ajax") +class GetReplyAjaxPage @Inject constructor(webInterface: WebInterface, val templateContextFactory: TemplateContextFactory, private val template: Template) : LoggedInJsonPage(webInterface) { override val needsFormPassword = false @@ -37,7 +38,7 @@ class GetReplyAjaxPage @Inject constructor(webInterface: WebInterface, private v ).toList().toTypedArray()) private fun PostReply.render(currentSone: Sone, request: FreenetRequest) = - webInterface.templateContextFactory.createTemplateContext().apply { + templateContextFactory.createTemplateContext().apply { set("core", core) set("request", request) set("reply", this@render)