Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
Showing only changes of commit 269b739613 - Show all commits

View File

@ -6,9 +6,9 @@
<h2>Assiduité de {{sco.etud.nomprenom}}</h2>
<div class="options">
<input type="checkbox" id="show_pres" name="show_pres"><label for="show_pres">afficher les présences</label>
<input type="checkbox" name="show_reta" id="show_reta"><label for="show_reta">afficher les retards</label>
<input type="checkbox" name="mode_demi" id="mode_demi" checked><label for="mode_demi">mode demi journée</label>
<input type="checkbox" id="show_pres" name="show_pres" class="memo"><label for="show_pres">afficher les présences</label>
<input type="checkbox" name="show_reta" id="show_reta" class="memo"><label for="show_reta">afficher les retards</label>
<input type="checkbox" name="mode_demi" id="mode_demi" class="memo" checked><label for="mode_demi">mode demi journée</label>
</div>
<div class="calendrier">
@ -688,5 +688,17 @@
function isCalendrier() { return true }
/* --- Mémorisation des checkbox ---- */
document.querySelectorAll('input[type="checkbox"].memo').forEach(checkbox => {
checkbox.addEventListener('change', function() {
localStorage.setItem(this.id, this.checked);
});
// Load the saved state
document.querySelectorAll('input[type="checkbox"].memo').forEach(checkbox => {
const checked = localStorage.getItem(checkbox.id) === 'true';
checkbox.checked = checked;
});
});
</script>
{% endblock pageContent %}