Auto-commit for deploy to production - 2025-12-09 12:09:17
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -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 = "";
|
||||||
|
|
||||||
records.forEach((record) => {
|
// 1) Normaliser et regrouper par periode (start_date, end_date, description)
|
||||||
const start = new Date(record.start_date);
|
const groups = new Map();
|
||||||
const end = new Date(record.end_date);
|
|
||||||
|
|
||||||
// Remplir le tableau recap
|
records.forEach((record) => {
|
||||||
|
const startIso = record.start_date; // ISO string
|
||||||
|
const endIso = record.end_date;
|
||||||
|
const desc = record.description || "";
|
||||||
|
const zones = record.zones || "";
|
||||||
|
|
||||||
|
const key = `${startIso}|${endIso}|${desc}`;
|
||||||
|
|
||||||
|
const existing = groups.get(key);
|
||||||
|
if (!existing) {
|
||||||
|
groups.set(key, {
|
||||||
|
startIso,
|
||||||
|
endIso,
|
||||||
|
description: desc,
|
||||||
|
zones, // pour Zone C, ça suffira
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// on ignore les académies (location) pour le tableau recap
|
||||||
|
});
|
||||||
|
|
||||||
|
// 2) Construire le tableau recap avec un seul record par groupe
|
||||||
if (tbody) {
|
if (tbody) {
|
||||||
const tr = document.createElement("tr");
|
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 startStr = formatDayMonth(start) + "/" + start.getFullYear();
|
||||||
const endStr = formatDayMonth(end) + "/" + end.getFullYear();
|
const endStr = formatDayMonth(end) + "/" + end.getFullYear();
|
||||||
|
|
||||||
|
const tr = document.createElement("tr");
|
||||||
tr.innerHTML = `
|
tr.innerHTML = `
|
||||||
<td>${record.description || ""}</td>
|
<td>${g.description}</td>
|
||||||
<td>${startStr}</td>
|
<td>${startStr}</td>
|
||||||
<td>${endStr}</td>
|
<td>${endStr}</td>
|
||||||
<td>${record.zones || ""}</td>
|
<td>${g.zones}</td>
|
||||||
<td>${record.location || ""}</td>
|
|
||||||
`;
|
`;
|
||||||
tbody.appendChild(tr);
|
tbody.appendChild(tr);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chaque jour de la plage -> event VACANCES_SCOLAIRES
|
// 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);
|
||||||
|
|
||||||
let current = new Date(start);
|
let current = new Date(start);
|
||||||
while (current <= end) {
|
while (current <= end) {
|
||||||
const year = current.getFullYear();
|
const year = current.getFullYear();
|
||||||
|
|||||||
+1
-2
@@ -120,13 +120,12 @@ require __DIR__ . '/header.php';
|
|||||||
<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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user