Admin: real sliding switch for enrollment, role=switch

This commit is contained in:
2026-08-16 17:02:45 +01:00
parent bfc8d30eaa
commit 243e64aa98
2 changed files with 12 additions and 9 deletions
+3 -2
View File
@@ -48,9 +48,10 @@ function render() {
const tb = $("#toggle-enroll");
// the switch itself carries the state, no status wording
tb.textContent = "Inscriptions";
tb.replaceChildren(h("span", { class: "switch", "aria-hidden": "true" }), "Inscriptions");
tb.className = "enroll-toggle " + (p.enrollment_open ? "on" : "off");
tb.setAttribute("aria-pressed", String(p.enrollment_open));
tb.setAttribute("role", "switch");
tb.setAttribute("aria-checked", String(p.enrollment_open));
$("#open-screen").classList.toggle("connected", state.screens > 0);
$("#open-screen").title = state.screens ? "Projecteur connecté" : "Aucun projecteur connecté";