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