nouveaux bulletins BUT (commit d712bcf de SL)

This commit is contained in:
Emmanuel Viennet 2022-01-29 22:56:01 +01:00
parent 23672bebde
commit 2f7e0b06a4
2 changed files with 404 additions and 335 deletions

View File

@ -91,7 +91,8 @@ section>div:nth-child(1){
/***********************/ /***********************/
/* Options d'affichage */ /* Options d'affichage */
/***********************/ /***********************/
.hide_abs .absences, .hide_abs .absencesRecap,
/*.hide_abs .absences,*/
.hide_abs_modules .module>.absences, .hide_abs_modules .module>.absences,
.hide_coef .synthese em, .hide_coef .synthese em,
.hide_coef .eval>em, .hide_coef .eval>em,
@ -100,7 +101,7 @@ section>div:nth-child(1){
display: none; display: none;
} }
.module>.absences, /*.module>.absences,*/
.module .moyenne, .module .moyenne,
.module .info{ .module .info{
display: none; display: none;
@ -131,14 +132,15 @@ section>div:nth-child(1){
/************/ /************/
.flex{ .flex{
display: flex; display: flex;
gap: 16px; flex-wrap: wrap;
gap: 8px;
margin-top: 8px;
} }
.infoSemestre{ .infoSemestre{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; align-items: flex-start;
gap: 4px; gap: 4px;
flex: none;
} }
.infoSemestre>div{ .infoSemestre>div{
border: 1px solid var(--couleurIntense); border: 1px solid var(--couleurIntense);
@ -147,6 +149,7 @@ section>div:nth-child(1){
display: grid; display: grid;
grid-template-columns: auto auto; grid-template-columns: auto auto;
column-gap: 4px; column-gap: 4px;
flex: none;
} }
.infoSemestre>div:nth-child(1){ .infoSemestre>div:nth-child(1){
margin-right: auto; margin-right: auto;
@ -169,6 +172,12 @@ section>div:nth-child(1){
font-size: 20px; font-size: 20px;
margin-bottom: 4px; margin-bottom: 4px;
} }
/***************/
/* Zone custom */
/***************/
.custom:empty{
display: none;
}
/***************/ /***************/
/* Synthèse */ /* Synthèse */
@ -183,10 +192,19 @@ section>div:nth-child(1){
min-width: 80px; min-width: 80px;
display: inline-block; display: inline-block;
} }
.ueBonus,
.ueBonus h3{
background: var(--couleurFondTitresSAE) !important;
color: #000 !important;
}
/***************/ /***************/
/* Evaluations */ /* Evaluations */
/***************/ /***************/
.evaluations>div,
.sae>div{
scroll-margin-top: 60px;
}
.module, .ue { .module, .ue {
background: var(--couleurSecondaire); background: var(--couleurSecondaire);
color: #000; color: #000;
@ -201,16 +219,22 @@ section>div:nth-child(1){
position: relative; position: relative;
} }
.module::before, .ue::before { .module::before, .ue::before {
content:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26px' height='26px' fill='black'><path d='M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z' /></svg>"); content:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26px' height='26px' fill='white'><path d='M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z' /></svg>");
width: 26px; width: 26px;
height: 26px; height: 26px;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 50%; left: calc(50% - 13px);
margin-left: -13px;
transform: rotate(180deg); transform: rotate(180deg);
transition: 0.2s; transition: 0.2s;
} }
@media screen and (max-width: 1000px) {
/* Placer le chevron à gauche au lieu du milieu */
.module::before, .ue::before {
left: 2px;
bottom: calc(50% - 13px);
}
}
h3{ h3{
display: flex; display: flex;
align-items: center; align-items: center;
@ -284,7 +308,7 @@ h3{
margin-bottom: 8px; margin-bottom: 8px;
} }
.absences{ /*.absences{
display: grid; display: grid;
grid-template-columns: auto auto; grid-template-columns: auto auto;
column-gap: 4px; column-gap: 4px;
@ -295,4 +319,4 @@ h3{
.absences>div:nth-child(1), .absences>div:nth-child(1),
.absences>div:nth-child(2){ .absences>div:nth-child(2){
font-weight: bold; font-weight: bold;
} }*/

View File

@ -15,13 +15,10 @@ class releveBUT extends HTMLElement {
/* Style du module */ /* Style du module */
const styles = document.createElement('link'); const styles = document.createElement('link');
styles.setAttribute('rel', 'stylesheet'); styles.setAttribute('rel', 'stylesheet');
styles.setAttribute('href', '/ScoDoc/static/css/releve-but.css'); if (location.href.split("/")[3] == "ScoDoc") {
/* variante "ScoDoc" ou "Passerelle" (ENT) ? */ styles.setAttribute('href', '/ScoDoc/static/css/releve-but.css'); // Scodoc
if (location.href.split("/")[3] == "ScoDoc") { /* un peu osé... */
styles.setAttribute('href', '/ScoDoc/static/css/releve-but.css');
} else { } else {
// Passerelle styles.setAttribute('href', '/assets/styles/releve-but.css'); // Passerelle
styles.setAttribute('href', '/assets/styles/releve-but.css');
} }
this.shadow.appendChild(styles); this.shadow.appendChild(styles);
} }
@ -49,6 +46,8 @@ class releveBUT extends HTMLElement {
this.showSynthese(data); this.showSynthese(data);
this.showEvaluations(data); this.showEvaluations(data);
this.showCustom(data);
this.setOptions(data.options); this.setOptions(data.options);
this.shadow.querySelectorAll(".CTA_Liste").forEach(e => { this.shadow.querySelectorAll(".CTA_Liste").forEach(e => {
@ -57,7 +56,7 @@ class releveBUT extends HTMLElement {
this.shadow.querySelectorAll(".ue, .module").forEach(e => { this.shadow.querySelectorAll(".ue, .module").forEach(e => {
e.addEventListener("click", this.moduleOnOff) e.addEventListener("click", this.moduleOnOff)
}) })
this.shadow.querySelectorAll(".syntheseModule").forEach(e => { this.shadow.querySelectorAll(":not(.ueBonus)+.syntheseModule").forEach(e => {
e.addEventListener("click", this.goTo) e.addEventListener("click", this.goTo)
}) })
@ -77,6 +76,11 @@ class releveBUT extends HTMLElement {
<div class=infoEtudiant></div> <div class=infoEtudiant></div>
</section> </section>
<!--------------------------------------------------------------------------------------->
<!-- Zone spéciale pour que les IUT puisse ajouter des infos locales sur la passerelle -->
<!--------------------------------------------------------------------------------------->
<section class=custom></section>
<!---------------------------> <!--------------------------->
<!-- Semestre --> <!-- Semestre -->
<!---------------------------> <!--------------------------->
@ -169,8 +173,8 @@ class releveBUT extends HTMLElement {
output += ` output += `
</div> </div>
<div class=numerosEtudiant> <div class=numerosEtudiant>
Numéro étudiant : ${data.etudiant.code_nip} - Numéro étudiant : ${data.etudiant.code_nip || "~"} -
Code INE : ${data.etudiant.code_ine} Code INE : ${data.etudiant.code_ine || "~"}
</div> </div>
<div>${data.formation.titre}</div> <div>${data.formation.titre}</div>
`; `;
@ -183,6 +187,13 @@ class releveBUT extends HTMLElement {
this.shadow.querySelector(".infoEtudiant").innerHTML = output; this.shadow.querySelector(".infoEtudiant").innerHTML = output;
} }
/*******************************/
/* Affichage local */
/*******************************/
showCustom(data) {
this.shadow.querySelector(".custom").innerHTML = data.custom || "";
}
/*******************************/ /*******************************/
/* Information sur le semestre */ /* Information sur le semestre */
/*******************************/ /*******************************/
@ -196,6 +207,11 @@ class releveBUT extends HTMLElement {
<div>Max. promo. :</div><div>${data.semestre.notes.max}</div> <div>Max. promo. :</div><div>${data.semestre.notes.max}</div>
<div>Moy. promo. :</div><div>${data.semestre.notes.moy}</div> <div>Moy. promo. :</div><div>${data.semestre.notes.moy}</div>
<div>Min. promo. :</div><div>${data.semestre.notes.min}</div> <div>Min. promo. :</div><div>${data.semestre.notes.min}</div>
</div>
<div class=absencesRecap>
<div class=enteteSemestre>Absences</div>
<div class=enteteSemestre>N.J. ${data.semestre.absences?.injustifie ?? "-"}</div>
<div style="grid-column: 2">Total ${data.semestre.absences?.total ?? "-"}</div>
</div>`; </div>`;
/*${data.semestre.groupes.map(groupe => { /*${data.semestre.groupes.map(groupe => {
return ` return `
@ -210,7 +226,7 @@ class releveBUT extends HTMLElement {
}).join("") }).join("")
}*/ }*/
this.shadow.querySelector(".infoSemestre").innerHTML = output; this.shadow.querySelector(".infoSemestre").innerHTML = output;
/*this.shadow.querySelector(".decision").innerHTML = data.semestre.decision.code;*/ this.shadow.querySelector(".decision").innerHTML = data.semestre.decision?.code || "";
} }
/*******************************/ /*******************************/
@ -219,32 +235,44 @@ class releveBUT extends HTMLElement {
showSynthese(data) { showSynthese(data) {
let output = ``; let output = ``;
Object.entries(data.ues).forEach(([ue, dataUE]) => { Object.entries(data.ues).forEach(([ue, dataUE]) => {
output += ` if (dataUE.type == 1) { // UE Sport / Bonus
output += `
<div> <div>
<div class=ue> <div class="ue ueBonus">
<h3> <h3>Bonus</h3>
${(dataUE.competence) ? dataUE.competence + " - " : ""}${ue} <div>${dataUE.bonus_description}</div>
</h3>
<div>
<div class=moyenne>Moyenne&nbsp;:&nbsp;${dataUE.moyenne?.value || "-"}</div>
<div class=info>
Bonus&nbsp;:&nbsp;${dataUE.bonus || 0}&nbsp;-
Malus&nbsp;:&nbsp;${dataUE.malus || 0}
<span class=ects>&nbsp;-
ECTS&nbsp;:&nbsp;${dataUE.ECTS.acquis}&nbsp;/&nbsp;${dataUE.ECTS.total}
</span>
</div>
</div>
<div class=absences>
<div>Abs&nbsp;N.J.</div><div>${dataUE.absences?.injustifie || 0}</div>
<div>Total</div><div>${dataUE.absences?.total || 0}</div>
</div> </div>
${this.ueSport(dataUE.modules)}
</div> </div>
${this.synthese(data, dataUE.ressources)} `;
${this.synthese(data, dataUE.saes)} } else {
</div> output += `
`; <div>
<div class=ue>
<h3>
${ue}${(dataUE.competence) ? " - " + dataUE.competence : ""}
</h3>
<div>
<div class=moyenne>Moyenne&nbsp;:&nbsp;${dataUE.moyenne?.value || "-"}</div>
<div class=info>
Bonus&nbsp;:&nbsp;${dataUE.bonus || 0}&nbsp;-
Malus&nbsp;:&nbsp;${dataUE.malus || 0}
<span class=ects>&nbsp;-
ECTS&nbsp;:&nbsp;${dataUE.ECTS.acquis}&nbsp;/&nbsp;${dataUE.ECTS.total}
</span>
</div>
</div>`;
/*<div class=absences>
<div>Abs&nbsp;N.J.</div><div>${dataUE.absences?.injustifie || 0}</div>
<div>Total</div><div>${dataUE.absences?.total || 0}</div>
</div>*/
output += `
</div>
${this.synthese(data, dataUE.ressources)}
${this.synthese(data, dataUE.saes)}
</div>
`;
}
}); });
this.shadow.querySelector(".synthese").innerHTML = output; this.shadow.querySelector(".synthese").innerHTML = output;
} }
@ -252,7 +280,7 @@ class releveBUT extends HTMLElement {
let output = ""; let output = "";
Object.entries(modules).forEach(([module, dataModule]) => { Object.entries(modules).forEach(([module, dataModule]) => {
let titre = data.ressources[module]?.titre || data.saes[module]?.titre; let titre = data.ressources[module]?.titre || data.saes[module]?.titre;
let url = data.ressources[module]?.url || data.saes[module]?.url; //let url = data.ressources[module]?.url || data.saes[module]?.url;
output += ` output += `
<div class=syntheseModule data-module="${module.replace(/[^a-zA-Z0-9]/g, "")}"> <div class=syntheseModule data-module="${module.replace(/[^a-zA-Z0-9]/g, "")}">
<div>${module}&nbsp;- ${titre}</div> <div>${module}&nbsp;- ${titre}</div>
@ -265,6 +293,23 @@ class releveBUT extends HTMLElement {
}) })
return output; return output;
} }
ueSport(modules) {
let output = "";
Object.values(modules).forEach((module) => {
Object.values(module.evaluations).forEach((evaluation) => {
output += `
<div class=syntheseModule>
<div>${module.titre} - ${evaluation.description}</div>
<div>
${evaluation.note.value ?? "-"}
<em>Coef.&nbsp;${evaluation.coef}</em>
</div>
</div>
`;
})
})
return output;
}
/*******************************/ /*******************************/
/* Evaluations */ /* Evaluations */
@ -305,7 +350,7 @@ class releveBUT extends HTMLElement {
evaluations.forEach((evaluation) => { evaluations.forEach((evaluation) => {
output += ` output += `
<div class=eval> <div class=eval>
<div>${this.URL(evaluation.url, evaluation.description)}</div> <div>${this.URL(evaluation.url, evaluation.description || "Évaluation")}</div>
<div> <div>
${evaluation.note.value} ${evaluation.note.value}
<em>Coef.&nbsp;${evaluation.coef}</em> <em>Coef.&nbsp;${evaluation.coef}</em>