Remove obsolete loading animation
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / DeleteSonePage.kt
1 package net.pterodactylus.sone.web
2
3 import net.pterodactylus.sone.utils.isPOST
4 import net.pterodactylus.sone.web.page.FreenetRequest
5 import net.pterodactylus.util.template.Template
6 import net.pterodactylus.util.template.TemplateContext
7
8 /**
9  * Lets the user delete a Sone. Of course the Sone is not really deleted from
10  * Freenet; merely all references to it are removed from the local plugin
11  * installation.
12  */
13 class DeleteSonePage(template: Template, webInterface: WebInterface):
14                 SoneTemplatePage("deleteSone.html", template, "Page.DeleteSone.Title", webInterface, true) {
15
16         override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) {
17                 if (request.isPOST) {
18                         if (request.httpRequest.isPartSet("deleteSone")) {
19                                 webInterface.core.deleteSone(getCurrentSone(request.toadletContext))
20                         }
21                         throw RedirectException("index.html")
22                 }
23         }
24
25 }