diff --git a/app/static/common-admin.js b/app/static/common-admin.js index f8d5c63..10254cd 100644 --- a/app/static/common-admin.js +++ b/app/static/common-admin.js @@ -3,7 +3,9 @@ document.addEventListener('DOMContentLoaded', (ev) => { var forms = document.getElementsByClassName("object-delete-form") for (var i = 0; i < forms.length; i++) { forms[i].addEventListener('submit', (ev) => { - return confirm('Do you really want to delete this object?'); + if (!confirm('Do you really want to delete this object?')) { + ev.preventDefault(); + }; }); } }); diff --git a/app/templates.py b/app/templates.py index 0b3b493..8ac8a2a 100644 --- a/app/templates.py +++ b/app/templates.py @@ -26,7 +26,6 @@ from app.actor import LOCAL_ACTOR from app.ap_object import Attachment from app.ap_object import Object from app.config import BASE_URL -from app.config import CSS_HASH from app.config import CUSTOM_FOOTER from app.config import DEBUG from app.config import VERSION @@ -105,7 +104,6 @@ async def render_template( "request": request, "debug": DEBUG, "microblogpub_version": VERSION, - "css_hash": CSS_HASH, "is_admin": is_admin, "csrf_token": generate_csrf_token(), "highlight_css": HIGHLIGHT_CSS, @@ -419,3 +417,5 @@ _templates.env.filters["parse_datetime"] = _parse_datetime _templates.env.filters["poll_item_pct"] = _poll_item_pct _templates.env.filters["privacy_replace_url"] = privacy_replace.replace_url _templates.env.globals["JS_HASH"] = config.JS_HASH +_templates.env.globals["CSS_HASH"] = config.CSS_HASH +_templates.env.globals["BASE_URL"] = config.BASE_URL diff --git a/app/templates/layout.html b/app/templates/layout.html index c0c45f2..f2b8c64 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -4,7 +4,7 @@ - + diff --git a/app/templates/utils.html b/app/templates/utils.html index f017bca..52c0c3f 100644 --- a/app/templates/utils.html +++ b/app/templates/utils.html @@ -96,11 +96,11 @@ {% endmacro %} -{% macro admin_delete_button(ap_object_id) %} +{% macro admin_delete_button(ap_object) %}
{% endmacro %} @@ -515,7 +515,7 @@