From fa6f83722e5afa8c64f4260d53e34d579fe4db39 Mon Sep 17 00:00:00 2001 From: Iziram Date: Mon, 13 May 2024 15:38:56 +0200 Subject: [PATCH] sco_gen_cal : ajout style semaine courante --- app/scodoc/sco_gen_cal.py | 9 +++++++++ app/templates/calendrier.j2 | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/app/scodoc/sco_gen_cal.py b/app/scodoc/sco_gen_cal.py index 44695c3f..45bfa21f 100644 --- a/app/scodoc/sco_gen_cal.py +++ b/app/scodoc/sco_gen_cal.py @@ -20,8 +20,11 @@ class Jour: def __init__(self, date: datetime.date): self.date = date self.class_list: list[str] = [] + if self.is_non_work(): self.class_list.append("non-travail") + if self.is_current_week(): + self.class_list.append("sem-courante") def get_nom(self, short=True): """ @@ -45,6 +48,12 @@ class Jour: dept_id=g.scodoc_dept_id ) + def is_current_week(self): + """ + Renvoie True si le jour est dans la semaine courante + """ + return self.date.isocalendar()[1] == datetime.date.today().isocalendar()[1] + def get_date(self) -> str: """ Renvoie la date du jour au format "dd/mm/yyyy" diff --git a/app/templates/calendrier.j2 b/app/templates/calendrier.j2 index 701ddc0a..ce13a4f8 100644 --- a/app/templates/calendrier.j2 +++ b/app/templates/calendrier.j2 @@ -69,4 +69,11 @@ border: 1px solid #d5d5d5; position: relative; } + + .sem-courante{ + --couleur : #ee752c; + border-left: solid 3px var(--couleur); + border-right: solid 3px var(--couleur); + } + \ No newline at end of file