From cb3a501280b14917fd1c594f25521a4979ca20fb Mon Sep 17 00:00:00 2001 From: Andrea Date: Sat, 2 Mar 2024 17:06:00 +0100 Subject: [PATCH] [] Added confirm modal for badge reminder email feature --- res/scripts/adminManager.js | 21 +++++++++++++++++++++ tpl/admin.html | 4 +++- tpl/components/confirm_action_modal.html | 13 +++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 res/scripts/adminManager.js create mode 100644 tpl/components/confirm_action_modal.html diff --git a/res/scripts/adminManager.js b/res/scripts/adminManager.js new file mode 100644 index 0000000..f6584de --- /dev/null +++ b/res/scripts/adminManager.js @@ -0,0 +1,21 @@ +function confirmAction (intent, sender) { + if (['propicReminder'].includes (intent) == false) return + let href = sender.getAttribute('action') + let intentTitle = document.querySelector("#intentText") + let intentDescription = document.querySelector("#intentDescription") + let intentEditPanel = document.querySelector("#intentEditPanel") + let intentFormAction = document.querySelector("#intentFormAction") + let intentSend = document.querySelector("#intentSend") + // Resetting ui + intentFormAction.setAttribute('method', 'GET') + intentEditPanel.style.display = 'none'; + intentDescription.innerText = sender.title; + intentFormAction.setAttribute('action', href) + switch (intent){ + case 'propicReminder': + intentTitle.innerText = "Send missing badge reminders"; + intentSend.innerText = sender.innerText; + break; + } + document.getElementById('modalRoomconfirm').setAttribute('open', 'true'); +} \ No newline at end of file diff --git a/tpl/admin.html b/tpl/admin.html index 2c1b0fb..d234b31 100644 --- a/tpl/admin.html +++ b/tpl/admin.html @@ -2,6 +2,7 @@ {% block title %}Admin panel{% endblock %} {% block main %}
+
@@ -13,8 +14,9 @@ Clear cache Manage rooms Verify Rooms - Remind badge upload + Remind badge upload
+ {% include 'components/confirm_action_modal.html' %}
{% endblock %} diff --git a/tpl/components/confirm_action_modal.html b/tpl/components/confirm_action_modal.html new file mode 100644 index 0000000..db9fb31 --- /dev/null +++ b/tpl/components/confirm_action_modal.html @@ -0,0 +1,13 @@ +
+ +
+ +

Confirm action

+

+
+ +
+
+
\ No newline at end of file -- 2.43.4