From a5369cf9b730e14399f9485121fd4b63ba787a27 Mon Sep 17 00:00:00 2001 From: lehmann Date: Mon, 31 Jul 2023 20:10:42 +0200 Subject: [PATCH] Progress fin message --- app/templates/scolar/partition_editor.j2 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/templates/scolar/partition_editor.j2 b/app/templates/scolar/partition_editor.j2 index 76e8a69c..bdd900d9 100644 --- a/app/templates/scolar/partition_editor.j2 +++ b/app/templates/scolar/partition_editor.j2 @@ -51,9 +51,9 @@
- + - +
@@ -435,6 +435,7 @@ /* Affectation à un groupe */ /****************************/ var progressNb = 0; + var progressRef = 0; function affectationGo() { let from = document.querySelector("#affectationFrom").value; let to = document.querySelector("#affectationTo").value; @@ -456,9 +457,10 @@ } let progress = document.querySelector("#zoneChoix .autoAffectation .progress"); - if(elements.length > 1){ + if (elements.length > 1) { progress.style.setProperty('--reference', elements.length); progress.style.setProperty('--nombre', 0); + progressRef = elements.length; progressNb = 0; } @@ -512,8 +514,13 @@ this.classList.remove("saving"); this.classList.add("saved"); setTimeout(() => { this.classList.remove("saved") }, 800); + let progress = document.querySelector("#zoneChoix .autoAffectation .progress"); progress.style.setProperty('--nombre', ++progressNb); + + if (progressNb == progressRef) { + sco_message("Tous les étudiants sont affectés"); + } return; } throw 'Les données retournées ne sont pas valides';