2022-11-06 17:19:13 +00:00
|
|
|
{{define "content"}}
|
|
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
|
|
|
<h1 class="text-2xl font-semibold text-gray-900">Réservations</h1>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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">
|
|
|
|
<div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
|
|
|
|
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
|
|
|
|
<table class="min-w-full divide-y divide-gray-300">
|
|
|
|
<thead class="bg-gray-50">
|
|
|
|
<tr>
|
2022-12-05 16:24:24 +00:00
|
|
|
<th scope="col"
|
2022-11-06 17:19:13 +00:00
|
|
|
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
|
|
|
Statut
|
2022-12-05 16:24:24 +00:00
|
|
|
</th>
|
2022-11-06 17:19:13 +00:00
|
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
|
|
|
Type
|
|
|
|
</th>
|
2022-12-05 16:24:24 +00:00
|
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
|
|
|
Véhicule
|
|
|
|
</th>
|
2023-01-17 07:26:46 +00:00
|
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
|
|
|
Prescripteur
|
|
|
|
</th>
|
|
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
|
|
|
Gestionnaire
|
|
|
|
</th>
|
2022-11-06 17:19:13 +00:00
|
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
|
|
|
Beneficiaire
|
|
|
|
</th>
|
|
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
|
|
|
Dates
|
|
|
|
</th>
|
|
|
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
|
|
|
<span class="sr-only">Actions</span>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="divide-y divide-gray-200 bg-white">
|
|
|
|
|
|
|
|
{{range .ViewState.bookings}}
|
|
|
|
<tr>
|
2022-12-05 16:24:24 +00:00
|
|
|
<td class="whitespace-nowrap 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é
|
|
|
|
</span>
|
|
|
|
{{else}}
|
|
|
|
{{if eq .Status 1 }}
|
|
|
|
<span class="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" >
|
|
|
|
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>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
</td>
|
2022-11-06 17:19:13 +00:00
|
|
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
2023-01-17 07:26:46 +00:00
|
|
|
<div class="text-gray-900" >{{(index $.ViewState.vehicles_map .Vehicleid).Type}}</div>
|
|
|
|
</td>
|
|
|
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
|
|
<div class="text-gray-900" >{{(index $.ViewState.vehicles_map .Vehicleid).Data.licence_plate}}</div>
|
2022-11-06 17:19:13 +00:00
|
|
|
</td>
|
2023-01-17 07:26:46 +00:00
|
|
|
|
2022-11-06 17:19:13 +00:00
|
|
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
2023-01-17 07:26:46 +00:00
|
|
|
{{if .Data.booked_by}}
|
|
|
|
{{if .Data.booked_by.user}}
|
|
|
|
<a href="/app/members/{{.Data.booked_by.user.id}}" class="flex inline">
|
|
|
|
<img class="h-5 w-5 rounded-co mr-1"
|
|
|
|
src="/app/members/{{.Data.booked_by.user.id}}/picture" alt="">
|
|
|
|
{{.Data.booked_by.user.display_name}}
|
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
{{if .Data.booked_by.group}}
|
|
|
|
({{.Data.booked_by.group.name}})
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2022-12-05 16:24:24 +00:00
|
|
|
</td>
|
2023-01-17 07:26:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
2023-01-17 07:57:32 +00:00
|
|
|
{{if gt (len (index $.ViewState.vehicles_map .Vehicleid).Administrators) 0}}
|
2023-01-17 07:26:46 +00:00
|
|
|
{{ (index $.ViewState.groups_map (index (index $.ViewState.vehicles_map .Vehicleid).Administrators 0)).Data.name }}
|
2023-01-17 07:57:32 +00:00
|
|
|
{{end}}
|
2023-01-17 07:26:46 +00:00
|
|
|
</td>
|
|
|
|
|
2022-12-05 16:24:24 +00:00
|
|
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
|
|
{{if not .Data.administrator_unavailability}}
|
2022-11-06 17:19:13 +00:00
|
|
|
<div class="text-gray-900" ><img class="h-6 w-6 rounded-co"
|
|
|
|
src="/app/beneficiaries/{{.Driver}}/picture" alt=""></div>
|
2022-12-05 16:24:24 +00:00
|
|
|
{{end}}
|
2022-11-06 17:19:13 +00:00
|
|
|
</td>
|
|
|
|
<!-- <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
|
|
<div class="text-gray-900" >aa</div>
|
|
|
|
</td> -->
|
|
|
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
2022-12-05 16:24:24 +00:00
|
|
|
{{if not .Data.administrator_unavailability}}
|
2022-11-06 17:19:13 +00:00
|
|
|
<div class="text-gray-900" >Du {{(timeFrom .Startdate).Format "02/01/2006"}} au {{(timeFrom .Enddate).Format "02/01/2006"}}</div>
|
2022-12-05 16:24:24 +00:00
|
|
|
{{else}}
|
|
|
|
<div class="text-gray-900" >Du {{(timeFrom .Unavailablefrom).Format "02/01/2006"}} au {{(timeFrom .Unavailableto).Format "02/01/2006"}}</div>
|
|
|
|
{{end}}
|
2022-11-06 17:19:13 +00:00
|
|
|
</td>
|
|
|
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
|
|
<a href="/app/vehicles/bookings/{{.ID}}"
|
|
|
|
class="text-co-blue hover:text-co-blue">Voir</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{{end}}
|