forked from FroSteel/Planification
Version 2026.5.27 — Classification absences (Maladie/Congé/Pompier)
- Topbar une ligne, fermeture auto popups, contrastes améliorés - ABSENCE_LABELS, couleurs Maladie/Congé/Pompier, badge + barre gauche [code interpolé]
This commit is contained in:
@@ -4821,24 +4821,37 @@ function buildCard(tech, isoDate) {
|
||||
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)}`;
|
||||
// v2026.5.27 : libellé enrichi "Absent du XX au YY — Maladie" ou "Absent — Congé"
|
||||
const multiDay = ab.startDate && ab.endDate && ab.startDate !== ab.endDate;
|
||||
const catLabel = absenceCategory === "maladie" ? "Maladie/Accident"
|
||||
: absenceCategory === "conge" ? (multiDay ? "Congés" : "Congé")
|
||||
: null;
|
||||
let txt;
|
||||
if (multiDay) {
|
||||
txt = `Absent du ${ab.startDate.substring(0, 5)} au ${ab.endDate.substring(0, 5)}`;
|
||||
} else {
|
||||
note.textContent = "Absent toute la journée";
|
||||
txt = "Absent toute la journée";
|
||||
}
|
||||
if (catLabel) txt += ` — ${catLabel}`;
|
||||
note.textContent = txt;
|
||||
body.appendChild(note);
|
||||
|
||||
// v5.0.4 : tooltip au hover sur toute la carte absent (pas juste un
|
||||
// bouton visible). Contient : détail période + bouton supprimer si
|
||||
// c'est une absence supprimable (actionId réel, pas pompier récurrent).
|
||||
// v2026.5.33 : en vue horizontale, attacher le hover SEULEMENT au badge
|
||||
// (Congé / Maladie/Accident / Absent) pour éviter que la popup s'affiche
|
||||
// dès qu'on approche de la ligne du tech. En vue classique, on garde la
|
||||
// carte entière comme zone de hover (comportement d'origine).
|
||||
if (ab.actionId && !ab.isPompier && !ab._recurring) {
|
||||
// On attache le tooltip sur la CARD ENTIÈRE (card) — comme ça
|
||||
// survoler n'importe où sur la zone grisée "absent" le déclenche.
|
||||
const ivCopy = {
|
||||
...ab,
|
||||
type: "AL-Absence" // force pour buildTooltipHTML
|
||||
type: "AL-Absence"
|
||||
};
|
||||
const _isHorizontalView = () => document.documentElement.classList.contains("view-horizontal");
|
||||
// Hover sur la carte entière : actif SEULEMENT en vue classique
|
||||
card.addEventListener("mouseenter", (e) => {
|
||||
if (_isHorizontalView()) return; // bloqué en horizontal
|
||||
showTooltip(e, ivCopy, card);
|
||||
});
|
||||
card.addEventListener("mouseleave", () => {
|
||||
|
||||
Reference in New Issue
Block a user