Sow status of vehicle in vehicles list

This commit is contained in:
Nicolas CARON 2023-03-03 16:58:47 +01:00
parent 193bd8ef3a
commit ad7f5b642e
1 changed files with 15 additions and 3 deletions

View File

@ -50,8 +50,8 @@
</span>
{{end}}
{{end}}
{{else}}
{{range .Bookings}}
{{else if gt (len .Bookings) 1}}
{{range .Bookings}}
{{if .Data.administrator_unavailability}}
<span class="mt-1 p-1 bg-black text-white text-xs font-bold rounded-xl" >
Retiré
@ -67,7 +67,19 @@
</span>
{{end}}
{{end}}
{{end}}
{{end}}
{{$allAvailable := true}}
{{range .Bookings}}
{{if ne .Status -1}}
{{ $allAvailable = false }}
{{ break }}
{{end}}
{{end}}
{{if $allAvailable}}
<span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" >
Disponible
</span>
{{end}}
{{end}}
</div>
</td>