From 269b739613fc38a4292b58527f2033db3abb0d4c Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 7 Dec 2023 15:47:15 +0100 Subject: [PATCH] =?UTF-8?q?Assiduit=C3=A9=20calendrier:=20m=C3=A9morise=20?= =?UTF-8?q?=C3=A9tat=20checkboxes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/assiduites/pages/calendrier.j2 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/templates/assiduites/pages/calendrier.j2 b/app/templates/assiduites/pages/calendrier.j2 index eff9fe86a..79dbbad76 100644 --- a/app/templates/assiduites/pages/calendrier.j2 +++ b/app/templates/assiduites/pages/calendrier.j2 @@ -6,9 +6,9 @@

Assiduité de {{sco.etud.nomprenom}}

- - - + + +
@@ -688,5 +688,17 @@ function isCalendrier() { return true } + + /* --- Mémorisation des checkbox ---- */ + document.querySelectorAll('input[type="checkbox"].memo').forEach(checkbox => { + checkbox.addEventListener('change', function() { + localStorage.setItem(this.id, this.checked); + }); + // Load the saved state + document.querySelectorAll('input[type="checkbox"].memo').forEach(checkbox => { + const checked = localStorage.getItem(checkbox.id) === 'true'; + checkbox.checked = checked; + }); +}); {% endblock pageContent %}