diff --git a/frontend/main.ts b/frontend/main.ts index 82f59e9..e8d528c 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -23,6 +23,7 @@ document.addEventListener("DOMContentLoaded", function () { addRelationMagic(document.querySelector("body")); reloadPage(); setCurrentdate(document.querySelector("#departure")); + initDropdown(); }); function changeTheme() { @@ -795,3 +796,21 @@ function replaceStrings() { weekday.innerHTML = weekday.innerHTML.replace("Freitag", "Markttag"); }); } + +function initDropdown() { + const popoverTriggerList = document.querySelectorAll('[data-dropdown]'); + + popoverTriggerList.forEach((popoverTriggerEl: Element) => { + const id = popoverTriggerEl.getAttribute('data-dropdown'); + + if (id) { + const element = document.getElementById(id); + if (element) { + // Toggle visibility of the dropdown when clicked + popoverTriggerEl.addEventListener('click', () => { + element.classList.toggle('hidden'); + }); + } + } + }); +} diff --git a/templates/admin/user/index.html.tera b/templates/admin/user/index.html.tera index 9d58196..69e0121 100644 --- a/templates/admin/user/index.html.tera +++ b/templates/admin/user/index.html.tera @@ -4,37 +4,59 @@

Users

{% if allowed_to_edit %} -
+ Neue Person hinzufügen + + class="flex mt-4 rounded-md sm:flex items-end justify-between">
-

Neuen User hinzufügen

-
-
- - -
+
+ +
-
+
+ + {% endif %} -
+
+ +
+ + + + +