1
0
forked from ScoDoc/ScoDoc

Fermeture tickets #203 #204 #205 #217

This commit is contained in:
Sébastien Lehmann 2021-12-20 15:39:43 +01:00
parent 19c736c894
commit f263354f88
4 changed files with 79 additions and 52 deletions

View File

@ -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,

View File

@ -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;

View File

@ -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 `
<div>
@ -133,7 +140,7 @@ class releveBUT extends HTMLElement {
${data.etudiant.prenom}`;
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 += `
@ -186,27 +193,29 @@ class releveBUT extends HTMLElement {
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 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>
<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>
${this.synthese(data, dataUE.ressources)}
${this.synthese(data, dataUE.saes)}
</div>
${this.synthese(data, dataUE.ressources)}
${this.synthese(data, dataUE.saes)}
`;
});
this.shadow.querySelector(".synthese").innerHTML = output;
@ -221,7 +230,7 @@ class releveBUT extends HTMLElement {
<div>${this.URL(url, `${module}&nbsp;- ${titre}`)}</div>
<div>
${dataModule.moyenne}
<em>Coef. ${dataModule.coef}</em>
<em>Coef.&nbsp;${dataModule.coef}</em>
</div>
</div>
`;
@ -271,7 +280,7 @@ class releveBUT extends HTMLElement {
<div>${this.URL(evaluation.url, evaluation.description)}</div>
<div>
${evaluation.note.value}
<em>Coef. ${evaluation.coef}</em>
<em>Coef.&nbsp;${evaluation.coef}</em>
</div>
<div class=complement>
<div>Coef</div><div>${evaluation.coef}</div>

View File

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