mirror of
https://git.sr.ht/~roxwize/mipilin
synced 2025-05-10 23:33:07 +00:00
admining
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
65c29b0564
commit
ccc894dc33
10 changed files with 111 additions and 41 deletions
20
static/js/admin.js
Normal file
20
static/js/admin.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
const e_user_selected = document.getElementById("user-selected");
|
||||
let current;
|
||||
|
||||
document.querySelectorAll("#users tr").forEach((el) => {
|
||||
el.addEventListener("click", () => {
|
||||
current = el.querySelector("td:nth-child(2)").textContent;
|
||||
e_user_selected.textContent = current;
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll("button").forEach((el) => {
|
||||
el.addEventListener("click", (ev) => {
|
||||
if (!current) {
|
||||
ev.preventDefault();
|
||||
return;
|
||||
};
|
||||
const e = el.parentElement;
|
||||
e.setAttribute("action", el.parentElement.dataset.url.replaceAll("{}", current));
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue