showing 1 statut for vehicles-list

This commit is contained in:
Nicolas CARON 2023-02-24 13:51:25 +01:00
parent c16e27fb25
commit 59950586ec
1 changed files with 9 additions and 5 deletions

View File

@ -33,7 +33,12 @@
{{range .ViewState.vehicles}} {{range .ViewState.vehicles}}
<tr> <tr>
<td class="flex flex-col whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center"> <td class="flex flex-col whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
{{range .Bookings}} {{if not .Bookings}}
<span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" >
Disponible
</span>
{{else}}
{{range slice .Bookings 0 1}}
{{if .Data.administrator_unavailability}} {{if .Data.administrator_unavailability}}
<span class="mt-1 p-1 bg-black text-white text-xs font-bold rounded-xl" > <span class="mt-1 p-1 bg-black text-white text-xs font-bold rounded-xl" >
Retiré Retiré
@ -43,19 +48,18 @@
<span class="mt-1 p-1 bg-co-blue text-white text-xs font-bold rounded-xl" > <span class="mt-1 p-1 bg-co-blue text-white text-xs font-bold rounded-xl" >
A venir A venir
</span> </span>
{{end}} {{else if eq .Status 0 }}
{{if eq .Status 0 }}
<span class="mt-1 p-1 bg-co-green text-white text-xs font-bold rounded-xl" > <span class="mt-1 p-1 bg-co-green text-white text-xs font-bold rounded-xl" >
En cours En cours
</span> </span>
{{end}} {{else}}
{{if eq .Status -1 }}
<span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" > <span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" >
Disponible Disponible
</span> </span>
{{end}} {{end}}
{{end}} {{end}}
{{end}} {{end}}
{{end}}
</td> </td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"> <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="text-gray-900" >{{.Data.licence_plate}}</div> <div class="text-gray-900" >{{.Data.licence_plate}}</div>