diff --git a/app/static/js/assiduites.js b/app/static/js/assiduites.js index eef76266d..4fa75afab 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 c3f43af4f..bb665b4b4 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);