get etudiants data ok

This commit is contained in:
Jean-Marie Place 2023-11-20 14:45:46 +01:00
parent a2467fd236
commit aab014f5ef
3 changed files with 599 additions and 567 deletions

View File

@ -11,6 +11,7 @@ import datetime
from flask import render_template, url_for
import app
from app import Departement
from app.models import FormSemestre, FormSemestreInscription
from app.views import ScoData
@ -19,10 +20,14 @@ def feuille_preparation_jury_but(formsemestre_id: int):
formsemestre: FormSemestre = FormSemestre.query.filter_by(
id=formsemestre_id
).first_or_404()
departement: Departement = Departement.query.filter_by(
id=formsemestre.dept_id
).first_or_404()
breakpoint()
return render_template(
"but/jury_export.j2",
datetime=datetime,
formsemestre=formsemestre,
dept = departement.acronym,
sco=ScoData(formsemestre=formsemestre),
)

File diff suppressed because it is too large Load Diff

View File

@ -23,23 +23,28 @@
<script src="{{scu.STATIC_DIR}}/js/export-jury-but.js"></script>
<script>
let dataSrc = "{{bul_url|safe}}";
let dataSrc = "/ScoDoc/{{dept}}/api/formsemestre/{{formsemestre.id}}/etudiants/long";
fetch(dataSrc)
.then(r => { return r.json() })
.then(r => {
return r.json();
})
.then(json => {
let releve = document.querySelector("releve-but");
releve.showData = json;
// Syle custom à ajouter
let style = document.createElement("style");
style.textContent = `
.module>div,
.dateInscription,
.numerosEtudiant,
.dateNaissance{
display: none;
}`;
releve.shadowRoot.appendChild(style);
});
let etudiants = json;
//let releve = document.querySelector("releve-but");
//releve.showData = json;
// Style custom à ajouter
// let style = document.createElement("style");
// style.textContent = `
// .module>div,
// .dateInscription,
// .numerosEtudiant,
// .dateNaissance{
// display: none;
// }`;
//releve.shadowRoot.appendChild(style);
})
.catch(error => { console.log(error)});
// .catch(error => {
// let div = document.createElement("div");
// div.innerText = "Une erreur s'est produite lors du transfert des données.";