Trial page: throwaway ring poll to test a screen with a phone, swept after 2 h

This commit is contained in:
2026-11-16 22:11:33 +01:00
parent 0dbb3f08bd
commit c93d1595a9
9 changed files with 98 additions and 3 deletions
+1
View File
@@ -154,3 +154,4 @@ button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.card { padding: 0; }
.code-cell { break-inside: avoid; }
}
.center { text-align: center; }
+23
View File
@@ -0,0 +1,23 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>RotatyVote · Essai</title>
<link rel="icon" href="/static/img/mark.svg" type="image/svg+xml">
<link rel="stylesheet" href="/static/css/app.css">
<script type="module" src="/static/js/essai.js"></script>
</head>
<body>
<main class="wrap narrow">
<div class="topbar"><a class="brand" href="/"><img src="/static/img/mark.svg" alt=""><span>rotaty<b>vote</b></span></a></div>
<section class="card">
<h1>Tester l'écran</h1>
<p>Ouvrez cette page sur l'ordinateur relié au projecteur, puis visez l'écran avec votre téléphone depuis le fond de la salle.</p>
<div class="actions"><button id="go" class="primary block" type="button">Lancer l'essai</button></div>
<p class="hint">Scrutin jetable, effacé au bout de 2 h.</p>
</section>
</main>
</body>
</html>
+1
View File
@@ -61,6 +61,7 @@
<div class="actions"><button class="primary block" type="submit">Créer le scrutin</button></div>
</form>
</section>
<p class="hint center" id="try-link"><a href="/essai">Tester l'écran et les téléphones avant l'AG</a></p>
<section id="done" class="card" hidden>
<h1>Scrutin créé</h1>
+12
View File
@@ -0,0 +1,12 @@
import { $, api, toast } from "./common.js";
$("#go").addEventListener("click", async (e) => {
e.target.disabled = true;
try {
const r = await api("POST", "/api/trial");
location.href = `/screen/${r.id}#${r.screen_key}`;
} catch (err) {
toast(err.code === "too_many_trials" ? "Trop d'essais en cours, réessayez plus tard" : `Erreur : ${err.message}`, "bad");
e.target.disabled = false;
}
});