Vous n'avez plus de crédits pour générer des appréciations.
@@ -122,219 +140,301 @@ body, .bg-light {
- {% if appreciations_json and appreciations_json|length > 0 %}
- {% for appreciation in appreciations_json %}
+ {% if appreciations_json and appreciations_json|length > 0 %}
+ {% for appreciation in appreciations_json %}
+
+
{{ appreciation.eleve }}
+
+
+
+
+
+
+
+
+ {% endfor %}
+ {% else %}
-
{{ appreciation.eleve }}
-
-
+
Aucune appréciation générée.
- {% endfor %}
- {% else %}
-
-
Aucune appréciation générée.
-
- {% endif %}
+ {% endif %}
+
+
+
+ // Action individuelle sur bouton Bulletin
+ document.querySelectorAll('.action-bulletin').forEach(btn => {
+ btn.addEventListener('click', function() {
+ const eleve = btn.getAttribute('data-eleve');
+ fetch("{% url 'get_bulletin_eleve' %}", {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-CSRFToken': '{{ csrf_token }}'
+ },
+ body: JSON.stringify({eleve: eleve})
+ })
+ .then(response => response.json())
+ .then(data => {
+ // Mettre le titre dans le header du modal
+ const modalTitle = document.getElementById('bulletinModalLabel');
+ if (modalTitle) {
+ modalTitle.textContent = `Bulletin de l'élève ${eleve}`;
+ }
+ // Mettre uniquement les appréciations dans le body
+ let message = '';
+ if (Array.isArray(data.appreciations) && data.appreciations.length > 0) {
+ message += data.appreciations.map(app => `