diff --git a/app/__init__.py b/app/__init__.py index d22d506..124a53c 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -36,6 +36,23 @@ _MOIS_FR = ["", "janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"] +_DAY_TYPE_LABELS = { + "WORK": "Travail", + "TT": "Télétravail", + "GARDE": "Garde", + "ASTREINTE": "Astreinte", + "FORMATION": "Formation", + "RTT": "RTT", + "CONGE": "Congé", + "MALADE": "Maladie", + "FERIE": "Férié", +} + + +def _day_type_fr(code): + return _DAY_TYPE_LABELS.get(code, code) + + def _date_fr(d): """Formate une date en français : 'mercredi 11 mars 2026'.""" from datetime import date as date_type @@ -64,6 +81,7 @@ def create_app(config_path=None): db.init_app(app) app.jinja_env.filters["date_fr"] = _date_fr + app.jinja_env.filters["day_type_fr"] = _day_type_fr from app.routes.dashboard import bp as dashboard_bp from app.routes.entries import bp as entries_bp diff --git a/app/routes/dashboard.py b/app/routes/dashboard.py index a716af1..0d1e44a 100644 --- a/app/routes/dashboard.py +++ b/app/routes/dashboard.py @@ -54,6 +54,7 @@ def index(): today=today, today_entry=today_entry, journeys=journeys, + vehicles=vehicles, week_actual_str=minutes_to_str(week_actual), week_balance=week_balance, week_balance_str=minutes_to_str(abs(week_balance)), diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index 171dd2d..98b2a23 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -19,7 +19,7 @@
{{ entry.date | date_fr }}