package net.pterodactylus.sone.web.pages 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.* import javax.inject.* /** * Lets the user delete a Sone. Of course the Sone is not really deleted from * Freenet; merely all references to it are removed from the local plugin * installation. */ @MenuName("DeleteSone") @TemplatePath("/templates/deleteSone.html") @ToadletPath("deleteSone.html") class DeleteSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : LoggedInPage("Page.DeleteSone.Title", webInterface, loaders, templateRenderer) { override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { if (soneRequest.isPOST) { if (soneRequest.httpRequest.isPartSet("deleteSone")) { soneRequest.core.deleteSone(currentSone) } redirectTo("index.html") } } }