diff --git a/gestion_salle/static/gestion_salle/js/index.js b/gestion_salle/static/gestion_salle/js/index.js index 959284d..6950c0e 100644 --- a/gestion_salle/static/gestion_salle/js/index.js +++ b/gestion_salle/static/gestion_salle/js/index.js @@ -12,12 +12,7 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), { const modal = new bootstrap.Modal($("modalDetailReservation")); modal.show(); fetch (`/gestion-salle/revervation/details/${event.guid}`) - .then(response => { - if (!response.ok) { - throw new Error(`Erreur HTTP ${response.status}`); - } - return response.json(); - }) + .then(response => response.json()) .then(data => { currentReservationId = data.id_reservation; $("id_reservation_detail").value = data.id_reservation; @@ -26,7 +21,7 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), { $("employe").value=data.employe; $("salle").value=data.salle; $("statut-reservation").innerHTML=data.statut; - $("date_debut").value=data.date_debut; + $("date_evenement").value=data.date_evenement; $("heure_debut").value=data.heure_debut; $("heure_fin").value=data.heure_fin; $("motif_reservation").value=data.motif_reservation; @@ -39,7 +34,6 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), { } }) - .catch(error => console.error("Impossible de charger les détails de la réservation :", error)); } }); @@ -186,6 +180,7 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => { $("salle").value=data.salle; $("statut-reservation").innerHTML=data.statut; $("date_debut").value = data.date_debut; + $("date_fin").value = data.date_fin; $("heure_debut").value=data.heure_debut; $("heure_fin").value=data.heure_fin; $("motif_reservation").value=data.motif_reservation; diff --git a/gestion_salle/templates/gestion_salle/index.html b/gestion_salle/templates/gestion_salle/index.html index 70e6408..db35f40 100644 --- a/gestion_salle/templates/gestion_salle/index.html +++ b/gestion_salle/templates/gestion_salle/index.html @@ -55,5 +55,5 @@ {% block 'js' %} - + {% endblock %} \ No newline at end of file diff --git a/gestion_salle/templates/gestion_salle/parts/modalDetailResevation.html b/gestion_salle/templates/gestion_salle/parts/modalDetailResevation.html index c32abd9..20bf762 100644 --- a/gestion_salle/templates/gestion_salle/parts/modalDetailResevation.html +++ b/gestion_salle/templates/gestion_salle/parts/modalDetailResevation.html @@ -25,10 +25,10 @@ - {% comment %}
+
-
{% endcomment %} +
diff --git a/gestion_salle/views.py b/gestion_salle/views.py index 9cfbf1e..075aef5 100644 --- a/gestion_salle/views.py +++ b/gestion_salle/views.py @@ -153,7 +153,7 @@ def detail_reservation(request:HttpRequest, reservation_id:int): 'employe': f"{employe.first_name} {employe.last_name}", 'salle': reservation.salle, 'statut': dict(Reservation.STATUT).get(reservation.statut), - 'date_debut': reservation.date_debut.strftime('%Y-%m-%d'), + 'date_evenement': reservation.date_debut.strftime('%Y-%m-%d'), 'heure_debut': reservation.heure_debut.strftime('%H:%M'), 'heure_fin': reservation.heure_fin.strftime('%H:%M'), 'motif_reservation': reservation.motif_reservation,