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 */
|
||||
.fc-row--school-holiday {
|
||||
background-color: #fff5cc;
|
||||
background-color: #fff8d5; /* jaune clair uniforme */
|
||||
}
|
||||
|
||||
/* Jour individuel en vacances scolaires (cellule) */
|
||||
.fc-day--school-holiday {
|
||||
background-color: #ffe9a6;
|
||||
background-color: #ffe9a6; /* un ton un peu plus marqué mais pas orange vif */
|
||||
}
|
||||
|
||||
/* Tableau recap vacances scolaires */
|
||||
@@ -202,3 +202,7 @@ input[type="number"] {
|
||||
.fc-holidays-table th {
|
||||
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");
|
||||
if (tbody) tbody.innerHTML = "";
|
||||
|
||||
// 1) Normaliser et regrouper par periode (start_date, end_date, description)
|
||||
const groups = new Map();
|
||||
|
||||
records.forEach((record) => {
|
||||
const start = new Date(record.start_date);
|
||||
const end = new Date(record.end_date);
|
||||
const startIso = record.start_date; // ISO string
|
||||
const endIso = record.end_date;
|
||||
const desc = record.description || "";
|
||||
const zones = record.zones || "";
|
||||
|
||||
// Remplir le tableau recap
|
||||
if (tbody) {
|
||||
const tr = document.createElement("tr");
|
||||
const startStr = formatDayMonth(start) + "/" + start.getFullYear();
|
||||
const endStr = formatDayMonth(end) + "/" + end.getFullYear();
|
||||
const key = `${startIso}|${endIso}|${desc}`;
|
||||
|
||||
tr.innerHTML = `
|
||||
<td>${record.description || ""}</td>
|
||||
<td>${startStr}</td>
|
||||
<td>${endStr}</td>
|
||||
<td>${record.zones || ""}</td>
|
||||
<td>${record.location || ""}</td>
|
||||
`;
|
||||
tbody.appendChild(tr);
|
||||
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) {
|
||||
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);
|
||||
while (current <= end) {
|
||||
const year = current.getFullYear();
|
||||
|
||||
+12
-13
@@ -114,19 +114,18 @@ require __DIR__ . '/header.php';
|
||||
<p>Source : data.education.gouv.fr - calendrier officiel.</p>
|
||||
<div class="pf-table-wrapper">
|
||||
<table id="schoolHolidaysTable" class="fc-holidays-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Période</th>
|
||||
<th>Du</th>
|
||||
<th>Au</th>
|
||||
<th>Zones</th>
|
||||
<th>Académies</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Rempli par JS -->
|
||||
</tbody>
|
||||
</table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Période</th>
|
||||
<th>Du</th>
|
||||
<th>Au</th>
|
||||
<th>Zones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Rempli par JS -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user