Auto-commit for deploy to production - 2025-12-09 12:09:17

This commit is contained in:
2025-12-09 12:09:18 +01:00
parent dd41f0c6c0
commit 72726ba7af
3 changed files with 62 additions and 31 deletions
+6 -2
View File
@@ -176,12 +176,12 @@ input[type="number"] {
/* Ligne de semaine contenant au moins un jour de vacances scolaires */ /* Ligne de semaine contenant au moins un jour de vacances scolaires */
.fc-row--school-holiday { .fc-row--school-holiday {
background-color: #fff5cc; background-color: #fff8d5; /* jaune clair uniforme */
} }
/* Jour individuel en vacances scolaires (cellule) */ /* Jour individuel en vacances scolaires (cellule) */
.fc-day--school-holiday { .fc-day--school-holiday {
background-color: #ffe9a6; background-color: #ffe9a6; /* un ton un peu plus marqué mais pas orange vif */
} }
/* Tableau recap vacances scolaires */ /* Tableau recap vacances scolaires */
@@ -202,3 +202,7 @@ input[type="number"] {
.fc-holidays-table th { .fc-holidays-table th {
background-color: #f0f4f8; background-color: #f0f4f8;
} }
.fc-row--school-holiday td:first-child {
background-color: #ffffff;
}
+44 -16
View File
@@ -164,27 +164,55 @@ function addSchoolHolidayEventsFromRecords(records, events) {
const tbody = document.querySelector("#schoolHolidaysTable tbody"); const tbody = document.querySelector("#schoolHolidaysTable tbody");
if (tbody) tbody.innerHTML = ""; if (tbody) tbody.innerHTML = "";
// 1) Normaliser et regrouper par periode (start_date, end_date, description)
const groups = new Map();
records.forEach((record) => { records.forEach((record) => {
const start = new Date(record.start_date); const startIso = record.start_date; // ISO string
const end = new Date(record.end_date); const endIso = record.end_date;
const desc = record.description || "";
const zones = record.zones || "";
// Remplir le tableau recap const key = `${startIso}|${endIso}|${desc}`;
if (tbody) {
const tr = document.createElement("tr");
const startStr = formatDayMonth(start) + "/" + start.getFullYear();
const endStr = formatDayMonth(end) + "/" + end.getFullYear();
tr.innerHTML = ` const existing = groups.get(key);
<td>${record.description || ""}</td> if (!existing) {
<td>${startStr}</td> groups.set(key, {
<td>${endStr}</td> startIso,
<td>${record.zones || ""}</td> endIso,
<td>${record.location || ""}</td> description: desc,
`; zones, // pour Zone C, ça suffira
tbody.appendChild(tr); });
} }
// on ignore les académies (location) pour le tableau recap
});
// 2) Construire le tableau recap avec un seul record par groupe
if (tbody) {
Array.from(groups.values())
.sort((a, b) => new Date(a.startIso) - new Date(b.startIso))
.forEach((g) => {
const start = new Date(g.startIso);
const end = new Date(g.endIso);
const startStr = formatDayMonth(start) + "/" + start.getFullYear();
const endStr = formatDayMonth(end) + "/" + end.getFullYear();
const tr = document.createElement("tr");
tr.innerHTML = `
<td>${g.description}</td>
<td>${startStr}</td>
<td>${endStr}</td>
<td>${g.zones}</td>
`;
tbody.appendChild(tr);
});
}
// 3) Créer les événements jour par jour (VACANCES_SCOLAIRES)
groups.forEach((g) => {
const start = new Date(g.startIso);
const end = new Date(g.endIso);
// Chaque jour de la plage -> event VACANCES_SCOLAIRES
let current = new Date(start); let current = new Date(start);
while (current <= end) { while (current <= end) {
const year = current.getFullYear(); const year = current.getFullYear();
+12 -13
View File
@@ -114,19 +114,18 @@ require __DIR__ . '/header.php';
<p>Source : data.education.gouv.fr - calendrier officiel.</p> <p>Source : data.education.gouv.fr - calendrier officiel.</p>
<div class="pf-table-wrapper"> <div class="pf-table-wrapper">
<table id="schoolHolidaysTable" class="fc-holidays-table"> <table id="schoolHolidaysTable" class="fc-holidays-table">
<thead> <thead>
<tr> <tr>
<th>Période</th> <th>Période</th>
<th>Du</th> <th>Du</th>
<th>Au</th> <th>Au</th>
<th>Zones</th> <th>Zones</th>
<th>Académies</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <!-- Rempli par JS -->
<!-- Rempli par JS --> </tbody>
</tbody> </table>
</table>
</div> </div>
</section> </section>