From 0559e6705d6ad918bc8b1358efb2c5b76fef873f Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 27 Feb 2026 16:41:21 +0100 Subject: [PATCH] feat: extra properties dynamiques, filtrage meta_status et alertes retard --- config.yaml | 3 + .../administration/bookings_stats.html | 9 +- .../_partials/booking_filters.html | 39 ++- .../_partials/bookings-list.html | 237 +++++++++--------- .../_partials/vehicles-list.html | 213 +++++++--------- .../vehicles_management/booking-display.html | 131 +++++++++- .../vehicles_management/bookings-list.html | 9 +- .../vehicles_management/fleet-update.html | 2 +- web/layouts/vehicles_management/overview.html | 101 +++++--- web/public/css/main.css | 23 ++ 10 files changed, 469 insertions(+), 298 deletions(-) diff --git a/config.yaml b/config.yaml index b7c13bb..2a6ef32 100644 --- a/config.yaml +++ b/config.yaml @@ -148,6 +148,8 @@ views: vehicles_management: overview: files: + - web/layouts/vehicles_management/_partials/booking_filters.html + - web/layouts/vehicles_management/_partials/vehicle_filters.html - web/layouts/vehicles_management/_partials/bookings-list.html - web/layouts/vehicles_management/_partials/vehicles-list.html - web/layouts/vehicles_management/overview.html @@ -445,6 +447,7 @@ icons: tabler-icons:bus: tabler-icons:train: hero:outline/map-pin: + hero:outline/exclamation-triangle: hero:outline/flag: emails: diff --git a/web/layouts/administration/bookings_stats.html b/web/layouts/administration/bookings_stats.html index 93677c1..69bb039 100644 --- a/web/layouts/administration/bookings_stats.html +++ b/web/layouts/administration/bookings_stats.html @@ -26,8 +26,11 @@ -{{template "vehicle_booking_filters" .}} - -{{template "bookings_list" .}} +
+
+ {{template "vehicle_booking_filters" .}} + {{template "bookings_list" .}} +
+
{{end}} diff --git a/web/layouts/vehicles_management/_partials/booking_filters.html b/web/layouts/vehicles_management/_partials/booking_filters.html index 31a541e..d322404 100644 --- a/web/layouts/vehicles_management/_partials/booking_filters.html +++ b/web/layouts/vehicles_management/_partials/booking_filters.html @@ -1,9 +1,14 @@ {{ define "vehicle_booking_filters" }} -
+
+ +{{if .ViewState.filters.v_type}}{{end}} +{{if .ViewState.filters.v_status}}{{end}} +
+{{if not .ViewState.hide_date_filters}}
@@ -13,16 +18,40 @@
+{{end}} + +{{if .ViewState.vehicle_types}} +
+ +
+ + +
+
+{{end}}
+ +
- + +
+
+
@@ -175,6 +233,42 @@
+ {{if .ViewState.booking_extra_properties}} +
+

Informations complémentaires

+
+
+ +
+
+
+ {{end}}
@@ -199,6 +293,23 @@ {{template "booking_status_badge" .}}

Informations utiles sur la réservation.

+ {{if eq .ViewState.status_management "manual"}} + {{range .ViewState.status_options}} + {{if eq (index . "name") $.ViewState.booking.ManualStatus}} + {{if and (eq (index . "meta_status") "open") (isPast $.ViewState.booking.Startdate)}} +
+ {{$.IconSet.Icon "hero:outline/exclamation-triangle" "h-6 w-6 flex-shrink-0"}} + Retard : la date de début de réservation est dépassée +
+ {{else if and (eq (index . "meta_status") "active") (isPast $.ViewState.booking.Enddate)}} +
+ {{$.IconSet.Icon "hero:outline/exclamation-triangle" "h-6 w-6 flex-shrink-0"}} + Retard : la date de fin de réservation est dépassée +
+ {{end}} + {{end}} + {{end}} + {{end}} {{end}}
diff --git a/web/layouts/vehicles_management/bookings-list.html b/web/layouts/vehicles_management/bookings-list.html index 5068b9d..c8d3fd2 100644 --- a/web/layouts/vehicles_management/bookings-list.html +++ b/web/layouts/vehicles_management/bookings-list.html @@ -18,10 +18,11 @@
+ +
+ {{template "vehicle_booking_filters" .}} + {{template "bookings_list" .}} +
-{{template "vehicle_booking_filters" .}} - -{{template "bookings_list" .}} - {{end}} diff --git a/web/layouts/vehicles_management/fleet-update.html b/web/layouts/vehicles_management/fleet-update.html index 64cdbf6..a0841d2 100644 --- a/web/layouts/vehicles_management/fleet-update.html +++ b/web/layouts/vehicles_management/fleet-update.html @@ -14,7 +14,7 @@ informations: '{{ .ViewState.vehicle.Data.informations}}', }, rules: { - licence_plate: ['required', 'regexMatch:^[A-Z]{1,2}-[0-9]{1,3}-[A-Z]{1,2}$'], + licence_plate: ['required'], name: ['required'], }, formValidation: { diff --git a/web/layouts/vehicles_management/overview.html b/web/layouts/vehicles_management/overview.html index 60fd3ab..9544390 100644 --- a/web/layouts/vehicles_management/overview.html +++ b/web/layouts/vehicles_management/overview.html @@ -1,45 +1,74 @@ {{define "content"}} +{{$defaultTab := "bookings"}}

Gestion des véhicules et réservations

+
+ -{{template "bookings_list" .}} - - - -{{template "vehicles_list" .}} - -{{end}} \ No newline at end of file +{{end}} diff --git a/web/public/css/main.css b/web/public/css/main.css index f2202fd..db6f3f2 100644 --- a/web/public/css/main.css +++ b/web/public/css/main.css @@ -6,12 +6,15 @@ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + --color-red-50: oklch(0.971 0.013 17.38); + --color-red-200: oklch(0.885 0.062 18.334); --color-red-500: oklch(0.637 0.237 25.331); --color-red-600: oklch(0.577 0.245 27.325); --color-red-700: oklch(0.505 0.213 27.518); --color-red-900: oklch(0.396 0.141 25.723); --color-orange-50: oklch(0.98 0.016 73.684); --color-orange-200: oklch(0.901 0.076 70.697); + --color-amber-500: oklch(0.769 0.188 70.08); --color-yellow-50: oklch(0.987 0.026 102.212); --color-green-100: oklch(0.962 0.044 156.743); --color-green-600: oklch(0.627 0.194 149.214); @@ -1817,6 +1820,9 @@ .border-orange-200 { border-color: var(--color-orange-200); } + .border-red-200 { + border-color: var(--color-red-200); + } .border-transparent { border-color: transparent; } @@ -1913,6 +1919,9 @@ .bg-orange-50 { background-color: var(--color-orange-50); } + .bg-red-50 { + background-color: var(--color-red-50); + } .bg-red-500 { background-color: var(--color-red-500); } @@ -2469,6 +2478,9 @@ .\[color\:red\]\/50\! { color: color-mix(in oklab, red 50%, transparent) !important; } + .text-amber-500 { + color: var(--color-amber-500); + } .text-blue-800 { color: var(--color-blue-800); } @@ -2514,9 +2526,15 @@ .text-indigo-600 { color: var(--color-indigo-600); } + .text-red-500 { + color: var(--color-red-500); + } .text-red-600 { color: var(--color-red-600); } + .text-red-700 { + color: var(--color-red-700); + } .text-white { color: var(--color-white); } @@ -3321,6 +3339,11 @@ border-color: transparent; } } + .focus\:bg-white { + &:focus { + background-color: var(--color-white); + } + } .focus\:placeholder-gray-400 { &:focus { &::placeholder {