1
0
forked from ScoDoc/ScoDoc

Merge branch 'master' of https://scodoc.org/git/lehmann/ScoDoc-Front into lehmann-master

This commit is contained in:
Emmanuel Viennet 2021-12-18 09:35:56 +01:00
commit 562888eff6
4 changed files with 581 additions and 557 deletions

View File

@ -1,245 +1,237 @@
/* Bulletin BUT, Seb. L. 2021-12-06 */ /* Bulletin BUT, Seb. L. 2021-12-06 */
/*******************/ /*******************/
/* Styles généraux */ /* Styles généraux */
/*******************/ /*******************/
:root{ .wait{
--couleurPrincipale: rgb(240,250,255); width: 60px;
--couleurFondTitresUE: rgb(206,255,235); height: 6px;
--couleurFondTitresRes: rgb(125, 170, 255); margin: auto;
--couleurFondTitresSAE: rgb(255, 190, 69); background: #424242; /* la réponse à tout */
--couleurSecondaire: #fec; animation: wait .4s infinite alternate;
--couleurIntense: #c09; }
--couleurSurlignage: rgba(232, 255, 132, 0.47); @keyframes wait{
} 100%{transform: translateY(40px) rotate(1turn);}
body{ }
font-family: arial; main{
background: #f0f0f0; --couleurPrincipale: rgb(240,250,255);
} --couleurFondTitresUE: rgb(206,255,235);
.wait{ --couleurFondTitresRes: rgb(125, 170, 255);
width: 60px; --couleurFondTitresSAE: rgb(255, 190, 69);
height: 6px; --couleurSecondaire: #fec;
margin: auto; --couleurIntense: #c09;
background: #424242; /* la réponse à tout */ --couleurSurlignage: rgba(232, 255, 132, 0.47);
animation: wait .4s infinite alternate; max-width: 1000px;
} margin: auto;
@keyframes wait{ display: none;
100%{transform: translateY(40px) rotate(1turn);} }
} .ready .wait{display: none;}
main{ .ready main{display: block;}
max-width: 1000px; h2{
margin: auto; margin: 0;
display: none; color: black;
} }
.ready .wait{display: none;} section{
.ready main{display: block;} background: #FFF;
h2{ border-radius: 16px;
margin: 0; border: 1px solid #AAA;
color: black; padding: 16px 32px;
} margin: 8px 0;
section{ }
background: #FFF; section>div:nth-child(1){
border-radius: 16px; display: flex;
border: 1px solid #AAA; justify-content: space-between;
padding: 16px 32px; align-items: center;
margin: 8px 0; gap: 8px;
} }
section>div:nth-child(1){ .CTA_Liste{
display: flex; display: flex;
justify-content: space-between; gap: 4px;
align-items: center; align-items: center;
gap: 8px; background: var(--couleurIntense);
} color: #FFF;
.CTA_Liste{ padding: 4px 8px;
display: flex; border-radius: 4px;
gap: 4px; box-shadow: 0 2px 2px rgba(0,0,0,0.26);
align-items: center; cursor: pointer;
background: var(--couleurIntense); }
color: #FFF; .CTA_Liste>svg{
padding: 4px 8px; transition: 0.2s;
border-radius: 4px; }
box-shadow: 0 2px 2px rgba(0,0,0,0.26); .CTA_Liste:hover{
cursor: pointer; outline: 2px solid #424242;
} }
.CTA_Liste>svg{ .listeOff svg{
transition: 0.2s; transform: rotate(180deg);
} }
.CTA_Liste:hover{ .listeOff .syntheseModule,
outline: 2px solid #424242; .listeOff .eval{
} display: none;
.listeOff svg{ }
transform: rotate(180deg);
} /***********************/
.listeOff .syntheseModule, /* Options d'affichage */
.listeOff .eval{ /***********************/
display: none; .hide_abs .absences,
} .hide_abs_modules .module>.absences,
.hide_coef .synthese em,
/***********************/ .hide_coef .eval>em,
/* Options d'affichage */ .hide_date_inscr .dateInscription,
/***********************/ .hide_ects .ects{
.hide_abs .absences, display: none;
.hide_abs_modules .module>.absences, }
.hide_coef .synthese em,
.hide_coef .eval>em, /************/
.hide_date_inscr .dateInscription, /* Etudiant */
.hide_ects .ects /************/
.etudiant{
{ display: flex;
display: none; align-items: center;
} gap: 16px;
border-color: var(--couleurPrincipale);
/************/ background: var(--couleurPrincipale);
/* Etudiant */ color: rgb(0, 0, 0);
/************/ }
.etudiant{ .civilite{
display: flex; font-weight: bold;
align-items: center; font-size: 130%;
gap: 16px; }
border-color: var(--couleurPrincipale);
background: var(--couleurPrincipale); /************/
color: rgb(0, 0, 0); /* Semestre */
} /************/
.civilite{ .infoSemestre{
font-weight: bold; display: flex;
font-size: 130%; flex-wrap: wrap;
} justify-content: center;
gap: 4px;
/************/ }
/* Semestre */ .infoSemestre>div{
/************/ border: 1px solid var(--couleurIntense);
.infoSemestre{ padding: 4px 8px;
display: flex; border-radius: 4px;
flex-wrap: wrap; display: grid;
justify-content: center; grid-template-columns: auto auto;
gap: 4px; column-gap: 4px;
} }
.infoSemestre>div{ .infoSemestre>div:nth-child(1){
border: 1px solid var(--couleurIntense); margin-right: auto;
padding: 4px 8px; }
border-radius: 4px; .infoSemestre>div>div:nth-child(even){
display: grid; text-align: right;
grid-template-columns: auto auto; }
column-gap: 4px; .rang{
} text-decoration: underline var(--couleurIntense);
.infoSemestre>div:nth-child(1){ }
margin-right: auto;
} .enteteSemestre{
.infoSemestre>div>div:nth-child(even){ color: black;
text-align: right; font-weight: bold;
} font-size: 20px;
.rang{ margin-bottom: 4px;
text-decoration: underline var(--couleurIntense); }
}
/***************/
.enteteSemestre{ /* Synthèse */
color: black; /***************/
font-weight: bold; .synthese>.ue{
font-size: 20px; background: var(--couleurFondTitresUE);
margin-bottom: 4px; }
} .synthese h3{
background: var(--couleurFondTitresUE);
/***************/ }
/* Synthèse */ .synthese em,
/***************/ .eval em{
.synthese>.ue{ opacity: 0.6;
background: var(--couleurFondTitresUE); width: 70px;
} display: inline-block;
.synthese h3{ }
background: var(--couleurFondTitresUE);
} /***************/
.synthese em, /* Evaluations */
.eval em{ /***************/
opacity: 0.6; .module, .ue {
width: 70px; background: var(--couleurSecondaire);
display: inline-block; color: #000;
} padding: 4px 32px;
border-radius: 4px;
/***************/ display: flex;
/* Evaluations */ gap: 16px;
/***************/ margin: 4px 0 2px 0;
.module, .ue { overflow: auto;
background: var(--couleurSecondaire); }
color: #000; h3{
padding: 4px 32px; display: flex;
border-radius: 4px; align-items: center;
display: flex; margin: 0 auto 0 0;
gap: 16px; position: sticky;
margin: 4px 0 2px 0; left: -32px;
overflow: auto; z-index: 1;
} font-size: 16px;
.sae .module, .sae .module h3 { background: var(--couleurSecondaire);
background: #d3ffff; }
} .sae .module, .sae h3{
h3{ background: var(--couleurFondTitresSAE);
display: flex; }
align-items: center;
margin: 0 auto 0 0; .moyenne{
position: sticky; font-weight: bold;
left: -32px; text-align: right;
z-index: 1; }
font-size: 16px; .info{
background: var(--couleurSecondaire); opacity: 0.9;
} }
.eval, .syntheseModule{
.moyenne{ position: relative;
font-weight: bold; display: flex;
text-align: right; justify-content: space-between;
} margin: 0 28px;
.info{ padding: 0px 4px;
opacity: 0.9; border-bottom: 1px solid #aaa;
} }
.eval, .syntheseModule{ .eval:hover, .syntheseModule:hover{
position: relative; background: var(--couleurSurlignage);
display: flex; /* color: #FFF; */
justify-content: space-between; }
margin: 0 28px; .complement{
padding: 0px 4px; pointer-events:none;
border-bottom: 1px solid #aaa; position: absolute;
} bottom: 100%;
.eval:hover, .syntheseModule:hover{ right: 0;
background: var(--couleurSurlignage); padding: 8px;
/* color: #FFF; */ border-radius: 4px;
} background: #FFF;
.complement{ color: #000;
pointer-events:none; border: 1px solid var(--couleurIntense);
position: absolute; opacity: 0;
bottom: 100%; display: grid;
right: 0; grid-template-columns: auto auto;
padding: 8px; column-gap: 4px;
border-radius: 4px; }
background: #FFF; .eval:hover .complement{
color: #000; opacity: 1;
border: 1px solid var(--couleurIntense); z-index: 1;
opacity: 0; }
display: grid; .complement>div:nth-child(even){
grid-template-columns: auto auto; text-align: right;
column-gap: 4px; }
} .complement>div:nth-child(1),
.eval:hover .complement{ .complement>div:nth-child(2){
opacity: 1; font-weight: bold;
z-index: 1; }
} .complement>div:nth-child(1),
.complement>div:nth-child(even){ .complement>div:nth-child(7){
text-align: right; margin-bottom: 8px;
} }
.complement>div:nth-child(1),
.complement>div:nth-child(2){ .absences{
font-weight: bold; display: grid;
} grid-template-columns: auto auto;
.complement>div:nth-child(1), column-gap: 4px;
.complement>div:nth-child(7){ text-align: right;
margin-bottom: 8px; border-left: 1px solid;
} padding-left: 16px;
}
.absences{ .absences>div:nth-child(1),
display: grid; .absences>div:nth-child(2){
grid-template-columns: auto auto; font-weight: bold;
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

@ -1,242 +0,0 @@
/* Il manque :
- rangs
- Synthèse : moyenne UE
- Synthèse : min, max, moy classe
- Synthèse : absences
- Eval : absences
Moi :
"show_codemodules" :true,
"show_minmax": true,
"show_minmax_eval": true,
"show_minmax_mod": false,
"show_mod_rangs": false,
"show_moypromo": true,
"show_rangs": true,
"show_ue_cap_current": true,
"show_ue_cap_details": true,
"show_ue_rangs": true,
"show_uevalid": true,
*/
/*****************************/
/* Gestionnaire d'événements */
/*****************************/
document.querySelectorAll(".CTA_Liste").forEach(e => {
e.addEventListener("click", listeOnOff)
})
function listeOnOff() {
this.parentElement.parentElement.classList.toggle("listeOff")
}
/*****************************/
/* Recupération et affichage */
/*****************************/
fetch(dataSrc)
.then(r => { return r.json() })
.then(json => showData(json))
function showData(data) {
showInformations(data);
showSemestre(data);
showSynthese(data);
showEvaluations(data);
setOptions(data.options);
document.body.classList.add("ready");
}
/********************************/
/* Informations sur l'étudiant */
/********************************/
function showInformations(data) {
document.querySelector(".studentPic").src = data.etudiant.photo_url || "default_Student.svg";
let output = `
<div class=info_etudiant>
<div class=civilite>
${civilite(data.etudiant.civilite)}
${data.etudiant.nom}
${data.etudiant.prenom}`;
if (data.etudiant.date_naissance) {
output += `${(data.etudiant.civilite == "F") ? "e" : ""} le ${ISOToDate(data.etudiant.date_naissance)}`;
}
output += `
</div>
<div class=numerosEtudiant>
Numéro étudiant : ${data.etudiant.code_nip}
Code INE : ${data.etudiant.code_ine}
</div>
<div>${data.formation.titre}</div>
</div>
`;
document.querySelector(".infoEtudiant").innerHTML = output;
}
/*******************************/
/* Information sur le semestre */
/*******************************/
function showSemestre(data) {
document.querySelector("h2").innerHTML += data.semestre.numero;
document.querySelector(".dateInscription").innerHTML += ISOToDate(data.semestre.inscription);
let output = `
<div>
<div class=enteteSemestre>Moyenne</div><div class=enteteSemestre>${data.semestre.notes.value}</div>
<div class=rang>Rang :</div><div class=rang>${data.semestre.rang.value} / ${data.semestre.rang.total}</div>
<div>Max. promo. :</div><div>${data.semestre.notes.max}</div>
<div>Moy. promo. :</div><div>${data.semestre.notes.moy}</div>
<div>Min. promo. :</div><div>${data.semestre.notes.min}</div>
</div>
${data.semestre.groupes.map(groupe => {
return `
<div>
<div class=enteteSemestre>Groupe</div><div class=enteteSemestre>${groupe.nom}</div>
<div class=rang>Rang :</div><div class=rang>${groupe.rang.value} / ${groupe.rang.total}</div>
<div>Max. groupe :</div><div>${groupe.notes.max}</div>
<div>Moy. groupe :</div><div>${groupe.notes.min}</div>
<div>Min. groupe :</div><div>${groupe.notes.min}</div>
</div>
`;
}).join("")
}
`;
document.querySelector(".infoSemestre").innerHTML = output;
}
/*******************************/
/* Synthèse */
/*******************************/
function showSynthese(data) {
let output = ``;
Object.entries(data.ues).forEach(([ue, dataUE]) => {
output += `
<div class=ue>
<h3>
${(dataUE.competence) ? dataUE.competence + " - " : ""}${ue}
</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>
${synthese(dataUE.ressources)}
${synthese(dataUE.saes)}
`;
});
document.querySelector(".synthese").innerHTML = output;
function synthese(modules) {
let output = "";
Object.entries(modules).forEach(([module, dataModule]) => {
let titre = data.ressources[module]?.titre || data.saes[module]?.titre;
let url = data.ressources[module]?.url || data.saes[module]?.url;
output += `
<div class=syntheseModule>
<div><a href="${url}">${module}&nbsp;- ${titre}</a></div>
<div>
${dataModule.moyenne}
<em>Coef. ${dataModule.coef}</em>
</div>
</div>
`;
})
return output;
}
}
/*******************************/
/* Evaluations */
/*******************************/
function showEvaluations(data) {
document.querySelector(".evaluations").innerHTML = module(data.ressources);
document.querySelector(".sae").innerHTML += module(data.saes);
function module(module) {
let output = "";
Object.entries(module).forEach(([numero, content]) => {
output += `
<div>
<div class=module>
<h3><a href="${content.url}">${numero} - ${content.titre}</a></h3>
<div class=absences>
<div>Abs&nbsp;inj.</div><div>${content.absences?.injustifie || 0}</div>
<div>Total</div><div>${content.absences?.total || 0}</div>
</div>
</div>
${evaluation(content.evaluations)}
</div>
`;
})
return output;
}
function evaluation(evaluations) {
let output = "";
evaluations.forEach(eval => {
output += `
<div class=eval>
<div><a href="${eval.url}">${eval.description}</a></div>
<div>
${eval.note.value}
<em>Coef. ${eval.coef}</em>
</div>
<div class=complement>
<div>Coef</div><div>${eval.coef}</div>
<div>Max. promo.</div><div>${eval.note.max}</div>
<div>Moy. promo.</div><div>${eval.note.moy}</div>
<div>Min. promo.</div><div>${eval.note.min}</div>
${Object.entries(eval.poids).map(([UE, poids]) => {
return `
<div>Poids ${UE}</div>
<div>${poids}</div>
`;
}).join("")}
</div>
</div>
`;
})
return output;
}
}
/********************/
/* Options */
/********************/
function setOptions(options) {
Object.entries(options).forEach(([option, value]) => {
if (value === false) {
document.body.classList.add(option.replace("show", "hide"))
}
})
}
/********************/
/* Fonctions d'aide */
/********************/
function civilite(txt) {
switch (txt) {
case "M": return "M.";
case "F": return "Mme";
default: return "";
}
}
function ISOToDate(ISO) {
return ISO.split("-").reverse().join("/");
}

329
app/static/js/releve-but.js Normal file
View File

@ -0,0 +1,329 @@
class releveBUT extends HTMLElement {
constructor(){
super();
this.shadow = this.attachShadow({mode: 'open'});
/* Config par defaut */
this.config = {
showURL: true
};
/* Template du module */
this.shadow.innerHTML = this.template();
/* Style du module */
const styles = document.createElement('link');
styles.setAttribute('rel', 'stylesheet');
styles.setAttribute('href', '/ScoDoc/static/css/releve-but.css');
this.shadow.appendChild(styles);
this.shadow.querySelectorAll(".CTA_Liste").forEach(e => {
e.addEventListener("click", this.listeOnOff)
})
}
listeOnOff() {
this.parentElement.parentElement.classList.toggle("listeOff")
}
set setConfig(config){
this.config.showURL = config.showURL ?? this.config.showURL;
}
set showData(data) {
this.showInformations(data);
this.showSemestre(data);
this.showSynthese(data);
this.showEvaluations(data);
this.setOptions(data.options);
this.shadow.children[0].classList.add("ready");
}
template(){
return `
<div>
<div class="wait"></div>
<main class="releve">
<!--------------------------->
<!-- Info. étudiant -->
<!--------------------------->
<section class=etudiant>
<img class=studentPic src="" alt="Photo de l'étudiant" width=100 height=120>
<div class=infoEtudiant></div>
</section>
<!--------------------------->
<!-- Semestre -->
<!--------------------------->
<section>
<h2>Semestre </h2>
<div class=dateInscription>Inscrit le </div>
<em>Les moyennes servent à situer l'étudiant dans la promotion et ne correspondent pas à des validations de
compétences ou d'UE.</em>
<div class=infoSemestre></div>
</section>
<!--------------------------->
<!-- Synthèse -->
<!--------------------------->
<section>
<div>
<div>
<h2>Synthèse</h2>
<em>La moyenne des ressources dans une UE dépend des poids donnés aux évaluations.</em>
</div>
<div class=CTA_Liste>
Liste <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none"
stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 15l-6-6-6 6" />
</svg>
</div>
</div>
<div class=synthese></div>
</section>
<!--------------------------->
<!-- Evaluations -->
<!--------------------------->
<section>
<div>
<h2>Ressources</h2>
<div class=CTA_Liste>
Liste <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none"
stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 15l-6-6-6 6" />
</svg>
</div>
</div>
<div class=evaluations></div>
</section>
<section>
<div>
<h2>SAÉ</h2>
<div class=CTA_Liste>
Liste <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none"
stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 15l-6-6-6 6" />
</svg>
</div>
</div>
<div class=sae></div>
</section>
</main>
</div>`;
}
/********************************/
/* Informations sur l'étudiant */
/********************************/
showInformations(data) {
this.shadow.querySelector(".studentPic").src = data.etudiant.photo_url || "default_Student.svg";
let output = `
<div class=info_etudiant>
<div class=civilite>
${this.civilite(data.etudiant.civilite)}
${data.etudiant.nom}
${data.etudiant.prenom}`;
if (data.etudiant.date_naissance) {
output += `${(data.etudiant.civilite == "F") ? "e" : ""} le ${this.ISOToDate(data.etudiant.date_naissance)}`;
}
output += `
</div>
<div class=numerosEtudiant>
Numéro étudiant : ${data.etudiant.code_nip} -
Code INE : ${data.etudiant.code_ine}
</div>
<div>${data.formation.titre}</div>
</div>
`;
this.shadow.querySelector(".infoEtudiant").innerHTML = output;
}
/*******************************/
/* Information sur le semestre */
/*******************************/
showSemestre(data) {
this.shadow.querySelector("h2").innerHTML += data.semestre.numero;
this.shadow.querySelector(".dateInscription").innerHTML += this.ISOToDate(data.semestre.inscription);
let output = `
<div>
<div class=enteteSemestre>Moyenne</div><div class=enteteSemestre>${data.semestre.notes.value}</div>
<div class=rang>Rang :</div><div class=rang>${data.semestre.rang.value} / ${data.semestre.rang.total}</div>
<div>Max. promo. :</div><div>${data.semestre.notes.max}</div>
<div>Moy. promo. :</div><div>${data.semestre.notes.moy}</div>
<div>Min. promo. :</div><div>${data.semestre.notes.min}</div>
</div>
${data.semestre.groupes.map(groupe => {
return `
<div>
<div class=enteteSemestre>Groupe</div><div class=enteteSemestre>${groupe.nom}</div>
<div class=rang>Rang :</div><div class=rang>${groupe.rang.value} / ${groupe.rang.total}</div>
<div>Max. groupe :</div><div>${groupe.notes.max}</div>
<div>Moy. groupe :</div><div>${groupe.notes.min}</div>
<div>Min. groupe :</div><div>${groupe.notes.min}</div>
</div>
`;
}).join("")
}
`;
this.shadow.querySelector(".infoSemestre").innerHTML = output;
}
/*******************************/
/* Synthèse */
/*******************************/
showSynthese(data) {
let output = ``;
Object.entries(data.ues).forEach(([ue, dataUE]) => {
output += `
<div class=ue>
<h3>
${(dataUE.competence) ? dataUE.competence + " - " : ""}${ue}
</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.synthese(data, dataUE.ressources)}
${this.synthese(data, dataUE.saes)}
`;
});
this.shadow.querySelector(".synthese").innerHTML = output;
}
synthese(data, modules) {
let output = "";
Object.entries(modules).forEach(([module, dataModule]) => {
let titre = data.ressources[module]?.titre || data.saes[module]?.titre;
let url = data.ressources[module]?.url || data.saes[module]?.url;
output += `
<div class=syntheseModule>
<div>${this.URL(url, `${module}&nbsp;- ${titre}`)}</div>
<div>
${dataModule.moyenne}
<em>Coef. ${dataModule.coef}</em>
</div>
</div>
`;
})
return output;
}
/*******************************/
/* Evaluations */
/*******************************/
showEvaluations(data) {
this.shadow.querySelector(".evaluations").innerHTML = this.module(data.ressources);
this.shadow.querySelector(".sae").innerHTML += this.module(data.saes);
}
module(module) {
let output = "";
Object.entries(module).forEach(([numero, content]) => {
output += `
<div>
<div class=module>
<h3>${this.URL(content.url, `${numero} - ${content.titre}`)}</h3>
<div>
<div class=moyenne>Moyenne&nbsp;indicative&nbsp;:&nbsp;${content.moyenne.value}</div>
<div class=info>
Classe&nbsp;:&nbsp;${content.moyenne.moy}&nbsp;-
Max&nbsp;:&nbsp;${content.moyenne.max}&nbsp;-
Min&nbsp;:&nbsp;${content.moyenne.min}
</div>
</div>
<div class=absences>
<div>Abs&nbsp;inj.</div><div>${content.absences?.injustifie || 0}</div>
<div>Total</div><div>${content.absences?.total || 0}</div>
</div>
</div>
${this.evaluation(content.evaluations)}
</div>
`;
})
return output;
}
evaluation(evaluations) {
let output = "";
evaluations.forEach((evaluation) => {
output += `
<div class=eval>
<div>${this.URL(evaluation.url, evaluation.description)}</div>
<div>
${evaluation.note.value}
<em>Coef. ${evaluation.coef}</em>
</div>
<div class=complement>
<div>Coef</div><div>${evaluation.coef}</div>
<div>Max. promo.</div><div>${evaluation.note.max}</div>
<div>Moy. promo.</div><div>${evaluation.note.moy}</div>
<div>Min. promo.</div><div>${evaluation.note.min}</div>
${Object.entries(evaluation.poids).map(([UE, poids]) => {
return `
<div>Poids ${UE}</div>
<div>${poids}</div>
`;
}).join("")}
</div>
</div>
`;
})
return output;
}
/********************/
/* Options */
/********************/
setOptions(options) {
Object.entries(options).forEach(([option, value]) => {
if (value === false) {
document.body.classList.add(option.replace("show", "hide"))
}
})
}
/********************/
/* Fonctions d'aide */
/********************/
URL(href, content){
if(this.config.showURL){
return `<a href=${href}>${content}</a>`;
} else {
return content;
}
}
civilite(txt) {
switch (txt) {
case "M": return "M.";
case "F": return "Mme";
default: return "";
}
}
ISOToDate(ISO) {
return ISO.split("-").reverse().join("/");
}
}
customElements.define('releve-but', releveBUT);

View File

@ -2,87 +2,32 @@
{% block styles %} {% block styles %}
{{super()}} {{super()}}
<link rel="stylesheet" href="/ScoDoc/static/css/bulletin-but.css">
{% endblock %} {% endblock %}
{% block app_content %} {% block app_content %}
<div class="wait"></div> <releve-but></releve-but>
<main class="releve">
<!--------------------------->
<!-- Info. étudiant -->
<!--------------------------->
<section class=etudiant>
<img class=studentPic src="" alt="Photo de l'étudiant" width=100 height=120>
<div class=infoEtudiant></div>
</section>
<!--------------------------->
<!-- Semestre -->
<!--------------------------->
<section>
<h2>Semestre </h2>
<div class=dateInscription>Inscrit le </div>
<em>Les moyennes servent à situer l'étudiant dans la promotion et ne correspondent pas à des validations de
compétences ou d'UE.</em>
<div class=infoSemestre></div>
</section>
<!--------------------------->
<!-- Synthèse -->
<!--------------------------->
<section>
<div>
<div>
<h2>Synthèse</h2>
<em>La moyenne des ressources dans une UE dépend des poids donnés aux évaluations.</em>
</div>
<div class=CTA_Liste>
Liste <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none"
stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 15l-6-6-6 6" />
</svg>
</div>
</div>
<div class=synthese></div>
</section>
<!--------------------------->
<!-- Evaluations -->
<!--------------------------->
<section>
<div>
<h2>Ressources</h2>
<div class=CTA_Liste>
Liste <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none"
stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 15l-6-6-6 6" />
</svg>
</div>
</div>
<div class=evaluations></div>
</section>
<section>
<div>
<h2>SAÉ</h2>
<div class=CTA_Liste>
Liste <svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 24 24" fill="none"
stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 15l-6-6-6 6" />
</svg>
</div>
</div>
<div class=sae></div>
</section>
</main>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src="/ScoDoc/static/js/releve-but.js"></script>
<script> <script>
let dataSrc = "{{bul_url|safe}}"; let dataSrc = "{{bul_url|safe}}";
fetch(dataSrc)
.then(r => { return r.json() })
.then(json => {
let releve = document.querySelector("releve-but");
releve.showData = json;
// Syle custome à ajouter
releve.shadowRoot.innerHTML += `
<style>
.module>div, .dateInscription{
display: none;
}
</style>`;
})
</script> </script>
<script src="/ScoDoc/static/js/bulletin-but.js"></script>
{% endblock %} {% endblock %}