This commit is contained in:
Jean-Marie Place 2023-11-20 13:49:01 +01:00
parent f99be92fad
commit 8b332120bf
3 changed files with 28 additions and 21 deletions

View File

@ -8,8 +8,9 @@
"""
import datetime
from flask import render_template
from flask import render_template, url_for
import app
from app.models import FormSemestre, FormSemestreInscription
from app.views import ScoData
@ -18,6 +19,7 @@ def feuille_preparation_jury_but(formsemestre_id: int):
formsemestre: FormSemestre = FormSemestre.query.filter_by(
id=formsemestre_id
).first_or_404()
breakpoint()
return render_template(
"but/jury_export.j2",
datetime=datetime,

View File

View File

@ -7,34 +7,39 @@
{% block app_content %}
<releve-but>{{ formsemestre.id }}</releve-but>
<H1>Export xlsx de fichier de jury</H1>
<form onsubmit="do_export()">
Formsemestre: {{ formsemestre.id }}
API root: {{ api_root }}
<button>Exporter</button>
</form>
{% endblock %}
{% block scripts %}
{{super()}}
{# <script src="{{scu.STATIC_DIR}}/js/releve-but.js"></script>#}
<script src="{{scu.STATIC_DIR}}/js/export-jury-but.js"></script>
<script>
//let dataSrc = "{{bul_url|safe}}";
//fetch(dataSrc)
// .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 dataSrc = "{{bul_url|safe}}";
fetch(dataSrc)
.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);
});
// .catch(error => {
// let div = document.createElement("div");
// div.innerText = "Une erreur s'est produite lors du transfert des données.";