From d4a03623544aac0ce911d8471ff4b033bc3255e1 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Mon, 17 Aug 2026 20:06:22 +0200 Subject: feat(sender): add manual source rescan action Add an authenticated action to queue a source rescan from the sent Webmentions overview. Extract the reusable confirmation modal and its JavaScript so received and sent admin actions share the same implementation. --- webmentions_ssg/static/js/confirmation-modal.js | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 webmentions_ssg/static/js/confirmation-modal.js (limited to 'webmentions_ssg/static/js') diff --git a/webmentions_ssg/static/js/confirmation-modal.js b/webmentions_ssg/static/js/confirmation-modal.js new file mode 100644 index 0000000..e278790 --- /dev/null +++ b/webmentions_ssg/static/js/confirmation-modal.js @@ -0,0 +1,26 @@ +document.addEventListener("DOMContentLoaded", () => { + const confirmationModal = document.getElementById("confirmation-modal"); + + if (confirmationModal === null) { + return; + } + + confirmationModal.addEventListener("show.bs.modal", (event) => { + const button = event.relatedTarget; + + const form = confirmationModal.querySelector("#confirmation-modal-form"); + const title = confirmationModal.querySelector("#confirmation-modal-title"); + const message = confirmationModal.querySelector( + "#confirmation-modal-message", + ); + const submit = form.querySelector("#submit"); + + form.action = button.dataset.action; + + title.textContent = button.dataset.title; + message.textContent = button.dataset.message; + + submit.value = button.dataset.confirmLabel; + submit.className = `btn ${button.dataset.confirmClass}`; + }); +}); -- cgit v1.3.1