ScoDoc/app/templates/but/bulletin.html

49 lines
1.2 KiB
HTML
Raw Normal View History

2021-12-28 16:17:07 +01:00
{# -*- mode: jinja-html -*- #}
{% extends "sco_page.html" %}
{% block styles %}
{{super()}}
{% endblock %}
{% block app_content %}
2022-03-07 21:49:11 +01:00
{% include 'bul_head.html' %}
2021-12-18 02:30:47 +01:00
<releve-but></releve-but>
<script src="/ScoDoc/static/js/releve-but.js"></script>
2022-03-07 23:43:48 +01:00
{% include 'bul_foot.html' %}
<script>
let dataSrc = "{{bul_url|safe}}";
2021-12-18 02:30:47 +01:00
fetch(dataSrc)
.then(r => { return r.json() })
.then(json => {
2021-12-18 03:32:18 +01:00
let releve = document.querySelector("releve-but");
releve.showData = json;
2021-12-20 15:39:43 +01:00
// Syle custom à ajouter
let style = document.createElement("style");
style.textContent = `
.module>div,
.dateInscription,
.numerosEtudiant,
.dateNaissance{
display: none;
2021-12-20 15:39:43 +01:00
}`;
releve.shadowRoot.appendChild(style);
})
.catch(error => {
let div = document.createElement("div");
div.innerText = "Une erreur s'est produite lors du transfère 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 %}