MonScoDocEssai/app/templates/but/bulletin.html

49 lines
1.2 KiB
HTML

{# -*- mode: jinja-html -*- #}
{% extends "sco_page.html" %}
{% block styles %}
{{super()}}
{% endblock %}
{% block app_content %}
{% include 'bul_head.html' %}
<releve-but></releve-but>
<script src="{{sco.scu.STATIC_DIR}}/js/releve-but.js"></script>
{% include 'bul_foot.html' %}
<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);
})
.catch(error => {
let div = document.createElement("div");
div.innerText = "Une erreur s'est produite lors du transfert des données.";
div.style.fontSize = "24px";
div.style.color = "#d93030";
let releve = document.querySelector("releve-but");
releve.after(div);
releve.remove();
throw 'Fin du script - données invalides';
});
document.querySelector("html").style.scrollBehavior = "smooth";
</script>
{% endblock %}