From b1055a4ebe841f17860d2556cc4b03aa12ec3ab1 Mon Sep 17 00:00:00 2001 From: Iziram Date: Tue, 26 Mar 2024 09:02:55 +0100 Subject: [PATCH] =?UTF-8?q?Assiduit=C3=A9=20:=20signal=5Fassiduites=5Fgrou?= =?UTF-8?q?p=20:=20fix=20bug=20photo=20etud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/js/assiduites.js | 12 +++++------- .../assiduites/pages/signal_assiduites_group.j2 | 5 ++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/static/js/assiduites.js b/app/static/js/assiduites.js index eef76266..4fa75afa 100644 --- a/app/static/js/assiduites.js +++ b/app/static/js/assiduites.js @@ -217,13 +217,11 @@ function creerLigneEtudiant(etud, index) { const nameField = document.createElement("div"); nameField.classList.add("name_field"); - if ($("#pdp").is(":checked")) { - const pdp = document.createElement("img"); - pdp.src = `../../api/etudiant/etudid/${etud.id}/photo?size=small`; - pdp.alt = `${etud.nom} ${etud.prenom}`; - pdp.classList.add("pdp"); - nameField.appendChild(pdp); - } + const pdp = document.createElement("img"); + pdp.src = `../../api/etudiant/etudid/${etud.id}/photo?size=small`; + pdp.alt = `${etud.nom} ${etud.prenom}`; + pdp.classList.add("pdp"); + nameField.appendChild(pdp); const nameSet = document.createElement("a"); nameSet.classList.add("name_set"); diff --git a/app/templates/assiduites/pages/signal_assiduites_group.j2 b/app/templates/assiduites/pages/signal_assiduites_group.j2 index c3f43af4..bb665b4b 100644 --- a/app/templates/assiduites/pages/signal_assiduites_group.j2 +++ b/app/templates/assiduites/pages/signal_assiduites_group.j2 @@ -54,7 +54,8 @@ } document.getElementById("pdp").addEventListener("change", (e) => { - creerTousLesEtudiants(etuds); + afficherPDP(e.target.checked); + //creerTousLesEtudiants(etuds); }); $('#date').on('change', async function(d) { @@ -87,6 +88,8 @@ } creerTousLesEtudiants(etuds); + // affichage ou non des PDP + afficherPDP(localStorage.getItem("scodoc-etud-pdp") == "true" ) } setTimeout(main, 0);