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

@ -1,298 +1,322 @@
/* Bulletin BUT, Seb. L. 2021-12-06 */ /* Bulletin BUT, Seb. L. 2021-12-06 */
/*******************/ /*******************/
/* Styles généraux */ /* Styles généraux */
/*******************/ /*******************/
.wait{ .wait{
width: 60px; width: 60px;
height: 6px; height: 6px;
margin: auto; margin: auto;
background: #424242; /* la réponse à tout */ background: #424242; /* la réponse à tout */
animation: wait .4s infinite alternate; animation: wait .4s infinite alternate;
} }
@keyframes wait{ @keyframes wait{
100%{transform: translateY(40px) rotate(1turn);} 100%{transform: translateY(40px) rotate(1turn);}
} }
main{ main{
--couleurPrincipale: rgb(240,250,255); --couleurPrincipale: rgb(240,250,255);
--couleurFondTitresUE: rgb(206,255,235); --couleurFondTitresUE: rgb(206,255,235);
--couleurFondTitresRes: rgb(125, 170, 255); --couleurFondTitresRes: rgb(125, 170, 255);
--couleurFondTitresSAE: rgb(211, 255, 255); --couleurFondTitresSAE: rgb(211, 255, 255);
--couleurSecondaire: #fec; --couleurSecondaire: #fec;
--couleurIntense: #c09; --couleurIntense: #c09;
--couleurSurlignage: rgba(232, 255, 132, 0.47); --couleurSurlignage: rgba(232, 255, 132, 0.47);
max-width: 1000px; max-width: 1000px;
margin: auto; margin: auto;
display: none; display: none;
} }
.ready .wait{display: none;} .ready .wait{display: none;}
.ready main{display: block;} .ready main{display: block;}
h2{ h2{
margin: 0; margin: 0;
color: black; color: black;
} }
section{ section{
background: #FFF; background: #FFF;
border-radius: 16px; border-radius: 16px;
border: 1px solid #AAA; border: 1px solid #AAA;
padding: 16px 32px; padding: 16px 32px;
margin: 8px 0; margin: 8px 0;
} }
section>div:nth-child(1){ section>div:nth-child(1){
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
} }
.CTA_Liste{ .CTA_Liste{
display: flex; display: flex;
gap: 4px; gap: 4px;
align-items: center; align-items: center;
background: var(--couleurIntense); background: var(--couleurIntense);
color: #FFF; color: #FFF;
padding: 4px 8px; padding: 4px 8px;
border-radius: 4px; border-radius: 4px;
box-shadow: 0 2px 2px rgba(0,0,0,0.26); box-shadow: 0 2px 2px rgba(0,0,0,0.26);
cursor: pointer; cursor: pointer;
} }
.CTA_Liste>svg{ .CTA_Liste>svg{
transition: 0.2s; transition: 0.2s;
} }
.CTA_Liste:hover{ .CTA_Liste:hover{
outline: 2px solid #424242; outline: 2px solid #424242;
} }
.listeOff svg{ .listeOff svg{
transform: rotate(180deg); transform: rotate(180deg);
} }
.listeOff .syntheseModule, .listeOff .syntheseModule,
.listeOff .eval{ .listeOff .eval{
display: none; display: none;
} }
.moduleOnOff>.syntheseModule, .moduleOnOff>.syntheseModule,
.moduleOnOff>.eval{ .moduleOnOff>.eval{
display: none; display: none;
} }
.listeOff .moduleOnOff>.syntheseModule, .listeOff .moduleOnOff>.syntheseModule,
.listeOff .moduleOnOff>.eval{ .listeOff .moduleOnOff>.eval{
display: flex !important; display: flex !important;
} }
.listeOff .ue::before, .listeOff .ue::before,
.listeOff .module::before, .listeOff .module::before,
.moduleOnOff .ue::before, .moduleOnOff .ue::before,
.moduleOnOff .module::before{ .moduleOnOff .module::before{
transform: rotate(0); transform: rotate(0);
} }
.listeOff .moduleOnOff .ue::before, .listeOff .moduleOnOff .ue::before,
.listeOff .moduleOnOff .module::before{ .listeOff .moduleOnOff .module::before{
transform: rotate(180deg) !important; transform: rotate(180deg) !important;
} }
/***********************/ /***********************/
/* Options d'affichage */ /* Options d'affichage */
/***********************/ /***********************/
.hide_abs .absences, .hide_abs .absencesRecap,
.hide_abs_modules .module>.absences, /*.hide_abs .absences,*/
.hide_coef .synthese em, .hide_abs_modules .module>.absences,
.hide_coef .eval>em, .hide_coef .synthese em,
.hide_date_inscr .dateInscription, .hide_coef .eval>em,
.hide_ects .ects{ .hide_date_inscr .dateInscription,
display: none; .hide_ects .ects{
} display: none;
}
.module>.absences,
.module .moyenne, /*.module>.absences,*/
.module .info{ .module .moyenne,
display: none; .module .info{
} display: none;
}
/************/
/* Etudiant */ /************/
/************/ /* Etudiant */
.info_etudiant{ /************/
color: #000; .info_etudiant{
text-decoration: none; color: #000;
} text-decoration: none;
.etudiant{ }
display: flex; .etudiant{
align-items: center; display: flex;
gap: 16px; align-items: center;
border-color: var(--couleurPrincipale); gap: 16px;
background: var(--couleurPrincipale); border-color: var(--couleurPrincipale);
color: rgb(0, 0, 0); background: var(--couleurPrincipale);
} color: rgb(0, 0, 0);
.civilite{ }
font-weight: bold; .civilite{
font-size: 130%; font-weight: bold;
} font-size: 130%;
}
/************/
/* Semestre */ /************/
/************/ /* Semestre */
.flex{ /************/
display: flex; .flex{
gap: 16px; display: flex;
} flex-wrap: wrap;
.infoSemestre{ gap: 8px;
display: flex; margin-top: 8px;
flex-wrap: wrap; }
justify-content: center; .infoSemestre{
gap: 4px; display: flex;
flex: none; flex-wrap: wrap;
} align-items: flex-start;
.infoSemestre>div{ gap: 4px;
border: 1px solid var(--couleurIntense); }
padding: 4px 8px; .infoSemestre>div{
border-radius: 4px; border: 1px solid var(--couleurIntense);
display: grid; padding: 4px 8px;
grid-template-columns: auto auto; border-radius: 4px;
column-gap: 4px; display: grid;
} grid-template-columns: auto auto;
.infoSemestre>div:nth-child(1){ column-gap: 4px;
margin-right: auto; flex: none;
} }
.infoSemestre>div>div:nth-child(even){ .infoSemestre>div:nth-child(1){
text-align: right; margin-right: auto;
} }
.rang{ .infoSemestre>div>div:nth-child(even){
text-decoration: underline var(--couleurIntense); text-align: right;
} }
.decision{ .rang{
margin: 5px 0; text-decoration: underline var(--couleurIntense);
font-weight: bold; }
font-size: 20px; .decision{
text-decoration: underline var(--couleurIntense); margin: 5px 0;
} font-weight: bold;
.enteteSemestre{ font-size: 20px;
color: black; text-decoration: underline var(--couleurIntense);
font-weight: bold; }
font-size: 20px; .enteteSemestre{
margin-bottom: 4px; color: black;
} font-weight: bold;
font-size: 20px;
/***************/ margin-bottom: 4px;
/* Synthèse */ }
/***************/ /***************/
.synthese .ue, /* Zone custom */
.synthese h3{ /***************/
background: var(--couleurFondTitresUE); .custom:empty{
} display: none;
.synthese em, }
.eval em{
opacity: 0.6; /***************/
min-width: 80px; /* Synthèse */
display: inline-block; /***************/
} .synthese .ue,
.synthese h3{
/***************/ background: var(--couleurFondTitresUE);
/* Evaluations */ }
/***************/ .synthese em,
.module, .ue { .eval em{
background: var(--couleurSecondaire); opacity: 0.6;
color: #000; min-width: 80px;
padding: 4px 32px; display: inline-block;
border-radius: 4px; }
display: flex; .ueBonus,
gap: 16px; .ueBonus h3{
margin: 4px 0 2px 0; background: var(--couleurFondTitresSAE) !important;
overflow-x: auto; color: #000 !important;
overflow-y: hidden; }
cursor: pointer;
position: relative; /***************/
} /* Evaluations */
.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>"); .evaluations>div,
width: 26px; .sae>div{
height: 26px; scroll-margin-top: 60px;
position: absolute; }
bottom: 0; .module, .ue {
left: 50%; background: var(--couleurSecondaire);
margin-left: -13px; color: #000;
transform: rotate(180deg); padding: 4px 32px;
transition: 0.2s; border-radius: 4px;
} display: flex;
h3{ gap: 16px;
display: flex; margin: 4px 0 2px 0;
align-items: center; overflow-x: auto;
margin: 0 auto 0 0; overflow-y: hidden;
position: sticky; cursor: pointer;
left: -32px; position: relative;
z-index: 1; }
font-size: 16px; .module::before, .ue::before {
background: var(--couleurSecondaire); 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;
.sae .module, .sae h3{ height: 26px;
background: var(--couleurFondTitresSAE); position: absolute;
} bottom: 0;
left: calc(50% - 13px);
.moyenne{ transform: rotate(180deg);
font-weight: bold; transition: 0.2s;
text-align: right; }
} @media screen and (max-width: 1000px) {
.info{ /* Placer le chevron à gauche au lieu du milieu */
opacity: 0.9; .module::before, .ue::before {
} left: 2px;
.syntheseModule{ bottom: calc(50% - 13px);
cursor: pointer; }
} }
.eval, .syntheseModule{ h3{
position: relative; display: flex;
display: flex; align-items: center;
justify-content: space-between; margin: 0 auto 0 0;
margin: 0 0 0 28px; position: sticky;
padding: 0px 4px; left: -32px;
border-bottom: 1px solid #aaa; z-index: 1;
} font-size: 16px;
.eval>div, .syntheseModule>div{ background: var(--couleurSecondaire);
display: flex; }
gap: 4px; .sae .module, .sae h3{
} background: var(--couleurFondTitresSAE);
}
.eval:hover, .syntheseModule:hover{
background: var(--couleurSurlignage); .moyenne{
/* color: #FFF; */ font-weight: bold;
} text-align: right;
.complement{ }
pointer-events:none; .info{
position: absolute; opacity: 0.9;
bottom: 100%; }
right: 0; .syntheseModule{
padding: 8px; cursor: pointer;
border-radius: 4px; }
background: #FFF; .eval, .syntheseModule{
color: #000; position: relative;
border: 1px solid var(--couleurIntense); display: flex;
opacity: 0; justify-content: space-between;
display: grid !important; margin: 0 0 0 28px;
grid-template-columns: auto auto; padding: 0px 4px;
gap: 0 !important; border-bottom: 1px solid #aaa;
column-gap: 4px !important; }
} .eval>div, .syntheseModule>div{
.eval:hover .complement{ display: flex;
opacity: 1; gap: 4px;
z-index: 1; }
}
.complement>div:nth-child(even){ .eval:hover, .syntheseModule:hover{
text-align: right; background: var(--couleurSurlignage);
} /* color: #FFF; */
.complement>div:nth-child(1), }
.complement>div:nth-child(2){ .complement{
font-weight: bold; pointer-events:none;
} position: absolute;
.complement>div:nth-child(1), bottom: 100%;
.complement>div:nth-child(7){ right: 0;
margin-bottom: 8px; padding: 8px;
} border-radius: 4px;
background: #FFF;
.absences{ color: #000;
display: grid; border: 1px solid var(--couleurIntense);
grid-template-columns: auto auto; opacity: 0;
column-gap: 4px; display: grid !important;
text-align: right; grid-template-columns: auto auto;
border-left: 1px solid; gap: 0 !important;
padding-left: 16px; column-gap: 4px !important;
} }
.absences>div:nth-child(1), .eval:hover .complement{
.absences>div:nth-child(2){ opacity: 1;
font-weight: bold; z-index: 1;
} }
.complement>div:nth-child(even){
text-align: right;
}
.complement>div:nth-child(1),
.complement>div:nth-child(2){
font-weight: bold;
}
.complement>div:nth-child(1),
.complement>div:nth-child(7){
margin-bottom: 8px;
}
/*.absences{
display: grid;
grid-template-columns: auto auto;
column-gap: 4px;
text-align: right;
border-left: 1px solid;
padding-left: 16px;
}
.absences>div:nth-child(1),
.absences>div:nth-child(2){
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>
@ -363,4 +408,4 @@ class releveBUT extends HTMLElement {
} }
} }
customElements.define('releve-but', releveBUT); customElements.define('releve-but', releveBUT);