1 package net.pterodactylus.sone.web.pages
3 import net.pterodactylus.sone.data.*
4 import net.pterodactylus.sone.main.*
5 import net.pterodactylus.sone.utils.*
6 import net.pterodactylus.sone.web.*
7 import net.pterodactylus.sone.web.page.*
8 import net.pterodactylus.util.template.*
12 * Lets the user delete a Sone. Of course the Sone is not really deleted from
13 * Freenet; merely all references to it are removed from the local plugin
16 @MenuName("DeleteSone")
17 @TemplatePath("/templates/deleteSone.html")
18 @ToadletPath("deleteSone.html")
19 class DeleteSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
20 LoggedInPage("Page.DeleteSone.Title", webInterface, loaders, templateRenderer) {
22 override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) {
23 if (soneRequest.isPOST) {
24 if (soneRequest.httpRequest.isPartSet("deleteSone")) {
25 soneRequest.core.deleteSone(currentSone)
27 redirectTo("index.html")