forked from ScoDoc/ScoDoc
Merge pull request 'Correctif relevé tri UEs capitalisées' (#539) from lehmann/ScoDoc-Front:master into master
Reviewed-on: https://scodoc.org/git/ScoDoc/ScoDoc/pulls/539
This commit is contained in:
commit
362148e0bf
@ -279,6 +279,17 @@ section>div:nth-child(1) {
|
|||||||
background: var(--couleurFondTitresSAE) !important;
|
background: var(--couleurFondTitresSAE) !important;
|
||||||
color: #000 !important;
|
color: #000 !important;
|
||||||
}
|
}
|
||||||
|
/* UE Capitalisée */
|
||||||
|
.synthese .ue.capitalisee,
|
||||||
|
.ue.capitalisee>h3{
|
||||||
|
background: var(--couleurFondTitresUECapitalisee);;
|
||||||
|
}
|
||||||
|
.synthese .ue.capitalisee>h3::before{
|
||||||
|
content: "Capitalisée : ";
|
||||||
|
}
|
||||||
|
.synthese .ue.capitalisee .ue_rang{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
/***************/
|
/***************/
|
||||||
/* Evaluations */
|
/* Evaluations */
|
||||||
@ -294,6 +305,7 @@ section>div:nth-child(1) {
|
|||||||
padding: 4px 32px;
|
padding: 4px 32px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
margin: 4px 0 2px 0;
|
margin: 4px 0 2px 0;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
@ -337,8 +349,6 @@ section>div:nth-child(1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin: 0 auto 0 0;
|
margin: 0 auto 0 0;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
left: -32px;
|
left: -32px;
|
||||||
|
@ -305,7 +305,16 @@ class releveBUT extends HTMLElement {
|
|||||||
/*******************************/
|
/*******************************/
|
||||||
showSynthese(data) {
|
showSynthese(data) {
|
||||||
let output = ``;
|
let output = ``;
|
||||||
Object.entries(data.ues).forEach(([ue, dataUE]) => {
|
/* Fusion et tri des UE et UE capitalisées */
|
||||||
|
let fusionUE = [
|
||||||
|
...Object.entries(data.ues),
|
||||||
|
...Object.entries(data.ues_capitalisees)
|
||||||
|
].sort((a, b) => {
|
||||||
|
return a[1].numero - b[1].numero
|
||||||
|
});
|
||||||
|
|
||||||
|
/* Affichage */
|
||||||
|
fusionUE.forEach(([ue, dataUE]) => {
|
||||||
if (dataUE.type == 1) { // UE Sport / Bonus
|
if (dataUE.type == 1) { // UE Sport / Bonus
|
||||||
output += `
|
output += `
|
||||||
<div>
|
<div>
|
||||||
@ -319,17 +328,22 @@ class releveBUT extends HTMLElement {
|
|||||||
} else {
|
} else {
|
||||||
output += `
|
output += `
|
||||||
<div>
|
<div>
|
||||||
<div class=ue>
|
<div class="ue ${dataUE.date_capitalisation?"capitalisee":""}">
|
||||||
<h3>
|
<h3>
|
||||||
${ue}${(dataUE.titre) ? " - " + dataUE.titre : ""}
|
${ue}${(dataUE.titre) ? " - " + dataUE.titre : ""}
|
||||||
</h3>
|
</h3>
|
||||||
<div>
|
<div>
|
||||||
<div class=moyenne>Moyenne : ${dataUE.moyenne?.value ?? "-"}</div>
|
<div class=moyenne>Moyenne : ${dataUE.moyenne?.value || dataUE.moyenne || "-"}</div>
|
||||||
<div class=ue_rang>Rang : ${dataUE.moyenne?.rang} / ${dataUE.moyenne?.total}</div>
|
<div class=ue_rang>Rang : ${dataUE.moyenne?.rang} / ${dataUE.moyenne?.total}</div>
|
||||||
<div class=info>
|
<div class=info>`;
|
||||||
Bonus : ${dataUE.bonus || 0} -
|
if(!dataUE.date_capitalisation){
|
||||||
Malus : ${dataUE.malus || 0}
|
output += ` Bonus : ${dataUE.bonus || 0} -
|
||||||
<span class=ects> -
|
Malus : ${dataUE.malus || 0}`;
|
||||||
|
} else {
|
||||||
|
output += ` le ${this.ISOToDate(dataUE.date_capitalisation.split("T")[0])} <a href="${dataUE.bul_orig_url}">dans ce semestre</a>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
output += ` <span class=ects> -
|
||||||
ECTS : ${dataUE.ECTS?.acquis ?? "-"} / ${dataUE.ECTS?.total ?? "-"}
|
ECTS : ${dataUE.ECTS?.acquis ?? "-"} / ${dataUE.ECTS?.total ?? "-"}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -338,57 +352,19 @@ class releveBUT extends HTMLElement {
|
|||||||
<div>Abs N.J.</div><div>${dataUE.absences?.injustifie || 0}</div>
|
<div>Abs N.J.</div><div>${dataUE.absences?.injustifie || 0}</div>
|
||||||
<div>Total</div><div>${dataUE.absences?.total || 0}</div>
|
<div>Total</div><div>${dataUE.absences?.total || 0}</div>
|
||||||
</div>*/
|
</div>*/
|
||||||
output += `
|
output += "</div>";
|
||||||
</div>
|
|
||||||
${this.synthese(data, dataUE.ressources)}
|
if(!dataUE.date_capitalisation){
|
||||||
${this.synthese(data, dataUE.saes)}
|
output +=
|
||||||
</div>
|
this.synthese(data, dataUE.ressources) +
|
||||||
`;
|
this.synthese(data, dataUE.saes);
|
||||||
/* UE capitalisées */
|
|
||||||
if (data.ues_capitalisees !== undefined) {
|
|
||||||
if (ue in data.ues_capitalisees) {
|
|
||||||
output += this.show_ue_capitalisee(ue, data.ues_capitalisees[ue]);
|
|
||||||
delete data.ues_capitalisees[ue];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output += "</div>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/* UE capitalisées seulement (non déjà vues) */
|
|
||||||
if (data.ues_capitalisees !== undefined) {
|
|
||||||
Object.entries(data.ues_capitalisees).forEach(([ue, ue_cap]) => {
|
|
||||||
output += this.show_ue_capitalisee(ue, data.ues_capitalisees[ue]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.shadow.querySelector(".synthese").innerHTML = output;
|
this.shadow.querySelector(".synthese").innerHTML = output;
|
||||||
}
|
}
|
||||||
|
|
||||||
show_ue_capitalisee(ue, ue_cap) {
|
|
||||||
let date_capitalisation = new Date(ue_cap.date_capitalisation).toLocaleString("fr-FR");
|
|
||||||
let link_sem = "";
|
|
||||||
if (ue_cap.bul_orig_url != null) {
|
|
||||||
link_sem = `<a href="${ue_cap.bul_orig_url}">dans ce semestre</a>`;
|
|
||||||
}
|
|
||||||
return `
|
|
||||||
<div>
|
|
||||||
<div class="ue ue_capitalisee">
|
|
||||||
<h3>
|
|
||||||
Capitalisée : ${ue}${(ue_cap.titre) ? " - " + ue_cap.titre : ""}
|
|
||||||
</h3>
|
|
||||||
<div>
|
|
||||||
<div class=moyenne>Moyenne : ${ue_cap.moyenne ?? "-"}</div>
|
|
||||||
|
|
||||||
<div class=info>
|
|
||||||
le ${date_capitalisation} ${link_sem}
|
|
||||||
<span class=ects>
|
|
||||||
ECTS : ${ue_cap.ECTS?.acquis ?? "-"} / ${ue_cap.ECTS?.total ?? "-"}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
synthese(data, modules) {
|
synthese(data, modules) {
|
||||||
let output = "";
|
let output = "";
|
||||||
Object.entries(modules).forEach(([module, dataModule]) => {
|
Object.entries(modules).forEach(([module, dataModule]) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user