diff --git a/zerobin/routes.py b/zerobin/routes.py index c1f8a59..272cc07 100644 --- a/zerobin/routes.py +++ b/zerobin/routes.py @@ -75,15 +75,19 @@ def admin(): if paste_id: try: if "/paste/" in paste_id: - paste_id = urlparse(paste_id).path.split("/path/")[-1] + paste_id = urlparse(paste_id).path.split("/paste/")[-1] paste = Paste.load(paste_id) paste.delete() except (TypeError, ValueError, FileNotFoundError): - return {"status": "error", "message": f"Cannot find paste '{paste_id}'"} + return { + "status": "error", + "message": f"Cannot find paste '{paste_id}'", + **GLOBAL_CONTEXT, + } - return {"status": "ok", "message": "Paste deleted"} + return {"status": "ok", "message": "Paste deleted", **GLOBAL_CONTEXT} - return {"status": "ok", **GLOBAL_CONTEXT} + return {"status": "ok", "message": "" ** GLOBAL_CONTEXT} @app.get(ADMIN_LOGIN_URL) diff --git a/zerobin/views/admin.tpl b/zerobin/views/admin.tpl index 14c1a2f..03c3656 100644 --- a/zerobin/views/admin.tpl +++ b/zerobin/views/admin.tpl @@ -1,9 +1,14 @@ -
+ %if status == "error":
{{message}}
%end + %if status == "ok" and message: + + %end
diff --git a/zerobin/views/base.tpl b/zerobin/views/base.tpl index f3aa0a7..1dde51e 100644 --- a/zerobin/views/base.tpl +++ b/zerobin/views/base.tpl @@ -26,7 +26,7 @@
-
+
øbin.net "A client side encrypted PasteBin"
All pastes are AES256 encrypted, we cannot know what you paste... @@ -36,8 +36,7 @@