Big entry qr comes back while a closed vote waits for its results; progress ring fill uses real dash lengths (pathLength broke on some android webviews)

This commit is contained in:
2026-11-17 14:17:37 +01:00
parent 0697c27a01
commit cbc8fe9e98
3 changed files with 17 additions and 9 deletions
+6 -4
View File
@@ -34,22 +34,24 @@ function layout() {
if (!st) return;
// qr stays up while enrolling, and during a vote that needs a presence scan
const qrOn = st.enrollment_open || st.presence;
const focus = st.focus;
const ring = st.code_style === "ring";
const entryOn = !!(ring && st.enrollment_open && entry);
// a closed vote whose results aren't shown has nothing to say: with the big entry qr on, it steps aside
const f = st.focus, idleVote = f && f.state === "closed" && !f.results;
const focus = idleVote && entryOn && st.entry_big ? null : f;
reveal($("#enroll"), qrOn);
reveal($("#focus"), !!focus);
reveal($("#idle"), !qrOn && !focus);
$(".s-main").classList.toggle("split", qrOn && !!focus);
document.body.classList.toggle("split-on", qrOn && !!focus);
const ring = st.code_style === "ring";
// a vote waiting for presence scans takes the title, even while late arrivals can still enroll
$("#qr-title").textContent = st.presence || !st.enrollment_open ? (ring ? "Visez le cercle pour voter" : "Scannez pour voter") : "Inscription";
$("#qr-steps").hidden = !st.enrollment_open;
// rings can't be opened by the camera app, so a small fixed qr leads to the page
$("#step1").textContent = ring ? "Ouvrez la page de vote" : "Scannez ce code";
const entryOn = !!(ring && st.enrollment_open && entry);
reveal($("#entry"), entryOn);
document.body.classList.toggle("has-entry", entryOn);
// big entry qr next to the ring (start of a meeting), back to the corner once a question is up
// big entry qr next to the ring (start of a meeting, between votes), back to the corner while a question is up
const big = entryOn && st.entry_big && !focus;
document.body.classList.toggle("entry-big", big);
$("#entry-hint").textContent = big ? "Scannez ici, puis visez le cercle" : "Pas encore sur la page ?";