Merge pull request 'Correctif affectations groupes' (#676) from lehmann/ScoDoc-Front:master into master

Reviewed-on: https://scodoc.org/git/ScoDoc/ScoDoc/pulls/676
This commit is contained in:
Emmanuel Viennet 2023-07-24 21:26:36 +02:00
commit 92e75e11f2
3 changed files with 44 additions and 33 deletions

View File

@ -366,6 +366,11 @@ body.editionActivated .filtres .nonEditable .move {
/*****************************/ /*****************************/
/* Zone Etudiants */ /* Zone Etudiants */
/*****************************/ /*****************************/
#zoneChoix summary{
margin: 0 0 16px;
cursor: pointer;
}
#zoneChoix .autoAffectation>a { #zoneChoix .autoAffectation>a {
text-decoration: underline; text-decoration: underline;
} }
@ -383,7 +388,7 @@ body.editionActivated .filtres .nonEditable .move {
transform: scale(0.9); transform: scale(0.9);
} }
#zoneChoix>.autoAffectation { #zoneChoix .autoAffectation {
background: #c9c9c9; background: #c9c9c9;
color: #141414; color: #141414;
padding: 4px 8px; padding: 4px 8px;
@ -391,13 +396,13 @@ body.editionActivated .filtres .nonEditable .move {
border-radius: 4px; border-radius: 4px;
} }
#zoneChoix>.autoAffectation>select { #zoneChoix .autoAffectation>select {
border: none; border: none;
padding: 4px; padding: 4px;
border-radius: 4px; border-radius: 4px;
} }
#zoneChoix>.autoAffectation>.affectationGo { #zoneChoix .autoAffectation>.affectationGo {
display: inline-block; display: inline-block;
background: #0c9; background: #0c9;
padding: 8px 16px; padding: 8px 16px;

View File

@ -22,6 +22,8 @@
<section id="zoneChoix"> <section id="zoneChoix">
<h2>Étudiants</h2> <h2>Étudiants</h2>
<details>
<summary>Outils d'affections</summary>
<div class="autoAffectation"> <div class="autoAffectation">
<a href="students_groups_auto_assignment?formsemestre_id={{formsemestre.id}}"><svg <a href="students_groups_auto_assignment?formsemestre_id={{formsemestre.id}}"><svg
xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none"
@ -46,6 +48,8 @@
<select name="affectationTo" id="affectationTo"></select> <select name="affectationTo" id="affectationTo"></select>
<div class="affectationGo">Valider</div> <div class="affectationGo">Valider</div>
</div> </div>
</details>
<div class="etudiants"></div> <div class="etudiants"></div>
</section> </section>

View File

@ -375,7 +375,7 @@
Object.values(partition.groups).forEach(group => { Object.values(partition.groups).forEach(group => {
parcours[group.id] = { parcours[group.id] = {
nom: group.group_name, nom: group.group_name,
places: savedData.parcours[group.id].places || 28, places: savedData.parcours?.[group.id].places || 28,
etudiants: [] // Résultat du tri etudiants: [] // Résultat du tri
} }
}) })
@ -435,17 +435,19 @@
} }
},*/ },*/
etudiantsRaw.forEach(etudiant => { etudiantsRaw.forEach(etudiant => {
saved = savedData.etudiants['id' + etudiant.id]; saved = savedData.etudiants?.['id' + etudiant.id] || {};
etudiants['id' + etudiant.id] = { etudiants['id' + etudiant.id] = {
actif: saved.actif ? true : false, actif: saved.actif == false ? false : true,
nom: etudiant.nom + " " + etudiant.prenom, nom: etudiant.nom + " " + etudiant.prenom,
criteres: saved.criteres || {}, criteres: saved.criteres || {},
voeux: saved.voeux || {} voeux: saved.voeux || {}
}; };
/*Object.keys(parcours).forEach((idParcours, index) => {
if (Object.keys(saved).length == 0)
Object.keys(parcours).forEach((idParcours, index) => {
etudiants['id' + etudiant.id].criteres[idParcours] = 10; etudiants['id' + etudiant.id].criteres[idParcours] = 10;
etudiants['id' + etudiant.id].voeux[idParcours] = index + 1; etudiants['id' + etudiant.id].voeux[idParcours] = index + 1;
})*/ })
}) })
/* Zone étudiants */ /* Zone étudiants */