Merge branch 'lehmann-master'

This commit is contained in:
Emmanuel Viennet 2021-12-21 15:13:49 +01:00
commit 2ab7cef447
4 changed files with 78 additions and 52 deletions

View File

@ -76,8 +76,8 @@ class Identite(db.Model):
d = { d = {
"civilite": self.civilite, "civilite": self.civilite,
"code_ine": self.code_nip, "code_ine": self.code_ine,
"code_nip": self.code_ine, "code_nip": self.code_nip,
"date_naissance": self.date_naissance.isoformat() "date_naissance": self.date_naissance.isoformat()
if self.date_naissance if self.date_naissance
else None, else None,

View File

@ -68,6 +68,15 @@ section>div:nth-child(1){
display: none; display: none;
} }
.moduleOnOff>.syntheseModule,
.moduleOnOff>.eval{
display: none;
}
.listeOff .moduleOnOff>.syntheseModule,
.listeOff .moduleOnOff>.eval{
display: flex !important;
}
/***********************/ /***********************/
/* Options d'affichage */ /* Options d'affichage */
/***********************/ /***********************/
@ -80,6 +89,12 @@ section>div:nth-child(1){
display: none; display: none;
} }
.module>.absences,
.module .moyenne,
.module .info{
display: none;
}
/************/ /************/
/* Etudiant */ /* Etudiant */
/************/ /************/
@ -133,16 +148,14 @@ section>div:nth-child(1){
/***************/ /***************/
/* Synthèse */ /* Synthèse */
/***************/ /***************/
.synthese>.ue{ .synthese .ue,
background: var(--couleurFondTitresUE);
}
.synthese h3{ .synthese h3{
background: var(--couleurFondTitresUE); background: var(--couleurFondTitresUE);
} }
.synthese em, .synthese em,
.eval em{ .eval em{
opacity: 0.6; opacity: 0.6;
width: 70px; min-width: 80px;
display: inline-block; display: inline-block;
} }
@ -158,6 +171,7 @@ section>div:nth-child(1){
gap: 16px; gap: 16px;
margin: 4px 0 2px 0; margin: 4px 0 2px 0;
overflow: auto; overflow: auto;
cursor: pointer;
} }
h3{ h3{
display: flex; display: flex;
@ -184,10 +198,15 @@ h3{
position: relative; position: relative;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin: 0 28px; margin: 0 0 0 28px;
padding: 0px 4px; padding: 0px 4px;
border-bottom: 1px solid #aaa; border-bottom: 1px solid #aaa;
} }
.eval>div, .syntheseModule>div{
display: flex;
gap: 4px;
}
.eval:hover, .syntheseModule:hover{ .eval:hover, .syntheseModule:hover{
background: var(--couleurSurlignage); background: var(--couleurSurlignage);
/* color: #FFF; */ /* color: #FFF; */
@ -203,9 +222,10 @@ h3{
color: #000; color: #000;
border: 1px solid var(--couleurIntense); border: 1px solid var(--couleurIntense);
opacity: 0; opacity: 0;
display: grid; display: grid !important;
grid-template-columns: auto auto; grid-template-columns: auto auto;
column-gap: 4px; gap: 0 !important;
column-gap: 4px !important;
} }
.eval:hover .complement{ .eval:hover .complement{
opacity: 1; opacity: 1;

View File

@ -1,3 +1,4 @@
/* Module par Seb. L. */
class releveBUT extends HTMLElement { class releveBUT extends HTMLElement {
constructor(){ constructor(){
super(); super();
@ -16,15 +17,15 @@ class releveBUT extends HTMLElement {
styles.setAttribute('rel', 'stylesheet'); styles.setAttribute('rel', 'stylesheet');
styles.setAttribute('href', '/ScoDoc/static/css/releve-but.css'); styles.setAttribute('href', '/ScoDoc/static/css/releve-but.css');
this.shadow.appendChild(styles); this.shadow.appendChild(styles);
this.shadow.querySelectorAll(".CTA_Liste").forEach(e => {
e.addEventListener("click", this.listeOnOff)
})
} }
listeOnOff() { listeOnOff() {
this.parentElement.parentElement.classList.toggle("listeOff") this.parentElement.parentElement.classList.toggle("listeOff");
this.parentElement.parentElement.querySelectorAll(".moduleOnOff").forEach(e=>{
e.classList.remove("moduleOnOff")
})
}
moduleOnOff(){
this.parentElement.classList.toggle("moduleOnOff");
} }
set setConfig(config){ set setConfig(config){
@ -39,10 +40,16 @@ class releveBUT extends HTMLElement {
this.setOptions(data.options); this.setOptions(data.options);
this.shadow.querySelectorAll(".CTA_Liste").forEach(e => {
e.addEventListener("click", this.listeOnOff)
})
this.shadow.querySelectorAll(".ue, .module").forEach(e => {
e.addEventListener("click", this.moduleOnOff)
})
this.shadow.children[0].classList.add("ready"); this.shadow.children[0].classList.add("ready");
} }
template(){ template(){
return ` return `
<div> <div>
@ -133,7 +140,7 @@ class releveBUT extends HTMLElement {
${data.etudiant.prenom}`; ${data.etudiant.prenom}`;
if (data.etudiant.date_naissance) { if (data.etudiant.date_naissance) {
output += ` ${(data.etudiant.civilite == "F") ? "e" : ""} le ${this.ISOToDate(data.etudiant.date_naissance)}`; output += ` <div class=dateNaissance>${(data.etudiant.civilite == "F") ? "e" : ""} le ${this.ISOToDate(data.etudiant.date_naissance)}</div>`;
} }
output += ` output += `
@ -186,27 +193,29 @@ class releveBUT extends HTMLElement {
let output = ``; let output = ``;
Object.entries(data.ues).forEach(([ue, dataUE]) => { Object.entries(data.ues).forEach(([ue, dataUE]) => {
output += ` output += `
<div class=ue> <div>
<h3> <div class=ue>
${(dataUE.competence) ? dataUE.competence + " - " : ""}${ue} <h3>
</h3> ${(dataUE.competence) ? dataUE.competence + " - " : ""}${ue}
<div> </h3>
<div class=moyenne>Moyenne&nbsp;:&nbsp;${dataUE.moyenne?.value || "-"}</div> <div>
<div class=info> <div class=moyenne>Moyenne&nbsp;:&nbsp;${dataUE.moyenne?.value || "-"}</div>
Bonus&nbsp;:&nbsp;${dataUE.bonus || 0}&nbsp;- <div class=info>
Malus&nbsp;:&nbsp;${dataUE.malus || 0} Bonus&nbsp;:&nbsp;${dataUE.bonus || 0}&nbsp;-
<span class=ects>&nbsp;- Malus&nbsp;:&nbsp;${dataUE.malus || 0}
ECTS&nbsp;:&nbsp;${dataUE.ECTS.acquis}&nbsp;/&nbsp;${dataUE.ECTS.total} <span class=ects>&nbsp;-
</span> 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>
</div> </div>
<div class=absences> ${this.synthese(data, dataUE.ressources)}
<div>Abs&nbsp;N.J.</div><div>${dataUE.absences?.injustifie || 0}</div> ${this.synthese(data, dataUE.saes)}
<div>Total</div><div>${dataUE.absences?.total || 0}</div>
</div>
</div> </div>
${this.synthese(data, dataUE.ressources)}
${this.synthese(data, dataUE.saes)}
`; `;
}); });
this.shadow.querySelector(".synthese").innerHTML = output; this.shadow.querySelector(".synthese").innerHTML = output;
@ -221,7 +230,7 @@ class releveBUT extends HTMLElement {
<div>${this.URL(url, `${module}&nbsp;- ${titre}`)}</div> <div>${this.URL(url, `${module}&nbsp;- ${titre}`)}</div>
<div> <div>
${dataModule.moyenne} ${dataModule.moyenne}
<em>Coef. ${dataModule.coef}</em> <em>Coef.&nbsp;${dataModule.coef}</em>
</div> </div>
</div> </div>
`; `;
@ -271,7 +280,7 @@ class releveBUT extends HTMLElement {
<div>${this.URL(evaluation.url, evaluation.description)}</div> <div>${this.URL(evaluation.url, evaluation.description)}</div>
<div> <div>
${evaluation.note.value} ${evaluation.note.value}
<em>Coef. ${evaluation.coef}</em> <em>Coef.&nbsp;${evaluation.coef}</em>
</div> </div>
<div class=complement> <div class=complement>
<div>Coef</div><div>${evaluation.coef}</div> <div>Coef</div><div>${evaluation.coef}</div>

View File

@ -7,27 +7,24 @@
{% block app_content %} {% block app_content %}
<releve-but></releve-but> <releve-but></releve-but>
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="/ScoDoc/static/js/releve-but.js"></script> <script src="/ScoDoc/static/js/releve-but.js"></script>
<script> <script>
let dataSrc = "{{bul_url|safe}}"; let dataSrc = "{{bul_url|safe}}";
fetch(dataSrc) fetch(dataSrc)
.then(r => { return r.json() }) .then(r => { return r.json() })
.then(json => { .then(json => {
let releve = document.querySelector("releve-but"); let releve = document.querySelector("releve-but");
releve.showData = json; releve.showData = json;
// Syle custome à ajouter // Syle custom à ajouter
releve.shadowRoot.innerHTML += ` let style = document.createElement("style");
<style> style.textContent = `
.module>div, .dateInscription{ .module>div,
display: none; .dateInscription,
} .numerosEtudiant,
</style>`; .dateNaissance{
display: none;
}`;
releve.shadowRoot.appendChild(style);
}) })
</script> </script>
{% endblock %} {% endblock %}