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" .}} +
| - Statut - | -- Type - | -- Numéro (Immat / Bicycode) - | -- Beneficiaire - | -- Dates - | -- Commentaire - | -- Actions - | -
|---|---|---|---|---|---|---|
| - {{if .Data.administrator_unavailability}} - - Retiré - - {{else if and (eq $.ViewState.status_management "manual") (not .Deleted)}} - {{$manualStatus := .ManualStatus}} - {{range $.ViewState.status_options}} - {{if eq (index . "name") $manualStatus}} - {{if eq (index . "meta_status") "open"}} - {{index . "label"}} - {{else if eq (index . "meta_status") "active"}} - {{index . "label"}} - {{else if eq (index . "meta_status") "closed"}} - {{index . "label"}} - {{end}} - {{end}} - {{end}} - {{else if .Deleted}} - - Annulé - - {{else}} - {{if eq .Status 1 }} - - A venir - - {{end}} - {{if eq .Status 0 }} - - En cours - - {{end}} - {{if eq .Status -1 }} - - Terminé - - {{end}} - {{end}} - | -
- {{ (index $.ViewState.vehicles_map .Vehicleid).Type }}
- |
-
- {{ (index $.ViewState.vehicles_map .Vehicleid).Data.licence_plate }}
- |
-
- {{if .Data.administrator_unavailability}}
-
- {{else}}
-
-
- {{ (index $.ViewState.drivers_map .Driver).Data.first_name }}
- {{ (index $.ViewState.drivers_map .Driver).Data.last_name }}
-
- {{end}}
- |
-
- {{if .Data.administrator_unavailability}}
- Retiré du {{(timeFrom .Unavailablefrom).Format "02/01/2006"}} au {{(timeFrom .Unavailableto).Format "02/01/2006"}}
- {{else}}
-
-
- {{end}}
- Du {{(timeFrom .Startdate).Format "02/01/2006 à 15:04"}}
- au {{(timeFrom .Enddate).Format "02/01/2006 à 15:04"}}
- |
-
- {{ .Data.comment }}
- |
- - Voir - | -
| + Statut + | ++ Type + | ++ Numéro (Immat / Bicycode) + | ++ Beneficiaire + | ++ Dates + | ++ | ++ Actions + | +
|---|---|---|---|---|---|---|
| + {{if .Data.administrator_unavailability}} + + Retiré + + {{else if and (eq $.ViewState.status_management "manual") (not .Deleted)}} + {{$manualStatus := .ManualStatus}} + {{range $.ViewState.status_options}} + {{if eq (index . "name") $manualStatus}} + {{if eq (index . "meta_status") "open"}} + {{index . "label"}} + {{else if eq (index . "meta_status") "active"}} + {{index . "label"}} + {{else if eq (index . "meta_status") "closed"}} + {{index . "label"}} {{end}} - |
| - Statut Réservation - | -- Numéro (Immat / Bicycode) - | -- Type - | -- Modèle - | -- Lieu - | -- Actions - | -
|---|---|---|---|---|---|
|
-
- {{if not .Bookings}}
-
- Disponible
-
- {{else if len .Bookings | eq 1}}
- {{range .Bookings}}
- {{if .Data.administrator_unavailability}}
-
- Retiré
-
- {{else if eq .Status -1 }}
-
- Disponible
-
- {{else if eq .Status 1 }}
-
- A venir
-
- {{else if eq .Status 0 }}
-
- En cours
-
- {{end}}
- {{end}}
- {{else if gt (len .Bookings) 1}}
- {{range .Bookings}}
- {{if .Data.administrator_unavailability}}
-
- Retiré
-
- {{else}}
- {{if eq .Status 1 }}
-
- A venir
-
- {{else if eq .Status 0 }}
-
- En cours
-
- {{end}}
- {{end}}
- {{end}}
- {{$allAvailable := true}}
- {{range .Bookings}}
- {{if ne .Status -1}}
- {{ $allAvailable = false }}
- {{break}}
- {{end}}
- {{end}}
- {{if $allAvailable}}
-
- Disponible
-
- {{end}}
- {{end}}
-
- |
-
- {{.Data.licence_plate}}
- |
-
-
- {{.Type}}
- {{if eq .Type "Voiture"}}
- {{ if .Data.automatic}} (boite auto){{ end }}
- {{end}}
-
- |
-
- {{.Data.name}}
- |
-
- {{if .Data.address}}{{.Data.address.properties.label}}{{end}}
- |
- - Voir - | -
| + Disponibilité + | ++ Numéro (Immat / Bicycode) + | ++ Type + | ++ Modèle + | ++ Lieu + | ++ Actions + | +
|---|---|---|---|---|---|
|
+
+ {{if not .Bookings}}
+
+ Disponible
+
+ {{else}}
+ {{$hasActive := false}}
+ {{$hasUpcoming := false}}
+ {{$hasRetired := false}}
+ {{range .Bookings}}
+ {{if .Data.administrator_unavailability}}
+ {{$hasRetired = true}}
+ {{else if eq .Status 0}}
+ {{$hasActive = true}}
+ {{else if eq .Status 1}}
+ {{$hasUpcoming = true}}
+ {{end}}
+ {{end}}
+ {{if $hasRetired}}
+
+ Retiré
+
+ {{end}}
+ {{if $hasActive}}
+
+ En prêt
+
+ {{else if $hasUpcoming}}
+
+ Réservé
+
+ {{else if not $hasRetired}}
+
+ Disponible
+
+ {{end}}
+ {{end}}
-
-
-
-
+ |
+
+ {{.Data.licence_plate}}
+ |
+
+
+ {{.Type}}
+ {{if eq .Type "Voiture"}}
+ {{ if .Data.automatic}} (boite auto){{ end }}
+ {{end}}
+
+ |
+
+ {{.Data.name}}
+ |
+
+ {{if .Data.address}}{{.Data.address.properties.label}}{{end}}
+ |
+ + Voir + | +
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)}} +