From f263354f88c61a4c5b1d2b3c001088b776ed0c65 Mon Sep 17 00:00:00 2001 From: lehmann Date: Mon, 20 Dec 2021 15:39:43 +0100 Subject: [PATCH 1/4] Fermeture tickets #203 #204 #205 #217 --- app/models/etudiants.py | 4 +- app/static/css/releve-but.css | 34 +++++++++++++---- app/static/js/releve-but.js | 67 +++++++++++++++++++-------------- app/templates/but/bulletin.html | 26 ++++++------- 4 files changed, 79 insertions(+), 52 deletions(-) diff --git a/app/models/etudiants.py b/app/models/etudiants.py index cddac171c..7c4f463af 100644 --- a/app/models/etudiants.py +++ b/app/models/etudiants.py @@ -75,8 +75,8 @@ class Identite(db.Model): """Infos exportées dans les bulletins""" return { "civilite": self.civilite, - "code_ine": self.code_nip, - "code_nip": self.code_ine, + "code_ine": self.code_ine, + "code_nip": self.code_nip, "date_naissance": self.date_naissance.isoformat() if self.date_naissance else None, diff --git a/app/static/css/releve-but.css b/app/static/css/releve-but.css index 293dfbd8b..2f9766ded 100644 --- a/app/static/css/releve-but.css +++ b/app/static/css/releve-but.css @@ -68,6 +68,15 @@ section>div:nth-child(1){ display: none; } +.moduleOnOff>.syntheseModule, +.moduleOnOff>.eval{ + display: none; +} +.listeOff .moduleOnOff>.syntheseModule, +.listeOff .moduleOnOff>.eval{ + display: flex !important; +} + /***********************/ /* Options d'affichage */ /***********************/ @@ -80,6 +89,12 @@ section>div:nth-child(1){ display: none; } +.module>.absences, +.module .moyenne, +.module .info{ + display: none; +} + /************/ /* Etudiant */ /************/ @@ -133,16 +148,14 @@ section>div:nth-child(1){ /***************/ /* Synthèse */ /***************/ -.synthese>.ue{ - background: var(--couleurFondTitresUE); -} +.synthese .ue, .synthese h3{ background: var(--couleurFondTitresUE); } .synthese em, .eval em{ opacity: 0.6; - width: 70px; + min-width: 80px; display: inline-block; } @@ -158,6 +171,7 @@ section>div:nth-child(1){ gap: 16px; margin: 4px 0 2px 0; overflow: auto; + cursor: pointer; } h3{ display: flex; @@ -184,10 +198,15 @@ h3{ position: relative; display: flex; justify-content: space-between; - margin: 0 28px; + margin: 0 0 0 28px; padding: 0px 4px; border-bottom: 1px solid #aaa; } +.eval>div, .syntheseModule>div{ + display: flex; + gap: 4px; +} + .eval:hover, .syntheseModule:hover{ background: var(--couleurSurlignage); /* color: #FFF; */ @@ -203,9 +222,10 @@ h3{ color: #000; border: 1px solid var(--couleurIntense); opacity: 0; - display: grid; + display: grid !important; grid-template-columns: auto auto; - column-gap: 4px; + gap: 0 !important; + column-gap: 4px !important; } .eval:hover .complement{ opacity: 1; diff --git a/app/static/js/releve-but.js b/app/static/js/releve-but.js index 123a4cc4e..9b974fe6f 100644 --- a/app/static/js/releve-but.js +++ b/app/static/js/releve-but.js @@ -1,3 +1,4 @@ +/* Module par Seb. L. */ class releveBUT extends HTMLElement { constructor(){ super(); @@ -16,15 +17,15 @@ class releveBUT extends HTMLElement { 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") + 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){ @@ -39,10 +40,16 @@ class releveBUT extends HTMLElement { 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"); } - template(){ return `
@@ -133,7 +140,7 @@ class releveBUT extends HTMLElement { ${data.etudiant.prenom}`; if (data.etudiant.date_naissance) { - output += ` né${(data.etudiant.civilite == "F") ? "e" : ""} le ${this.ISOToDate(data.etudiant.date_naissance)}`; + output += `
né${(data.etudiant.civilite == "F") ? "e" : ""} le ${this.ISOToDate(data.etudiant.date_naissance)}
`; } output += ` @@ -186,27 +193,29 @@ class releveBUT extends HTMLElement { let output = ``; Object.entries(data.ues).forEach(([ue, dataUE]) => { output += ` -
-

- ${(dataUE.competence) ? dataUE.competence + " - " : ""}${ue} -

-
-
Moyenne : ${dataUE.moyenne?.value || "-"}
-
- Bonus : ${dataUE.bonus || 0} - - Malus : ${dataUE.malus || 0} -  - - ECTS : ${dataUE.ECTS.acquis} / ${dataUE.ECTS.total} - +
+
+

+ ${(dataUE.competence) ? dataUE.competence + " - " : ""}${ue} +

+
+
Moyenne : ${dataUE.moyenne?.value || "-"}
+
+ Bonus : ${dataUE.bonus || 0} - + Malus : ${dataUE.malus || 0} +  - + ECTS : ${dataUE.ECTS.acquis} / ${dataUE.ECTS.total} + +
+
+
+
Abs N.J.
${dataUE.absences?.injustifie || 0}
+
Total
${dataUE.absences?.total || 0}
-
-
Abs N.J.
${dataUE.absences?.injustifie || 0}
-
Total
${dataUE.absences?.total || 0}
-
+ ${this.synthese(data, dataUE.ressources)} + ${this.synthese(data, dataUE.saes)}
- ${this.synthese(data, dataUE.ressources)} - ${this.synthese(data, dataUE.saes)} `; }); this.shadow.querySelector(".synthese").innerHTML = output; @@ -221,7 +230,7 @@ class releveBUT extends HTMLElement {
${this.URL(url, `${module} - ${titre}`)}
${dataModule.moyenne} - Coef. ${dataModule.coef} + Coef. ${dataModule.coef}
`; @@ -271,7 +280,7 @@ class releveBUT extends HTMLElement {
${this.URL(evaluation.url, evaluation.description)}
${evaluation.note.value} - Coef. ${evaluation.coef} + Coef. ${evaluation.coef}
Coef
${evaluation.coef}
diff --git a/app/templates/but/bulletin.html b/app/templates/but/bulletin.html index 6ade88c0c..819b6bd7d 100644 --- a/app/templates/but/bulletin.html +++ b/app/templates/but/bulletin.html @@ -7,12 +7,6 @@ {% block app_content %} - -{% endblock %} - -{% block scripts %} -{{ super() }} - -{% endblock %} \ No newline at end of file +{% endblock %} + From fdee02d7262fb4947b071e76821aa158be08bf1e Mon Sep 17 00:00:00 2001 From: lehmann Date: Tue, 21 Dec 2021 13:56:19 +0100 Subject: [PATCH 2/4] Reverse ine / nio --- app/models/etudiants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/etudiants.py b/app/models/etudiants.py index 7c4f463af..cddac171c 100644 --- a/app/models/etudiants.py +++ b/app/models/etudiants.py @@ -75,8 +75,8 @@ class Identite(db.Model): """Infos exportées dans les bulletins""" return { "civilite": self.civilite, - "code_ine": self.code_ine, - "code_nip": self.code_nip, + "code_ine": self.code_nip, + "code_nip": self.code_ine, "date_naissance": self.date_naissance.isoformat() if self.date_naissance else None, From 5e31d3372a5688e2cd00bb86a9ad7d13a6af01de Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 21 Dec 2021 15:10:20 +0100 Subject: [PATCH 3/4] interversion INE/NIP dans bulletins --- app/models/etudiants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/etudiants.py b/app/models/etudiants.py index 6485be2ae..5b49d68f7 100644 --- a/app/models/etudiants.py +++ b/app/models/etudiants.py @@ -76,8 +76,8 @@ class Identite(db.Model): d = { "civilite": self.civilite, - "code_ine": self.code_nip, - "code_nip": self.code_ine, + "code_ine": self.code_ine, + "code_nip": self.code_nip, "date_naissance": self.date_naissance.isoformat() if self.date_naissance else None, From ce2ae9340cf0962ae1ebc817d4347cd07219c87f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 21 Dec 2021 15:10:49 +0100 Subject: [PATCH 4/4] cache codes INE/NIP dans bulletin scodoc --- app/templates/but/bulletin.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/templates/but/bulletin.html b/app/templates/but/bulletin.html index 819b6bd7d..727a144d7 100644 --- a/app/templates/but/bulletin.html +++ b/app/templates/but/bulletin.html @@ -9,7 +9,7 @@ -{% endblock %} - +{% endblock %} \ No newline at end of file