1
0
forked from ScoDoc/ScoDoc

Merge pull request 'Partition editor : progress bar' (#678) from lehmann/ScoDoc-Front:master into sco96

Reviewed-on: https://scodoc.org/git/ScoDoc/ScoDoc/pulls/678
This commit is contained in:
Emmanuel Viennet 2023-07-31 20:00:16 +02:00
commit e7e35bd4b6
2 changed files with 31 additions and 1 deletions

View File

@ -394,6 +394,7 @@ body.editionActivated .filtres .nonEditable .move {
padding: 4px 8px; padding: 4px 8px;
margin-bottom: 16px; margin-bottom: 16px;
border-radius: 4px; border-radius: 4px;
position: relative;
} }
#zoneChoix .autoAffectation>select { #zoneChoix .autoAffectation>select {
@ -415,6 +416,23 @@ body.editionActivated .filtres .nonEditable .move {
margin-bottom: 4px; margin-bottom: 4px;
width: fit-content; width: fit-content;
} }
#zoneChoix .autoAffectation .progress {
position: absolute;
top: 100%;
left: 0;
right: 0;
height: 4px;
background: #717171;
}
#zoneChoix .autoAffectation .progress>div {
position: absolute;
top: 0;
left: 0;
width: calc(100% * var(--nombre) / var(--reference));
bottom: 0;
background: #0c9;
}
#zoneChoix .etudiants>div { #zoneChoix .etudiants>div {
background: #FFF; background: #FFF;

View File

@ -47,6 +47,10 @@
vers le groupe vers le groupe
<select name="affectationTo" id="affectationTo"></select> <select name="affectationTo" id="affectationTo"></select>
<div class="affectationGo">Valider</div> <div class="affectationGo">Valider</div>
<div class="progress">
<div></div>
</div>
</div> </div>
</details> </details>
@ -430,6 +434,7 @@
/****************************/ /****************************/
/* Affectation à un groupe */ /* Affectation à un groupe */
/****************************/ /****************************/
var progressNb = 0;
function affectationGo() { function affectationGo() {
let from = document.querySelector("#affectationFrom").value; let from = document.querySelector("#affectationFrom").value;
let to = document.querySelector("#affectationTo").value; let to = document.querySelector("#affectationTo").value;
@ -450,7 +455,12 @@
}) })
} }
console.log(elements); let progress = document.querySelector("#zoneChoix .autoAffectation .progress");
if(elements.length > 1){
progress.style.setProperty('--reference', elements.length);
progress.style.setProperty('--nombre', 0);
progressNb = 0;
}
elements.forEach(groupeSelected => { elements.forEach(groupeSelected => {
if (to[0] != "n") { if (to[0] != "n") {
@ -502,6 +512,8 @@
this.classList.remove("saving"); this.classList.remove("saving");
this.classList.add("saved"); this.classList.add("saved");
setTimeout(() => { this.classList.remove("saved") }, 800); setTimeout(() => { this.classList.remove("saved") }, 800);
let progress = document.querySelector("#zoneChoix .autoAffectation .progress");
progress.style.setProperty('--nombre', ++progressNb);
return; return;
} }
throw 'Les données retournées ne sont pas valides'; throw 'Les données retournées ne sont pas valides';