From 6baec61e0ea5169dfa66372269b8edc8238bd131 Mon Sep 17 00:00:00 2001 From: lehmann Date: Tue, 21 Dec 2021 22:22:55 +0100 Subject: [PATCH] =?UTF-8?q?Bulletin=20:=20Liens=20vers=20plus=20bas=20+=20?= =?UTF-8?q?lien=20vers=20fiche=20=C3=A9tudiant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/css/releve-but.css | 7 +++++++ app/static/js/releve-but.js | 30 ++++++++++++++++++++++++------ app/templates/but/bulletin.html | 5 +++-- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/app/static/css/releve-but.css b/app/static/css/releve-but.css index 2f9766de..60d4f01c 100644 --- a/app/static/css/releve-but.css +++ b/app/static/css/releve-but.css @@ -98,6 +98,10 @@ section>div:nth-child(1){ /************/ /* Etudiant */ /************/ +.info_etudiant{ + color: #000; + text-decoration: none; +} .etudiant{ display: flex; align-items: center; @@ -194,6 +198,9 @@ h3{ .info{ opacity: 0.9; } +.syntheseModule{ + cursor: pointer; +} .eval, .syntheseModule{ position: relative; display: flex; diff --git a/app/static/js/releve-but.js b/app/static/js/releve-but.js index 9b974fe6..126cb219 100644 --- a/app/static/js/releve-but.js +++ b/app/static/js/releve-but.js @@ -27,6 +27,10 @@ class releveBUT extends HTMLElement { moduleOnOff(){ this.parentElement.classList.toggle("moduleOnOff"); } + goTo(){ + let module = this.dataset.module; + this.parentElement.parentElement.parentElement.parentElement.querySelector("#Module_" + module).scrollIntoView(); + } set setConfig(config){ this.config.showURL = config.showURL ?? this.config.showURL; @@ -46,6 +50,9 @@ class releveBUT extends HTMLElement { this.shadow.querySelectorAll(".ue, .module").forEach(e => { e.addEventListener("click", this.moduleOnOff) }) + this.shadow.querySelectorAll(".syntheseModule").forEach(e => { + e.addEventListener("click", this.goTo) + }) this.shadow.children[0].classList.add("ready"); } @@ -132,8 +139,15 @@ class releveBUT extends HTMLElement { showInformations(data) { this.shadow.querySelector(".studentPic").src = data.etudiant.photo_url || "default_Student.svg"; - let output = ` -
+ let output = ''; + + if(this.config.showURL){ + output += ``; + } else { + output += `
`; + } + + output += `
${this.civilite(data.etudiant.civilite)} ${data.etudiant.nom} @@ -150,8 +164,12 @@ class releveBUT extends HTMLElement { Code INE : ${data.etudiant.code_ine}
${data.formation.titre}
-
`; + if(this.config.showURL){ + output += `
`; + } else { + output += `
`; + } this.shadow.querySelector(".infoEtudiant").innerHTML = output; } @@ -226,8 +244,8 @@ class releveBUT extends HTMLElement { let titre = data.ressources[module]?.titre || data.saes[module]?.titre; let url = data.ressources[module]?.url || data.saes[module]?.url; output += ` -
-
${this.URL(url, `${module} - ${titre}`)}
+
+
${module} - ${titre}
${dataModule.moyenne} Coef. ${dataModule.coef} @@ -249,7 +267,7 @@ class releveBUT extends HTMLElement { let output = ""; Object.entries(module).forEach(([numero, content]) => { output += ` -
+

${this.URL(content.url, `${numero} - ${content.titre}`)}

diff --git a/app/templates/but/bulletin.html b/app/templates/but/bulletin.html index 727a144d..27146ed4 100644 --- a/app/templates/but/bulletin.html +++ b/app/templates/but/bulletin.html @@ -22,9 +22,10 @@ .dateInscription, .numerosEtudiant, .dateNaissance{ - display: none; + display: none; }`; releve.shadowRoot.appendChild(style); - }) + }); + document.querySelector("html").style.scrollBehavior = "smooth"; {% endblock %} \ No newline at end of file