From ad7f5b642e311cd8c9bf4f6bbcf5cc5fc0539547 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 3 Mar 2023 16:58:47 +0100 Subject: [PATCH] Sow status of vehicle in vehicles list --- .../_partials/vehicles-list.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/web/layouts/vehicles_management/_partials/vehicles-list.html b/web/layouts/vehicles_management/_partials/vehicles-list.html index fc4cb7e..1fdcff7 100644 --- a/web/layouts/vehicles_management/_partials/vehicles-list.html +++ b/web/layouts/vehicles_management/_partials/vehicles-list.html @@ -50,8 +50,8 @@ {{end}} {{end}} - {{else}} - {{range .Bookings}} + {{else if gt (len .Bookings) 1}} + {{range .Bookings}} {{if .Data.administrator_unavailability}} Retiré @@ -67,7 +67,19 @@ {{end}} {{end}} - {{end}} + {{end}} + {{$allAvailable := true}} + {{range .Bookings}} + {{if ne .Status -1}} + {{ $allAvailable = false }} + {{ break }} + {{end}} + {{end}} + {{if $allAvailable}} + + Disponible + + {{end}} {{end}}