forked from Ruderverein-Donau-Linz/rowt
[TASK] add sort element user management
This commit is contained in:
parent
da793fec2d
commit
1fdec59f77
@ -23,6 +23,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
addRelationMagic(<HTMLElement>document.querySelector("body"));
|
addRelationMagic(<HTMLElement>document.querySelector("body"));
|
||||||
reloadPage();
|
reloadPage();
|
||||||
setCurrentdate(<HTMLInputElement>document.querySelector("#departure"));
|
setCurrentdate(<HTMLInputElement>document.querySelector("#departure"));
|
||||||
|
initDropdown();
|
||||||
});
|
});
|
||||||
|
|
||||||
function changeTheme() {
|
function changeTheme() {
|
||||||
@ -795,3 +796,21 @@ function replaceStrings() {
|
|||||||
weekday.innerHTML = weekday.innerHTML.replace("Freitag", "Markttag");
|
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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -28,13 +28,34 @@
|
|||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- START filterBar -->
|
<!-- START filterBar -->
|
||||||
<div class="search-wrapper">
|
<div class="search-wrapper flex">
|
||||||
<label for="name" class="sr-only">Suche</label>
|
<label for="name" class="sr-only">Suche</label>
|
||||||
<input type="search"
|
<input type="search"
|
||||||
name="name"
|
name="name"
|
||||||
id="filter-js"
|
id="filter-js"
|
||||||
class="search-bar"
|
class="search-bar"
|
||||||
placeholder="Suchen nach (Name, [yes|no]-role:<name>, has-[no-]membership-pdf)" />
|
placeholder="Suchen nach (Name, [yes|no]-role:<name>, has-[no-]membership-pdf)" />
|
||||||
|
|
||||||
|
<div class="relative">
|
||||||
|
<button id="dropdownbtn" data-dropdown="dropdown" class="btn btn-dark ml-3" type="button">
|
||||||
|
Sortieren
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<!-- Dropdown menu -->
|
||||||
|
<div id="dropdown" class="z-10 hidden bg-white divide-y divide-gray-100 text-secondary-900 rounded-lg shadow-sm w-44 absolute right-0">
|
||||||
|
<ul class="py-2 text-sm" aria-labelledby="dropdownbtn">
|
||||||
|
<li>
|
||||||
|
<a href="./user" class="block px-4 py-2 hover:bg-gray-100 hover:text-secondary-950">Zuletzt eingeloggt</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="?sort=name&asc" class="block px-4 py-2 hover:bg-gray-100 hover:text-secondary-950">Name A-Z</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="?sort=name" class="block px-4 py-2 hover:bg-gray-100 hover:text-secondary-950">Name Z-A</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- END filterBar -->
|
<!-- END filterBar -->
|
||||||
<div id="filter-result-js" class="search-result"></div>
|
<div id="filter-result-js" class="search-result"></div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user