forked from ScoDoc/ScoDoc
Assiduité calendrier: mémorise état checkboxes
This commit is contained in:
parent
772293e06f
commit
269b739613
@ -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 %}
|
||||
|
Loading…
Reference in New Issue
Block a user