diff --git a/manifest.json b/manifest.json index 634f0b3..d4cc9d2 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Planification", - "version": "2026.5.25", + "version": "2026.5.26", "description": "Vue claire et rapide du planning des techniciens EasyVista. Regroupe interventions et réservations par tech, affiche horaires, contact, lieu, catégorie et statut en un coup d'œil.", "browser_specific_settings": { "gecko": { diff --git a/viewer.css b/viewer.css index dca1d3f..cc3ae42 100644 --- a/viewer.css +++ b/viewer.css @@ -2009,16 +2009,15 @@ body.modal-open { /* ───────────────────────────────────────────────────────────────────────── v5.0.0 : horloge au milieu de la topbar (HH:MM, pas de secondes) ───────────────────────────────────────────────────────────────────────── */ -/* v2026.5.16 : app-clock contient maintenant 2 lignes empilées : - - app-clock-date : "Mardi 21 avril 2026" (petit) - - app-clock-time : "12:34" (grand) */ +/* v2026.5.27 : app-clock sur UNE seule ligne : "Jeudi 23.04.26 • 21:55" + Même taille pour la date et l'heure, gros point au milieu. */ .app-clock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; - flex-direction: column; + flex-direction: row; align-items: center; justify-content: center; line-height: 1.1; diff --git a/viewer.html b/viewer.html index 5164111..d552c82 100644 --- a/viewer.html +++ b/viewer.html @@ -9,8 +9,13 @@
-

Planification

diff --git a/viewer.js b/viewer.js index 876a2f4..4180de9 100644 --- a/viewer.js +++ b/viewer.js @@ -4707,9 +4707,30 @@ function buildCard(tech, isoDate) { const isPompier = tech.interventions.some(iv => iv.isPompier); const isAbsent = isTechAbsent(tech, isoDate); + // v2026.5.30 : détecter aussi les absences récurrentes hardcodées (Pillonel vendredi) + // pour leur appliquer le code couleur cyan (comme Congé) au lieu du rouge Pompier. + const isRecurring = isPillonelAbsentFriday(tech, isoDate); + if (isPompier) card.classList.add("is-pompier"); if (isAbsent) card.classList.add("is-absent"); + // v2026.5.27 : déterminer la catégorie d'absence principale (maladie/conge/pompier) + // pour appliquer le bon code couleur sur la carte entière. + // v2026.5.30 : les absences récurrentes hardcodées prennent la catégorie + // "recurring" (même cyan que Congé, texte distinct). + let absenceCategory = null; // "maladie" | "conge" | "pompier" | "recurring" | null + if (isRecurring) { + absenceCategory = "recurring"; + } else if (isPompier) { + absenceCategory = "pompier"; + } else if (isAbsent) { + const catBlock = tech.interventions.find(iv => iv.type === "AL-Absence" && iv.absenceCategory); + if (catBlock) absenceCategory = catBlock.absenceCategory; + } + if (absenceCategory) { + card.classList.add("absence-cat-" + absenceCategory); + } + const realInterventions = tech.interventions.filter(iv => iv.type !== "AL-Absence" && !iv.isPompier ); @@ -4725,23 +4746,57 @@ function buildCard(tech, isoDate) { // --- Header --- const header = document.createElement("div"); header.className = "card-header"; + + // v2026.5.27 : pastille colorée supprimée (v2026.5.28) — la barre gauche de la + // carte + le badge à droite suffisent pour indiquer la catégorie d'absence. + const nameEl = document.createElement("div"); nameEl.className = "card-tech-name"; nameEl.textContent = tech.name; header.appendChild(nameEl); - if (isPompier || isAbsent) { + if (isPompier || isAbsent || isRecurring) { const badge = document.createElement("div"); badge.className = "card-tech-badge"; - if (isPompier) { + if (isRecurring) { + // v2026.5.30 : absence récurrente (Pillonel vendredi) → badge "Absent" cyan + badge.classList.add("badge-recurring"); + badge.textContent = "Absent"; + } else if (isPompier) { badge.classList.add("badge-pompier"); badge.textContent = "Pompier"; + } else if (absenceCategory === "maladie") { + badge.classList.add("badge-maladie"); + badge.textContent = "Maladie/Accident"; + } else if (absenceCategory === "conge") { + // Déterminer singulier/pluriel selon la durée + const ab = absenceBlocks.find(a => a.absenceCategory === "conge") || absenceBlocks[0]; + const multiDay = ab && ab.startDate && ab.endDate && ab.startDate !== ab.endDate; + badge.classList.add("badge-conge"); + badge.textContent = multiDay ? "Congés" : "Congé"; } else { badge.classList.add("badge-absent"); badge.textContent = "Absent"; } header.appendChild(badge); } + + // v2026.5.32 : stats rapides pour la vue horizontale (cachées en classique) + const rowStats = document.createElement("div"); + rowStats.className = "tech-row-stats"; + const totalInterv = realInterventions.length; + const pill1 = document.createElement("span"); + pill1.className = "stat-pill"; + pill1.textContent = totalInterv + " interv."; + rowStats.appendChild(pill1); + if (morning > 0 || afternoon > 0) { + const pill2 = document.createElement("span"); + pill2.className = "stat-pill"; + pill2.textContent = morning + "m · " + afternoon + "a"; + rowStats.appendChild(pill2); + } + header.appendChild(rowStats); + card.appendChild(header); // --- Body --- @@ -4762,6 +4817,9 @@ function buildCard(tech, isoDate) { } else if (isAbsent && absenceBlocks.length) { const note = document.createElement("div"); note.className = "card-status-note absent"; + if (absenceCategory) { + note.classList.add("absent-" + absenceCategory); + } const ab = absenceBlocks[0]; if (ab.startDate && ab.endDate && ab.startDate !== ab.endDate) { note.textContent = `Absent du ${ab.startDate.substring(0, 5)} au ${ab.endDate.substring(0, 5)}`;