showing all statuts for vehicle

This commit is contained in:
Nicolas CARON 2023-02-24 10:53:27 +01:00
parent 361447f188
commit c16e27fb25
2 changed files with 8 additions and 17 deletions

View File

@ -34,7 +34,7 @@
<tbody class="divide-y divide-gray-200 bg-white">
{{range .ViewState.bookings}}
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
<td class="flex-col py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
{{if .Data.administrator_unavailability}}
<span class="p-1 bg-black text-white text-xs font-bold rounded-xl" >
Retiré

View File

@ -1,13 +1,4 @@
{{define "vehicles_list"}}
<!-- {{range $.ViewState.bookings}}
{{.Vehicleid}}
<br>
{{end}}
<br>
{{range $.ViewState.vehicles}}
{{.ID}}
<br>
{{end}} -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
<div class="mt-8 flex flex-col">
<div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
@ -41,26 +32,26 @@
<tbody class="divide-y divide-gray-200 bg-white">
{{range .ViewState.vehicles}}
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
{{range $.ViewState.bookings}}
<td class="flex flex-col whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
{{range .Bookings}}
{{if .Data.administrator_unavailability}}
<span class="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é
</span>
{{else}}
{{if eq .Status 1 }}
<span class="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
</span>
{{end}}
{{if eq .Status 0 }}
<span class="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
</span>
{{end}}
{{if eq .Status -1 }}
<span class="p-1 bg-co-red text-white text-xs font-bold rounded-xl" >
Terminé
<span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" >
Disponible
</span>
{{end}}
{{end}}