diff --git a/src/components/EventCard.astro b/src/components/EventCard.astro index 49b57c2..6319ead 100644 --- a/src/components/EventCard.astro +++ b/src/components/EventCard.astro @@ -45,6 +45,9 @@ let dynamicStatus = { label: status, color: "rgba(255,255,255,0.3)", icon: "" }; if (status === "Terminé") { dynamicStatus = { label: "Terminé", color: "#10b981" }; +} else if (status === "En cours") { + // Nouvelle condition pour le statut "En cours" + dynamicStatus = { label: "En cours", color: "#3b82f6", icon: "⚡" }; } else if (diffDays < 0) { dynamicStatus = { label: "En retard", color: "#ef4444" }; } else if (diffDays === 0) { diff --git a/src/pages/index.astro b/src/pages/index.astro index 8aea893..46f38ef 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -8,7 +8,10 @@ import EventCard from "../components/EventCard.astro"; const allHumans = await getCollection("humans", ({ id }) => { return id.startsWith("latchimynicolas/"); }); -const allEvents = await getCollection("events"); +const allEvents = await getCollection("events", ({ data }) => { + // On ne garde que les événements qui ne sont pas terminés + return data.status !== "Terminé"; +}); // 2. Tris temporels const sortedAll = allHumans.sort(