Compare commits
5 Commits
67d38ede79
...
0559e6705d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0559e6705d | ||
|
|
266dff039c | ||
|
|
2f6a368523 | ||
|
|
590bc4ff6a | ||
|
|
2f7c3165f1 |
13
config.yaml
13
config.yaml
@@ -73,6 +73,10 @@ views:
|
|||||||
files:
|
files:
|
||||||
- web/layouts/layout.html
|
- web/layouts/layout.html
|
||||||
- web/layouts/_partials/mainmenu.html
|
- web/layouts/_partials/mainmenu.html
|
||||||
|
search:
|
||||||
|
results:
|
||||||
|
files:
|
||||||
|
- web/layouts/search/results.html
|
||||||
dashboard:
|
dashboard:
|
||||||
files:
|
files:
|
||||||
- web/layouts/dashboard/_partials/agenda-widget.html
|
- web/layouts/dashboard/_partials/agenda-widget.html
|
||||||
@@ -133,6 +137,9 @@ views:
|
|||||||
- web/layouts/vehicles/search.html
|
- web/layouts/vehicles/search.html
|
||||||
booking_display:
|
booking_display:
|
||||||
files:
|
files:
|
||||||
|
- web/layouts/vehicles/_partials/booking_status_badge.html
|
||||||
|
- web/layouts/vehicles/_partials/booking_documents.html
|
||||||
|
- web/layouts/vehicles/_partials/booking_status_history.html
|
||||||
- web/layouts/vehicles/booking-display.html
|
- web/layouts/vehicles/booking-display.html
|
||||||
bookings_list:
|
bookings_list:
|
||||||
files:
|
files:
|
||||||
@@ -141,6 +148,8 @@ views:
|
|||||||
vehicles_management:
|
vehicles_management:
|
||||||
overview:
|
overview:
|
||||||
files:
|
files:
|
||||||
|
- web/layouts/vehicles_management/_partials/booking_filters.html
|
||||||
|
- web/layouts/vehicles_management/_partials/vehicle_filters.html
|
||||||
- web/layouts/vehicles_management/_partials/bookings-list.html
|
- web/layouts/vehicles_management/_partials/bookings-list.html
|
||||||
- web/layouts/vehicles_management/_partials/vehicles-list.html
|
- web/layouts/vehicles_management/_partials/vehicles-list.html
|
||||||
- web/layouts/vehicles_management/overview.html
|
- web/layouts/vehicles_management/overview.html
|
||||||
@@ -166,6 +175,9 @@ views:
|
|||||||
- web/layouts/vehicles_management/fleet-update.html
|
- web/layouts/vehicles_management/fleet-update.html
|
||||||
booking_display:
|
booking_display:
|
||||||
files:
|
files:
|
||||||
|
- web/layouts/vehicles/_partials/booking_status_badge.html
|
||||||
|
- web/layouts/vehicles/_partials/booking_documents.html
|
||||||
|
- web/layouts/vehicles/_partials/booking_status_history.html
|
||||||
- web/layouts/vehicles_management/booking-display.html
|
- web/layouts/vehicles_management/booking-display.html
|
||||||
delete_booking:
|
delete_booking:
|
||||||
files:
|
files:
|
||||||
@@ -435,6 +447,7 @@ icons:
|
|||||||
tabler-icons:bus: <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-bus %s" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><circle cx="6" cy="17" r="2" /><circle cx="18" cy="17" r="2" /><path d="M4 17h-2v-11a1 1 0 0 1 1 -1h14a5 7 0 0 1 5 7v5h-2m-4 0h-8" /><polyline points="16 5 17.5 12 22 12" /><line x1="2" y1="10" x2="17" y2="10" /><line x1="7" y1="5" x2="7" y2="10" /><line x1="12" y1="5" x2="12" y2="10" /></svg>
|
tabler-icons:bus: <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-bus %s" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><circle cx="6" cy="17" r="2" /><circle cx="18" cy="17" r="2" /><path d="M4 17h-2v-11a1 1 0 0 1 1 -1h14a5 7 0 0 1 5 7v5h-2m-4 0h-8" /><polyline points="16 5 17.5 12 22 12" /><line x1="2" y1="10" x2="17" y2="10" /><line x1="7" y1="5" x2="7" y2="10" /><line x1="12" y1="5" x2="12" y2="10" /></svg>
|
||||||
tabler-icons:train: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-train %s"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M21 13c0 -3.87 -3.37 -7 -10 -7h-8" /><path d="M3 15h16a2 2 0 0 0 2 -2" /><path d="M3 6v5h17.5" /><path d="M3 11v4" /><path d="M8 11v-5" /><path d="M13 11v-4.5" /><path d="M3 19h18" /></svg>
|
tabler-icons:train: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-train %s"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M21 13c0 -3.87 -3.37 -7 -10 -7h-8" /><path d="M3 15h16a2 2 0 0 0 2 -2" /><path d="M3 6v5h17.5" /><path d="M3 11v4" /><path d="M8 11v-5" /><path d="M13 11v-4.5" /><path d="M3 19h18" /></svg>
|
||||||
hero:outline/map-pin: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="M15 10.5a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25s-7.5-4.108-7.5-11.25a7.5 7.5 0 1115 0z" /></svg>
|
hero:outline/map-pin: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="M15 10.5a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25s-7.5-4.108-7.5-11.25a7.5 7.5 0 1115 0z" /></svg>
|
||||||
|
hero:outline/exclamation-triangle: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" /></svg>
|
||||||
hero:outline/flag: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="M3 3v1.5M3 21v-6m0 0l2.77-.693a9 9 0 016.208.682l.108.054a9 9 0 006.086.71l3.114-.732a48.524 48.524 0 01-.005-10.499l-3.11.732a9 9 0 01-6.085-.711l-.108-.054a9 9 0 00-6.208-.682L3 4.5M3 15V4.5" /></svg>
|
hero:outline/flag: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="M3 3v1.5M3 21v-6m0 0l2.77-.693a9 9 0 016.208.682l.108.054a9 9 0 006.086.71l3.114-.732a48.524 48.524 0 01-.005-10.499l-3.11.732a9 9 0 01-6.085-.711l-.108-.054a9 9 0 00-6.208-.682L3 4.5M3 15V4.5" /></svg>
|
||||||
|
|
||||||
emails:
|
emails:
|
||||||
|
|||||||
@@ -26,8 +26,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{template "vehicle_booking_filters" .}}
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
|
<div class="bg-white shadow sm:rounded-lg sm:overflow-hidden my-4">
|
||||||
{{template "bookings_list" .}}
|
{{template "vehicle_booking_filters" .}}
|
||||||
|
{{template "bookings_list" .}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<div class="flex-1 px-4 flex justify-between">
|
<div class="flex-1 px-4 flex justify-between">
|
||||||
<div class="flex-1 flex">
|
<div class="flex-1 flex">
|
||||||
<form class="w-full flex md:ml-0" action="/app/beneficiaries/" method="GET">
|
<form class="w-full flex md:ml-0" action="/app/search" method="GET">
|
||||||
<label for="search-field" class="sr-only">Search</label>
|
<label for="search-field" class="sr-only">Search</label>
|
||||||
<div class="relative w-full text-gray-400 focus-within:text-gray-600">
|
<div class="relative w-full text-gray-400 focus-within:text-gray-600">
|
||||||
<div class="absolute inset-y-0 left-0 flex items-center pointer-events-none">
|
<div class="absolute inset-y-0 left-0 flex items-center pointer-events-none">
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input id="search-field"
|
<input id="search-field"
|
||||||
class="block w-full h-full pl-8 pr-3 py-2 border-transparent text-gray-900 placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-0 focus:border-transparent sm:text-sm"
|
class="block w-full h-full pl-8 pr-3 py-2 border-transparent text-gray-900 placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-0 focus:border-transparent sm:text-sm"
|
||||||
placeholder="Chercher un bénéficiaire" type="search" name="search">
|
placeholder="Rechercher..." type="search" name="q">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
144
web/layouts/search/results.html
Normal file
144
web/layouts/search/results.html
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
{{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ésultats pour « {{.ViewState.query}} »</h1>
|
||||||
|
|
||||||
|
{{if moduleAvailable "beneficiaries"}}
|
||||||
|
<div class="mt-8">
|
||||||
|
<h2 class="text-lg font-medium text-gray-900">
|
||||||
|
Bénéficiaires
|
||||||
|
<span class="ml-2 inline-flex items-center justify-center w-6 h-6 rounded-full bg-co-blue text-xs font-medium text-white">{{len .ViewState.beneficiaries}}</span>
|
||||||
|
</h2>
|
||||||
|
{{if .ViewState.beneficiaries}}
|
||||||
|
<div class="mt-4 overflow-hidden shadow md:rounded-lg">
|
||||||
|
<table class="min-w-full divide-y divide-gray-300">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Nom</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Téléphone</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Adresse</th>
|
||||||
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6"><span class="sr-only">Voir</span></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-200 bg-white">
|
||||||
|
{{range .ViewState.beneficiaries}}
|
||||||
|
<tr>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="h-10 w-10 flex-shrink-0">
|
||||||
|
<img class="h-10 w-10 rounded-co" src="/app/beneficiaries/{{.ID}}/picture" alt="">
|
||||||
|
</div>
|
||||||
|
<div class="ml-4">
|
||||||
|
<div class="font-medium text-gray-900">{{.Data.first_name}} {{.Data.last_name}}</div>
|
||||||
|
<div class="text-gray-500">{{.Data.email}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{.Data.phone_number}}</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</td>
|
||||||
|
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
|
||||||
|
<a href="/app/beneficiaries/{{.ID}}" class="text-co-blue hover:text-co-blue">Voir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{end}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<p class="mt-2 text-sm text-gray-500">Aucun résultat</p>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{if moduleAvailable "solidarity_transport"}}
|
||||||
|
<div class="mt-8">
|
||||||
|
<h2 class="text-lg font-medium text-gray-900">
|
||||||
|
Conducteurs solidaires
|
||||||
|
<span class="ml-2 inline-flex items-center justify-center w-6 h-6 rounded-full bg-co-blue text-xs font-medium text-white">{{len .ViewState.solidarity_drivers}}</span>
|
||||||
|
</h2>
|
||||||
|
{{if .ViewState.solidarity_drivers}}
|
||||||
|
<div class="mt-4 overflow-hidden shadow md:rounded-lg">
|
||||||
|
<table class="min-w-full divide-y divide-gray-300">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Nom</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Adresse</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Téléphone</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Profil validé</th>
|
||||||
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6"><span class="sr-only">Voir</span></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-200 bg-white">
|
||||||
|
{{range .ViewState.solidarity_drivers}}
|
||||||
|
<tr>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6">{{.Data.first_name}} {{.Data.last_name}}</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{.Data.phone_number}}</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||||
|
{{if solidarityDriverValidatedProfile . (solidarityDocuments .ID)}}
|
||||||
|
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
|
||||||
|
{{else}}
|
||||||
|
<span class="p-1 px-2 text-xs bg-co-red text-white rounded-2xl">Non</span>
|
||||||
|
{{end}}
|
||||||
|
</td>
|
||||||
|
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
|
||||||
|
<a href="/app/solidarity-transport/drivers/{{.ID}}" class="text-co-blue hover:text-co-blue">Voir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{end}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<p class="mt-2 text-sm text-gray-500">Aucun résultat</p>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{if moduleAvailable "organized_carpool"}}
|
||||||
|
<div class="mt-8">
|
||||||
|
<h2 class="text-lg font-medium text-gray-900">
|
||||||
|
Conducteurs covoiturage
|
||||||
|
<span class="ml-2 inline-flex items-center justify-center w-6 h-6 rounded-full bg-co-blue text-xs font-medium text-white">{{len .ViewState.organized_carpool_drivers}}</span>
|
||||||
|
</h2>
|
||||||
|
{{if .ViewState.organized_carpool_drivers}}
|
||||||
|
<div class="mt-4 overflow-hidden shadow md:rounded-lg">
|
||||||
|
<table class="min-w-full divide-y divide-gray-300">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Nom</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Adresse départ</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Adresse destination</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Téléphone</th>
|
||||||
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Profil validé</th>
|
||||||
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6"><span class="sr-only">Voir</span></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-200 bg-white">
|
||||||
|
{{range .ViewState.organized_carpool_drivers}}
|
||||||
|
<tr>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6">{{.Data.first_name}} {{.Data.last_name}}</td>
|
||||||
|
<td class="px-3 py-4 text-sm text-gray-500">{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</td>
|
||||||
|
<td class="px-3 py-4 text-sm text-gray-500">{{if .Data.address_destination}}{{.Data.address_destination.properties.label}}{{end}}</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{.Data.phone_number}}</td>
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||||
|
{{if carpoolDriverValidatedProfile . (carpoolDocuments .ID)}}
|
||||||
|
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
|
||||||
|
{{else}}
|
||||||
|
<span class="p-1 px-2 text-xs bg-co-red text-white rounded-2xl">Non</span>
|
||||||
|
{{end}}
|
||||||
|
</td>
|
||||||
|
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
|
||||||
|
<a href="/app/organized-carpool/drivers/{{.ID}}" class="text-co-blue hover:text-co-blue">Voir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{end}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<p class="mt-2 text-sm text-gray-500">Aucun résultat</p>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
51
web/layouts/vehicles/_partials/booking_documents.html
Normal file
51
web/layouts/vehicles/_partials/booking_documents.html
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{{define "booking_documents"}}
|
||||||
|
<div>
|
||||||
|
<p class="text-sm font-medium text-gray-500 my-4">Documents</p>
|
||||||
|
{{if eq (len .ViewState.documents) 0}}
|
||||||
|
<p class="p-12 text-gray-500 text-center text-md">Aucun document</p>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
|
||||||
|
{{if gt (len .ViewState.documents) 0}}
|
||||||
|
|
||||||
|
<div class="-mx-4 mb-10 ring-1 ring-gray-300 sm:-mx-6 md:mx-0 md:rounded-lg">
|
||||||
|
<table class="min-w-full divide-y divide-gray-300 table-fixed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Type</th>
|
||||||
|
<th scope="col" class="hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell">Nom du document</th>
|
||||||
|
<th scope="col" class="hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell">Ajouté le</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>
|
||||||
|
{{range .ViewState.documents}}
|
||||||
|
<tr>
|
||||||
|
<td class="relative py-4 pl-4 sm:pl-6 pr-3 text-sm">
|
||||||
|
<div class="font-medium text-gray-900">
|
||||||
|
<span class="bg-co-blue text-xs text-white rounded-xl p-1 mr-2">{{index $.ViewState.file_types_map .Metadata.Type}}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-3 py-3.5 text-sm text-gray-900 table-cell max-w-10 overflow-hidden">
|
||||||
|
<p class=" overflow-hidden">{{.Metadata.Name}}</p>
|
||||||
|
</td>
|
||||||
|
<td class="px-3 py-3.5 text-sm text-gray-500 lg:table-cell">{{.LastModified.Format "02/01/2006"}}</td>
|
||||||
|
<td class="relative py-3.5 pl-3 pr-4 sm:pr-6 text-right text-sm font-medium">
|
||||||
|
<a href="/app/vehicles/bookings/{{$.ViewState.booking.ID}}/documents/{{.FileName}}" target="_blank">
|
||||||
|
<button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le document</span></button>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
|
||||||
|
<!-- More plans... -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
16
web/layouts/vehicles/_partials/booking_status_badge.html
Normal file
16
web/layouts/vehicles/_partials/booking_status_badge.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{{define "booking_status_badge"}}
|
||||||
|
{{if eq .ViewState.status_management "manual"}}
|
||||||
|
{{$currentStatus := .ViewState.booking.ManualStatus}}
|
||||||
|
{{range .ViewState.status_options}}
|
||||||
|
{{if eq (index . "name") $currentStatus}}
|
||||||
|
{{if eq (index . "meta_status") "open"}}
|
||||||
|
<span class="ml-2 p-1 px-3 text-xs bg-co-blue text-white rounded-2xl align-middle">{{index . "label"}}</span>
|
||||||
|
{{else if eq (index . "meta_status") "active"}}
|
||||||
|
<span class="ml-2 p-1 px-3 text-xs bg-co-green text-white rounded-2xl align-middle">{{index . "label"}}</span>
|
||||||
|
{{else if eq (index . "meta_status") "closed"}}
|
||||||
|
<span class="ml-2 p-1 px-3 text-xs bg-co-red text-white rounded-2xl align-middle">{{index . "label"}}</span>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
43
web/layouts/vehicles/_partials/booking_status_history.html
Normal file
43
web/layouts/vehicles/_partials/booking_status_history.html
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{{define "booking_status_history"}}
|
||||||
|
{{if eq .ViewState.status_management "manual"}}
|
||||||
|
{{if .ViewState.booking.StatusHistory}}
|
||||||
|
<div class="py-4 sm:py-5">
|
||||||
|
<p class="text-sm font-medium text-gray-500 mb-4">Historique des statuts</p>
|
||||||
|
<div class="flow-root">
|
||||||
|
<ul role="list" class="-mb-8">
|
||||||
|
{{range .ViewState.booking.StatusHistory}}
|
||||||
|
<li>
|
||||||
|
<div class="relative pb-8">
|
||||||
|
<div class="relative flex space-x-3">
|
||||||
|
<div>
|
||||||
|
<span class="h-8 w-8 rounded-full bg-gray-200 flex items-center justify-center ring-8 ring-white">
|
||||||
|
<svg class="h-4 w-4 text-gray-500" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5" />
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
|
||||||
|
<div>
|
||||||
|
<p class="text-sm text-gray-500">
|
||||||
|
{{if .FromStatus}}{{$from := .FromStatus}}{{range $.ViewState.status_options}}{{if eq (index . "name") $from}}{{index . "label"}}{{end}}{{end}} → {{end}}{{$to := .ToStatus}}{{range $.ViewState.status_options}}{{if eq (index . "name") $to}}{{index . "label"}}{{end}}{{end}}
|
||||||
|
par <a href="/app/members/{{.UserID}}" class="font-medium text-co-blue hover:underline">{{.UserName}}</a>
|
||||||
|
({{.GroupName}})
|
||||||
|
</p>
|
||||||
|
{{if .Comment}}
|
||||||
|
<p class="mt-1 text-xs text-gray-400">{{.Comment}}</p>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
<div class="whitespace-nowrap text-right text-sm text-gray-500">
|
||||||
|
{{.Date.Format "02/01/2006 15:04"}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
@@ -72,7 +72,10 @@
|
|||||||
<div class="bg-white px-4 py-5 border-b border-gray-200 sm:px-6">
|
<div class="bg-white px-4 py-5 border-b border-gray-200 sm:px-6">
|
||||||
<div class="-ml-4 -mt-4 flex justify-between items-center flex-wrap sm:flex-nowrap">
|
<div class="-ml-4 -mt-4 flex justify-between items-center flex-wrap sm:flex-nowrap">
|
||||||
<div class="ml-4 mt-4">
|
<div class="ml-4 mt-4">
|
||||||
<h3 class="text-lg leading-6 font-medium text-gray-900">Réservation</h3>
|
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||||
|
Réservation
|
||||||
|
{{template "booking_status_badge" .}}
|
||||||
|
</h3>
|
||||||
<p class="mt-1 text-sm text-gray-500">Informations utiles sur la réservation.</p>
|
<p class="mt-1 text-sm text-gray-500">Informations utiles sur la réservation.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-4 mt-4 flex-shrink-0">
|
<div class="ml-4 mt-4 flex-shrink-0">
|
||||||
@@ -101,9 +104,7 @@
|
|||||||
<dt class="text-sm font-medium text-gray-500">Réservé par</dt>
|
<dt class="text-sm font-medium text-gray-500">Réservé par</dt>
|
||||||
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||||
{{if .ViewState.booking.Data.booked_by.user}}
|
{{if .ViewState.booking.Data.booked_by.user}}
|
||||||
<a href="/app/members/{{.ViewState.booking.Data.booked_by.user.id}}" class="flex inline">
|
<a href="/app/members/{{.ViewState.booking.Data.booked_by.user.id}}" class="text-co-blue hover:underline">
|
||||||
<img class="h-5 w-5 rounded-co mr-1"
|
|
||||||
src="/app/members/{{.ViewState.booking.Data.booked_by.user.id}}/picture" alt="">
|
|
||||||
{{.ViewState.booking.Data.booked_by.user.display_name}}
|
{{.ViewState.booking.Data.booked_by.user.display_name}}
|
||||||
</a>
|
</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
@@ -141,55 +142,8 @@
|
|||||||
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">{{(timeFrom .ViewState.booking.Enddate).Format
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">{{(timeFrom .ViewState.booking.Enddate).Format
|
||||||
"02/01/2006 à 15:04"}}</dd>
|
"02/01/2006 à 15:04"}}</dd>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
{{template "booking_documents" .}}
|
||||||
<p class="text-sm font-medium text-gray-500 my-4">Documents</p>
|
{{template "booking_status_history" .}}
|
||||||
{{if eq (len .ViewState.documents) 0}}
|
|
||||||
<p class="p-12 text-gray-500 text-center text-md">Aucun document</p>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
|
|
||||||
{{if gt (len .ViewState.documents) 0}}
|
|
||||||
|
|
||||||
<div class="-mx-4 mb-10 ring-1 ring-gray-300 sm:-mx-6 md:mx-0 md:rounded-lg">
|
|
||||||
<table class="min-w-full divide-y divide-gray-300 table-fixed">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Type</th>
|
|
||||||
<th scope="col" class="hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell">Nom du document</th>
|
|
||||||
<th scope="col" class="hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell">Ajouté le</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>
|
|
||||||
{{range .ViewState.documents}}
|
|
||||||
<tr>
|
|
||||||
<td class="relative py-4 pl-4 sm:pl-6 pr-3 text-sm">
|
|
||||||
<div class="font-medium text-gray-900">
|
|
||||||
<span class="bg-co-blue text-xs text-white rounded-xl p-1 mr-2">{{index $.ViewState.file_types_map .Metadata.Type}}</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="px-3 py-3.5 text-sm text-gray-900 table-cell max-w-10 overflow-hidden">
|
|
||||||
<p class=" overflow-hidden">{{.Metadata.Name}}</p>
|
|
||||||
</td>
|
|
||||||
<td class="px-3 py-3.5 text-sm text-gray-500 lg:table-cell">{{.LastModified.Format "02/01/2006"}}</td>
|
|
||||||
<td class="relative py-3.5 pl-3 pr-4 sm:pr-6 text-right text-sm font-medium">
|
|
||||||
<a href="/app/vehicles/bookings/{{$.ViewState.booking.ID}}/documents/{{.FileName}}" target="_blank">
|
|
||||||
<button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le document</span></button>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
|
|
||||||
<!-- More plans... -->
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -63,6 +63,19 @@
|
|||||||
<span class="p-1 bg-black text-white text-xs font-bold rounded-xl" >
|
<span class="p-1 bg-black text-white text-xs font-bold rounded-xl" >
|
||||||
Retiré
|
Retiré
|
||||||
</span>
|
</span>
|
||||||
|
{{else if eq $.ViewState.status_management "manual"}}
|
||||||
|
{{$manualStatus := .ManualStatus}}
|
||||||
|
{{range $.ViewState.status_options}}
|
||||||
|
{{if eq (index . "name") $manualStatus}}
|
||||||
|
{{if eq (index . "meta_status") "open"}}
|
||||||
|
<span class="p-1 px-2 text-xs bg-co-blue text-white font-bold rounded-xl">{{index . "label"}}</span>
|
||||||
|
{{else if eq (index . "meta_status") "active"}}
|
||||||
|
<span class="p-1 px-2 text-xs bg-co-green text-white font-bold rounded-xl">{{index . "label"}}</span>
|
||||||
|
{{else if eq (index . "meta_status") "closed"}}
|
||||||
|
<span class="p-1 px-2 text-xs bg-co-red text-white font-bold rounded-xl">{{index . "label"}}</span>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{if eq .Status 1 }}
|
{{if eq .Status 1 }}
|
||||||
<span class="p-1 bg-co-blue text-white text-xs font-bold rounded-xl" >
|
<span class="p-1 bg-co-blue text-white text-xs font-bold rounded-xl" >
|
||||||
|
|||||||
@@ -89,11 +89,13 @@
|
|||||||
|
|
||||||
<!-- {{ $fieldName := "address" }}
|
<!-- {{ $fieldName := "address" }}
|
||||||
{{ template "address_autocomplete" dict "FieldName" $fieldName }} -->
|
{{ template "address_autocomplete" dict "FieldName" $fieldName }} -->
|
||||||
<div class="py-4 grid grid-cols-2">
|
<div class="py-4 grid grid-cols-2"
|
||||||
|
x-data="{ defaultDurationDays: {{.ViewState.default_booking_duration_days}} }">
|
||||||
<div class="lg:col-span-1">
|
<div class="lg:col-span-1">
|
||||||
<label for="startdate" class="block text-sm font-medium text-gray-700">Du <span class="text-red-600">*</span></label>
|
<label for="startdate" class="block text-sm font-medium text-gray-700">Du <span class="text-red-600">*</span></label>
|
||||||
<div class="mt-1">
|
<div class="mt-1">
|
||||||
<input type="date" id="startdate" name="startdate" value="{{if .ViewState.search}}{{(timeFrom .ViewState.search.startdate).Format "2006-01-02"}}{{end}}" required
|
<input type="date" id="startdate" name="startdate" value="{{if .ViewState.search}}{{(timeFrom .ViewState.search.startdate).Format "2006-01-02"}}{{end}}" required
|
||||||
|
@change="if ($event.target.value && !document.getElementById('enddate').value) { const d = new Date($event.target.value); d.setDate(d.getDate() + defaultDurationDays); document.getElementById('enddate').value = d.toISOString().split('T')[0]; }"
|
||||||
class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-l-2xl border-r-1">
|
class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-l-2xl border-r-1">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
{{ define "vehicle_booking_filters" }}
|
{{ define "vehicle_booking_filters" }}
|
||||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
<div class="px-4 sm:px-6 md:px-8">
|
||||||
<form>
|
<form>
|
||||||
|
|
||||||
|
<input type="hidden" name="tab" value="bookings" />
|
||||||
|
{{if .ViewState.filters.v_type}}<input type="hidden" name="v_type" value="{{.ViewState.filters.v_type}}" />{{end}}
|
||||||
|
{{if .ViewState.filters.v_status}}<input type="hidden" name="v_status" value="{{.ViewState.filters.v_status}}" />{{end}}
|
||||||
|
|
||||||
<div class="flex flex-row justify-end flex-wrap">
|
<div class="flex flex-row justify-end flex-wrap">
|
||||||
|
|
||||||
|
{{if not .ViewState.hide_date_filters}}
|
||||||
<div class="m-4">
|
<div class="m-4">
|
||||||
<div>
|
<div>
|
||||||
<label for="vehicles_date_start" class="block text-sm/6 font-medium text-gray-900 dark:text-white">Dates (début / fin)</label>
|
<label for="vehicles_date_start" class="block text-sm/6 font-medium text-gray-900 dark:text-white">Dates (début / fin)</label>
|
||||||
@@ -13,16 +18,46 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{if .ViewState.vehicle_types}}
|
||||||
|
<div class="m-4">
|
||||||
|
<label for="vehicles_vehicle_type" class="block text-sm/6 font-medium text-gray-900 dark:text-white">Type de véhicule</label>
|
||||||
|
<div class="mt-2 grid grid-cols-1">
|
||||||
|
<select id="vehicles_vehicle_type" name="vehicle_type" class="col-start-1 row-start-1 w-full appearance-none rounded-md bg-white py-1.5 pr-8 pl-3 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-indigo-600 sm:text-sm/6 dark:bg-white/5 dark:text-white dark:outline-white/10 dark:*:bg-gray-800 dark:focus-visible:outline-co-blue" onchange="this.form.submit()">
|
||||||
|
<option></option>
|
||||||
|
{{range .ViewState.vehicle_types}}
|
||||||
|
<option value="{{.}}"{{if eq $.ViewState.filters.vehicle_type .}} selected{{end}}>{{.}}</option>
|
||||||
|
{{end}}
|
||||||
|
</select>
|
||||||
|
<svg viewBox="0 0 16 16" fill="currentColor" data-slot="icon" aria-hidden="true" class="pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4 dark:text-gray-400">
|
||||||
|
<path d="M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" fill-rule="evenodd" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
<div class="m-4">
|
<div class="m-4">
|
||||||
<label for="vehicles_status" class="block text-sm/6 font-medium text-gray-900 dark:text-white">Statut</label>
|
<label for="vehicles_status" class="block text-sm/6 font-medium text-gray-900 dark:text-white">Statut</label>
|
||||||
<div class="mt-2 grid grid-cols-1">
|
<div class="mt-2 grid grid-cols-1">
|
||||||
<select id="vehicles_status" name="status" class="col-start-1 row-start-1 w-full appearance-none rounded-md bg-white py-1.5 pr-8 pl-3 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-indigo-600 sm:text-sm/6 dark:bg-white/5 dark:text-white dark:outline-white/10 dark:*:bg-gray-800 dark:focus-visible:outline-co-blue" onchange="this.form.submit()">
|
<select id="vehicles_status" name="status" class="col-start-1 row-start-1 w-full appearance-none rounded-md bg-white py-1.5 pr-8 pl-3 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-indigo-600 sm:text-sm/6 dark:bg-white/5 dark:text-white dark:outline-white/10 dark:*:bg-gray-800 dark:focus-visible:outline-co-blue" onchange="this.form.submit()">
|
||||||
<option></option>
|
<option value="">Tous</option>
|
||||||
|
{{if eq .ViewState.status_management "manual"}}
|
||||||
|
<optgroup label="Par catégorie">
|
||||||
|
<option value="meta:open,active"{{if eq $.ViewState.filters.status "meta:open,active"}} selected{{end}}>Actifs ({{$first := true}}{{range $.ViewState.status_options}}{{$ms := index . "meta_status"}}{{if or (eq $ms "open") (eq $ms "active")}}{{if not $first}}, {{end}}{{$first = false}}{{index . "label"}}{{end}}{{end}})</option>
|
||||||
|
<option value="meta:closed"{{if eq $.ViewState.filters.status "meta:closed"}} selected{{end}}>Clôturés ({{$first := true}}{{range $.ViewState.status_options}}{{$ms := index . "meta_status"}}{{if eq $ms "closed"}}{{if not $first}}, {{end}}{{$first = false}}{{index . "label"}}{{end}}{{end}})</option>
|
||||||
|
</optgroup>
|
||||||
|
<optgroup label="Par statut">
|
||||||
|
{{range .ViewState.status_options}}
|
||||||
|
<option value="{{index . "name"}}"{{if eq $.ViewState.filters.status (index . "name")}} selected{{end}}>{{index . "label"}}</option>
|
||||||
|
{{end}}
|
||||||
|
</optgroup>
|
||||||
|
{{else}}
|
||||||
<option value="FORTHCOMING"{{if eq .ViewState.filters.status "FORTHCOMING"}} selected{{end}}>A venir</option>
|
<option value="FORTHCOMING"{{if eq .ViewState.filters.status "FORTHCOMING"}} selected{{end}}>A venir</option>
|
||||||
<option value="ONGOING"{{if eq .ViewState.filters.status "ONGOING"}} selected{{end}}>En cours</option>
|
<option value="ONGOING"{{if eq .ViewState.filters.status "ONGOING"}} selected{{end}}>En cours</option>
|
||||||
<option value="TERMINATED"{{if eq .ViewState.filters.status "TERMINATED"}} selected{{end}}>Terminé</option>
|
<option value="TERMINATED"{{if eq .ViewState.filters.status "TERMINATED"}} selected{{end}}>Terminé</option>
|
||||||
<option value="CANCELLED"{{if eq .ViewState.filters.status "CANCELLED"}} selected{{end}}>Annulé</option>
|
<option value="CANCELLED"{{if eq .ViewState.filters.status "CANCELLED"}} selected{{end}}>Annulé</option>
|
||||||
|
{{end}}
|
||||||
</select>
|
</select>
|
||||||
<svg viewBox="0 0 16 16" fill="currentColor" data-slot="icon" aria-hidden="true" class="pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4 dark:text-gray-400">
|
<svg viewBox="0 0 16 16" fill="currentColor" data-slot="icon" aria-hidden="true" class="pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4 dark:text-gray-400">
|
||||||
<path d="M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" fill-rule="evenodd" />
|
<path d="M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" fill-rule="evenodd" />
|
||||||
@@ -30,10 +65,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="m-4">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,107 +1,125 @@
|
|||||||
{{define "bookings_list"}}
|
{{define "bookings_list"}}
|
||||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
<table class="min-w-full divide-y divide-gray-300 border-gray-300 border-t-1">
|
||||||
<div class="mt-8 flex flex-col">
|
<thead class="bg-gray-50">
|
||||||
<div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
|
<tr>
|
||||||
<div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
|
<th scope="col"
|
||||||
<div class="overflow-hidden shadow md:rounded-lg">
|
class="py-3.5 pl-4 pr-3 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
<table class="min-w-full divide-y divide-gray-300">
|
Statut
|
||||||
<thead class="bg-gray-50">
|
</th>
|
||||||
<tr>
|
<th scope="col" class="px-3 py-3.5 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
<th scope="col"
|
Type
|
||||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 text-center">
|
</th>
|
||||||
Statut
|
<th scope="col" class="px-3 py-3.5 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
</th>
|
Numéro (Immat / Bicycode)
|
||||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
</th>
|
||||||
Type
|
<th scope="col" class="px-3 py-3.5 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
</th>
|
Beneficiaire
|
||||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
</th>
|
||||||
Numéro (Immat / Bicycode)
|
<th scope="col" class="px-3 py-3.5 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
</th>
|
Dates
|
||||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
</th>
|
||||||
Beneficiaire
|
<th scope="col" class="px-3 py-3.5 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
||||||
Dates
|
<span class="sr-only">Actions</span>
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
</tr>
|
||||||
Commentaire
|
</thead>
|
||||||
</th>
|
<tbody class="divide-y divide-gray-200 bg-white">
|
||||||
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
{{range .ViewState.bookings}}
|
||||||
<span class="sr-only">Actions</span>
|
<tr>
|
||||||
</th>
|
<td class="flex-col py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
|
||||||
</tr>
|
{{if .Data.administrator_unavailability}}
|
||||||
</thead>
|
<span class="p-1 bg-black text-white text-xs font-bold rounded-xl" >
|
||||||
<tbody class="divide-y divide-gray-200 bg-white">
|
Retiré
|
||||||
{{range .ViewState.bookings}}
|
</span>
|
||||||
<tr>
|
{{else if and (eq $.ViewState.status_management "manual") (not .Deleted)}}
|
||||||
<td class="flex-col py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
|
{{$manualStatus := .ManualStatus}}
|
||||||
{{if .Data.administrator_unavailability}}
|
{{range $.ViewState.status_options}}
|
||||||
<span class="p-1 bg-black text-white text-xs font-bold rounded-xl" >
|
{{if eq (index . "name") $manualStatus}}
|
||||||
Retiré
|
{{if eq (index . "meta_status") "open"}}
|
||||||
</span>
|
<span class="p-1 px-2 text-xs bg-co-blue text-white font-bold rounded-xl">{{index . "label"}}</span>
|
||||||
{{else if .Deleted}}
|
{{else if eq (index . "meta_status") "active"}}
|
||||||
<span class="p-1 bg-black text-white text-xs font-bold rounded-xl" >
|
<span class="p-1 px-2 text-xs bg-co-green text-white font-bold rounded-xl">{{index . "label"}}</span>
|
||||||
Annulé
|
{{else if eq (index . "meta_status") "closed"}}
|
||||||
</span>
|
<span class="p-1 px-2 text-xs bg-co-red text-white font-bold rounded-xl">{{index . "label"}}</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>
|
|
||||||
<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).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>
|
|
||||||
</td>
|
|
||||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
||||||
{{if .Data.administrator_unavailability}}
|
|
||||||
<div class="text-gray-900" ></div>
|
|
||||||
{{else}}
|
|
||||||
<div class="text-gray-900" >
|
|
||||||
<!--<img class="h-6 w-6 rounded-co" src="/app/beneficiaries/{{.Driver}}/picture" alt="">-->
|
|
||||||
{{ (index $.ViewState.drivers_map .Driver).Data.first_name }}
|
|
||||||
{{ (index $.ViewState.drivers_map .Driver).Data.last_name }}
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</td>
|
|
||||||
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
||||||
{{if .Data.administrator_unavailability}}
|
|
||||||
<div class="text-gray-900" >Retiré du {{(timeFrom .Unavailablefrom).Format "02/01/2006"}} au {{(timeFrom .Unavailableto).Format "02/01/2006"}}</div>
|
|
||||||
{{else}}
|
|
||||||
<div class="text-gray-900" >
|
|
||||||
<div>Du {{(timeFrom .Startdate).Format "02/01/2006 à 15:04"}}</div>
|
|
||||||
<div>au {{(timeFrom .Enddate).Format "02/01/2006 à 15:04"}}</div>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</td>
|
|
||||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
||||||
<div class="text-gray-900" >{{ .Data.comment }}</div>
|
|
||||||
</td>
|
|
||||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
||||||
<a href="/app/vehicles-management/bookings/{{.ID}}"
|
|
||||||
class="text-co-blue hover:text-co-blue">Voir</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{end}}
|
{{end}}
|
||||||
</tbody>
|
{{end}}
|
||||||
</table>
|
{{end}}
|
||||||
|
{{else if .Deleted}}
|
||||||
|
<span class="p-1 bg-black text-white text-xs font-bold rounded-xl" >
|
||||||
|
Annulé
|
||||||
|
</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>
|
||||||
|
<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).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>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
{{if .Data.administrator_unavailability}}
|
||||||
|
<div class="text-gray-900" ></div>
|
||||||
|
{{else}}
|
||||||
|
<div class="text-gray-900" >
|
||||||
|
{{ (index $.ViewState.drivers_map .Driver).Data.first_name }}
|
||||||
|
{{ (index $.ViewState.drivers_map .Driver).Data.last_name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{end}}
|
||||||
</div>
|
</td>
|
||||||
</div>
|
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
</div>
|
{{if .Data.administrator_unavailability}}
|
||||||
|
<div class="text-gray-900" >Retiré du {{(timeFrom .Unavailablefrom).Format "02/01/2006"}} au {{(timeFrom .Unavailableto).Format "02/01/2006"}}</div>
|
||||||
|
{{else}}
|
||||||
|
<div class="text-gray-900" >
|
||||||
|
<div>Du {{(timeFrom .Startdate).Format "02/01/2006 à 15:04"}}</div>
|
||||||
|
<div>au {{(timeFrom .Enddate).Format "02/01/2006 à 15:04"}}</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
</td>
|
||||||
|
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
|
||||||
|
{{if and (eq $.ViewState.status_management "manual") (not .Data.administrator_unavailability) (not .Deleted)}}
|
||||||
|
{{$manualStatus := .ManualStatus}}
|
||||||
|
{{$startdate := .Startdate}}
|
||||||
|
{{$enddate := .Enddate}}
|
||||||
|
{{range $.ViewState.status_options}}
|
||||||
|
{{if eq (index . "name") $manualStatus}}
|
||||||
|
{{if and (eq (index . "meta_status") "open") (isPast $startdate)}}
|
||||||
|
<span class="text-red-600" title="Retard : la date de début de réservation est dépassée">
|
||||||
|
{{$.IconSet.Icon "hero:outline/exclamation-triangle" "h-6 w-6 inline-block"}}
|
||||||
|
</span>
|
||||||
|
{{else if and (eq (index . "meta_status") "active") (isPast $enddate)}}
|
||||||
|
<span class="text-red-600" title="Retard : la date de fin de réservation est dépassée">
|
||||||
|
{{$.IconSet.Icon "hero:outline/exclamation-triangle" "h-6 w-6 inline-block"}}
|
||||||
|
</span>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<a href="/app/vehicles-management/bookings/{{.ID}}"
|
||||||
|
class="text-co-blue hover:text-co-blue">Voir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{end}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@@ -1,124 +1,95 @@
|
|||||||
{{define "vehicles_list"}}
|
{{define "vehicles_list"}}
|
||||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
<table class="min-w-full divide-y divide-gray-300 border-gray-300 border-t-1">
|
||||||
<div class="mt-8 flex flex-col">
|
<thead class="bg-gray-50">
|
||||||
<div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
|
<tr>
|
||||||
<div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
|
<th scope="col"
|
||||||
<div class="overflow-hidden shadow md:rounded-lg">
|
class="py-3.5 pl-4 pr-3 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
<table class="min-w-full divide-y divide-gray-300">
|
Disponibilité
|
||||||
<thead class="bg-gray-50">
|
</th>
|
||||||
<tr>
|
<th scope="col"
|
||||||
<th scope="col"
|
class="py-3.5 pl-4 pr-3 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
Numéro (Immat / Bicycode)
|
||||||
Statut Réservation
|
</th>
|
||||||
</th>
|
<th scope="col" class="px-3 py-3.5 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
<th scope="col"
|
Type
|
||||||
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
</th>
|
||||||
Numéro (Immat / Bicycode)
|
<th scope="col" class="px-3 py-3.5 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
</th>
|
Modèle
|
||||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
</th>
|
||||||
Type
|
<th scope="col" class="px-3 py-3.5 text-center text-sm font-semibold text-gray-900 sm:pl-6">
|
||||||
</th>
|
Lieu
|
||||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
</th>
|
||||||
Modèle
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
||||||
</th>
|
<span class="sr-only">Actions</span>
|
||||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
|
</th>
|
||||||
Lieu
|
</tr>
|
||||||
</th>
|
</thead>
|
||||||
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
<tbody class="divide-y divide-gray-200 bg-white">
|
||||||
<span class="sr-only">Actions</span>
|
{{range .ViewState.vehicles}}
|
||||||
</th>
|
<tr>
|
||||||
</tr>
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
|
||||||
</thead>
|
<div class="flex flex-col px-6">
|
||||||
<tbody class="divide-y divide-gray-200 bg-white">
|
{{if not .Bookings}}
|
||||||
{{range .ViewState.vehicles}}
|
<span class="mt-1 p-1 bg-co-green text-white text-xs font-bold rounded-xl">
|
||||||
<tr>
|
Disponible
|
||||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
|
</span>
|
||||||
<div class="flex flex-col px-6">
|
{{else}}
|
||||||
{{if not .Bookings}}
|
{{$hasActive := false}}
|
||||||
<span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" >
|
{{$hasUpcoming := false}}
|
||||||
Disponible
|
{{$hasRetired := false}}
|
||||||
</span>
|
{{range .Bookings}}
|
||||||
{{else if len .Bookings | eq 1}}
|
{{if .Data.administrator_unavailability}}
|
||||||
{{range .Bookings}}
|
{{$hasRetired = true}}
|
||||||
{{if .Data.administrator_unavailability}}
|
{{else if eq .Status 0}}
|
||||||
<span class="mt-1 p-1 bg-black text-white text-xs font-bold rounded-xl" >
|
{{$hasActive = true}}
|
||||||
Retiré
|
{{else if eq .Status 1}}
|
||||||
</span>
|
{{$hasUpcoming = true}}
|
||||||
{{else if eq .Status -1 }}
|
{{end}}
|
||||||
<span class="mt-1 p-1 bg-gray-500 text-white text-xs font-bold rounded-xl" >
|
{{end}}
|
||||||
Disponible
|
{{if $hasRetired}}
|
||||||
</span>
|
<span class="mt-1 p-1 bg-black text-white text-xs font-bold rounded-xl">
|
||||||
{{else if eq .Status 1 }}
|
Retiré
|
||||||
<span class="mt-1 p-1 bg-co-blue text-white text-xs font-bold rounded-xl" >
|
</span>
|
||||||
A venir
|
{{end}}
|
||||||
</span>
|
{{if $hasActive}}
|
||||||
{{else if eq .Status 0 }}
|
<span class="mt-1 p-1 bg-co-red 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 prêt
|
||||||
En cours
|
</span>
|
||||||
</span>
|
{{else if $hasUpcoming}}
|
||||||
{{end}}
|
<span class="mt-1 p-1 bg-co-blue text-white text-xs font-bold rounded-xl">
|
||||||
{{end}}
|
Réservé
|
||||||
{{else if gt (len .Bookings) 1}}
|
</span>
|
||||||
{{range .Bookings}}
|
{{else if not $hasRetired}}
|
||||||
{{if .Data.administrator_unavailability}}
|
<span class="mt-1 p-1 bg-co-green text-white text-xs font-bold rounded-xl">
|
||||||
<span class="mt-1 p-1 bg-black text-white text-xs font-bold rounded-xl" >
|
Disponible
|
||||||
Retiré
|
</span>
|
||||||
</span>
|
{{end}}
|
||||||
{{else}}
|
{{end}}
|
||||||
{{if eq .Status 1 }}
|
|
||||||
<span class="mt-1 p-1 bg-co-blue text-white text-xs font-bold rounded-xl" >
|
|
||||||
A venir
|
|
||||||
</span>
|
|
||||||
{{else if eq .Status 0 }}
|
|
||||||
<span class="mt-1 p-1 bg-co-green text-white text-xs font-bold rounded-xl" >
|
|
||||||
En cours
|
|
||||||
</span>
|
|
||||||
{{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>
|
|
||||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
||||||
<div class="text-gray-900" >{{.Data.licence_plate}}</div>
|
|
||||||
</td>
|
|
||||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
||||||
<div class="text-gray-900" >
|
|
||||||
{{.Type}}
|
|
||||||
{{if eq .Type "Voiture"}}
|
|
||||||
{{ if .Data.automatic}} (boite auto){{ end }}
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
||||||
<div class="text-gray-900" >{{.Data.name}}</div>
|
|
||||||
</td>
|
|
||||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
||||||
<div class="text-gray-900" >{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</div>
|
|
||||||
</td>
|
|
||||||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
|
||||||
<a href="/app/vehicles-management/fleet/{{.ID}}"
|
|
||||||
class="text-co-blue hover:text-co-blue">Voir</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{end}}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
</div>
|
<div class="text-gray-900" >{{.Data.licence_plate}}</div>
|
||||||
</div>
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >
|
||||||
|
{{.Type}}
|
||||||
|
{{if eq .Type "Voiture"}}
|
||||||
|
{{ if .Data.automatic}} (boite auto){{ end }}
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >{{.Data.name}}</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<div class="text-gray-900" >{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</div>
|
||||||
|
</td>
|
||||||
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
|
||||||
|
<a href="/app/vehicles-management/fleet/{{.ID}}"
|
||||||
|
class="text-co-blue hover:text-co-blue">Voir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{end}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@@ -9,7 +9,30 @@
|
|||||||
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none"
|
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none"
|
||||||
x-data="{
|
x-data="{
|
||||||
changeVehicle: false,
|
changeVehicle: false,
|
||||||
|
changeStatus: false,
|
||||||
selectedvehicle: '',
|
selectedvehicle: '',
|
||||||
|
selectedStatus: '{{.ViewState.booking.ManualStatus}}',
|
||||||
|
statusOptions: {{json .ViewState.status_options}},
|
||||||
|
extraPropertiesDefs: {{json .ViewState.booking_extra_properties}},
|
||||||
|
bookingExtraProperties: {{if .ViewState.booking.Data.extra_properties}}{{json .ViewState.booking.Data.extra_properties}}{{else}}{}{{end}},
|
||||||
|
getRequestedProperties() {
|
||||||
|
if (!this.statusOptions || !this.extraPropertiesDefs) return [];
|
||||||
|
let current = this.statusOptions.find(s => s.name === this.selectedStatus);
|
||||||
|
if (!current || !current.requested_properties) return [];
|
||||||
|
return current.requested_properties.map(rp => {
|
||||||
|
let ref = (typeof rp === 'string') ? { name: rp } : rp;
|
||||||
|
let def = this.extraPropertiesDefs.find(d => d.name === ref.name);
|
||||||
|
if (!def) return null;
|
||||||
|
return { ...def, required: !!ref.required };
|
||||||
|
}).filter(d => d);
|
||||||
|
},
|
||||||
|
getDefaultValue(prop) {
|
||||||
|
if (prop.target === 'enddate') return '{{(timeFrom .ViewState.booking.Enddate).Format "2006-01-02T15:04"}}';
|
||||||
|
if (prop.target === 'startdate') return '{{(timeFrom .ViewState.booking.Startdate).Format "2006-01-02T15:04"}}';
|
||||||
|
if (prop.target === 'unavailableto') return '{{(timeFrom .ViewState.booking.Unavailableto).Format "2006-01-02"}}';
|
||||||
|
if (prop.target === 'unavailablefrom') return '{{(timeFrom .ViewState.booking.Unavailablefrom).Format "2006-01-02"}}';
|
||||||
|
return this.bookingExtraProperties[prop.name] || '';
|
||||||
|
},
|
||||||
submitSelectedvehicle(event) {
|
submitSelectedvehicle(event) {
|
||||||
if(this.selectedvehicle == '') {
|
if(this.selectedvehicle == '') {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
@@ -22,13 +45,20 @@
|
|||||||
class="inline-flex items-center justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-2xl text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">
|
class="inline-flex items-center justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-2xl text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">
|
||||||
Changer de véhicule
|
Changer de véhicule
|
||||||
</button>
|
</button>
|
||||||
<a href="/app/vehicles-management/bookings/{{.ViewState.booking.ID}}/delete">
|
{{if eq .ViewState.status_management "manual"}}
|
||||||
|
<button type="button" @click="changeStatus = ! changeStatus"
|
||||||
|
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
|
||||||
|
Changer de statut
|
||||||
|
</button>
|
||||||
|
{{else}}
|
||||||
|
<a href="/app/vehicles-management/bookings/{{.ViewState.booking.ID}}/delete">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-red px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-red focus:ring-offset-2 sm:w-auto">
|
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-red px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-red focus:ring-offset-2 sm:w-auto">
|
||||||
Annuler
|
Annuler
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
|
||||||
<div class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true" x-show="changeVehicle">
|
<div class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true" x-show="changeVehicle">
|
||||||
<div class="fixed inset-0 bg-gray-900 bg-opacity-30 transition-opacity"></div>
|
<div class="fixed inset-0 bg-gray-900 bg-opacity-30 transition-opacity"></div>
|
||||||
@@ -63,6 +93,77 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{if eq .ViewState.status_management "manual"}}
|
||||||
|
<div class="relative z-10" role="dialog" aria-modal="true" x-show="changeStatus">
|
||||||
|
<div class="fixed inset-0 bg-gray-900 bg-opacity-30 transition-opacity"></div>
|
||||||
|
|
||||||
|
<div class="fixed inset-0 z-10 overflow-y-auto">
|
||||||
|
<div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
|
||||||
|
<div class="relative transform overflow-hidden rounded-3xl bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-sm sm:p-6">
|
||||||
|
<div class="text-center">
|
||||||
|
<h3 class="text-lg font-medium leading-6 text-gray-900">Changer le statut</h3>
|
||||||
|
</div>
|
||||||
|
<form method="POST" action="/app/vehicles-management/bookings/{{.ViewState.booking.ID}}/status" class="mt-4 space-y-4">
|
||||||
|
<div>
|
||||||
|
<label for="new_status" class="block text-sm font-medium text-gray-700 mb-1">Nouveau statut</label>
|
||||||
|
<select id="new_status" name="new_status" x-model="selectedStatus" class="block w-full rounded-2xl border-gray-300 bg-gray-50 py-2 pl-3 pr-10 text-sm shadow-sm focus:border-co-blue focus:bg-white focus:outline-none focus:ring-co-blue">
|
||||||
|
{{$currentStatus := .ViewState.booking.ManualStatus}}
|
||||||
|
{{range .ViewState.status_options}}
|
||||||
|
<option value="{{index . "name"}}" {{if eq (index . "name") $currentStatus}}selected{{end}}>{{index . "label"}}</option>
|
||||||
|
{{end}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="status_comment" class="block text-sm font-medium text-gray-700 mb-1">Commentaire</label>
|
||||||
|
<textarea id="status_comment" name="comment" rows="3" placeholder="Optionnel"
|
||||||
|
class="block w-full rounded-2xl border-gray-300 bg-gray-50 text-sm shadow-sm focus:border-co-blue focus:bg-white focus:outline-none focus:ring-co-blue"></textarea>
|
||||||
|
</div>
|
||||||
|
<div x-show="getRequestedProperties().length > 0" class="border-t border-gray-200"></div>
|
||||||
|
<template x-for="prop in getRequestedProperties()" :key="prop.name">
|
||||||
|
<div>
|
||||||
|
<label :for="'prop_' + prop.name" class="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
<span x-text="prop.label"></span>
|
||||||
|
<span x-show="prop.required" class="text-red-500"> *</span>
|
||||||
|
</label>
|
||||||
|
<template x-if="prop.type === 'text'">
|
||||||
|
<input type="text" :id="'prop_' + prop.name" :name="'prop_' + prop.name" :value="getDefaultValue(prop)" :required="prop.required"
|
||||||
|
class="block w-full rounded-2xl border-gray-300 bg-gray-50 py-2 pl-3 pr-3 text-sm shadow-sm focus:border-co-blue focus:bg-white focus:outline-none focus:ring-co-blue">
|
||||||
|
</template>
|
||||||
|
<template x-if="prop.type === 'number'">
|
||||||
|
<input type="number" :id="'prop_' + prop.name" :name="'prop_' + prop.name" :value="getDefaultValue(prop)" :required="prop.required"
|
||||||
|
class="block w-full rounded-2xl border-gray-300 bg-gray-50 py-2 pl-3 pr-3 text-sm shadow-sm focus:border-co-blue focus:bg-white focus:outline-none focus:ring-co-blue">
|
||||||
|
</template>
|
||||||
|
<template x-if="prop.type === 'date'">
|
||||||
|
<input type="date" :id="'prop_' + prop.name" :name="'prop_' + prop.name" :value="getDefaultValue(prop)" :required="prop.required"
|
||||||
|
class="block w-full rounded-2xl border-gray-300 bg-gray-50 py-2 pl-3 pr-3 text-sm shadow-sm focus:border-co-blue focus:bg-white focus:outline-none focus:ring-co-blue">
|
||||||
|
</template>
|
||||||
|
<template x-if="prop.type === 'datetime-local'">
|
||||||
|
<input type="datetime-local" :id="'prop_' + prop.name" :name="'prop_' + prop.name" :value="getDefaultValue(prop)" :required="prop.required"
|
||||||
|
class="block w-full rounded-2xl border-gray-300 bg-gray-50 py-2 pl-3 pr-3 text-sm shadow-sm focus:border-co-blue focus:bg-white focus:outline-none focus:ring-co-blue">
|
||||||
|
</template>
|
||||||
|
<template x-if="prop.type === 'select' && prop.options">
|
||||||
|
<select :id="'prop_' + prop.name" :name="'prop_' + prop.name" :required="prop.required"
|
||||||
|
class="block w-full rounded-2xl border-gray-300 bg-gray-50 py-2 pl-3 pr-10 text-sm shadow-sm focus:border-co-blue focus:bg-white focus:outline-none focus:ring-co-blue">
|
||||||
|
<template x-for="opt in prop.options" :key="opt.value">
|
||||||
|
<option :value="opt.value" :selected="opt.value === getDefaultValue(prop)" x-text="opt.label"></option>
|
||||||
|
</template>
|
||||||
|
</select>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div class="mt-5 sm:mt-6">
|
||||||
|
<button type="submit" class="inline-flex w-full justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:text-sm">Valider</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div class="mt-5 sm:mt-6">
|
||||||
|
<button @click="changeStatus=false" type="button" class="inline-flex w-full justify-center max-w-xs bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-8 max-w-3xl mx-auto grid grid-cols-1 gap-6 lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-3">
|
<div class="mt-8 max-w-3xl mx-auto grid grid-cols-1 gap-6 lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-3">
|
||||||
@@ -132,6 +233,42 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{if .ViewState.booking_extra_properties}}
|
||||||
|
<div class="bg-white shadow sm:rounded-2xl"
|
||||||
|
x-data="{
|
||||||
|
extraPropertiesDefs: {{json .ViewState.booking_extra_properties}},
|
||||||
|
storedProps: {{if .ViewState.booking.Data.extra_properties}}{{json .ViewState.booking.Data.extra_properties}}{{else}}{}{{end}},
|
||||||
|
computedProps: {{if .ViewState.computed_extra_properties}}{{json .ViewState.computed_extra_properties}}{{else}}{}{{end}},
|
||||||
|
displayProps() {
|
||||||
|
return this.extraPropertiesDefs.filter(prop => !prop.target);
|
||||||
|
},
|
||||||
|
getValue(prop) {
|
||||||
|
if (prop.type === 'computed') return this.computedProps[prop.name] || '';
|
||||||
|
let v = this.storedProps[prop.name];
|
||||||
|
if (prop.type === 'date' && v) {
|
||||||
|
let d = new Date(v);
|
||||||
|
if (!isNaN(d)) return d.toLocaleDateString('fr-FR');
|
||||||
|
}
|
||||||
|
return v || '';
|
||||||
|
},
|
||||||
|
hasAnyValue() {
|
||||||
|
return this.displayProps().some(prop => this.getValue(prop) !== '');
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
x-show="hasAnyValue()">
|
||||||
|
<h2 class="text-lg font-medium text-gray-900 p-4 sm:px-6">Informations complémentaires</h2>
|
||||||
|
<div class="border-t border-gray-200 px-4 py-5 sm:px-6">
|
||||||
|
<dl class="sm:divide-y sm:divide-gray-200">
|
||||||
|
<template x-for="prop in displayProps()" :key="prop.name">
|
||||||
|
<div x-show="getValue(prop) !== ''" class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4">
|
||||||
|
<dt class="text-sm font-medium text-gray-500" x-text="prop.label"></dt>
|
||||||
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2" x-text="getValue(prop)"></dd>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div class="lg:col-start-2 lg:col-span-2">
|
<div class="lg:col-start-2 lg:col-span-2">
|
||||||
<div class="bg-white shadow sm:rounded-2xl sm:px-6">
|
<div class="bg-white shadow sm:rounded-2xl sm:px-6">
|
||||||
@@ -151,8 +288,28 @@
|
|||||||
<p class="mt-1 text-sm text-gray-500">Motif : {{.ViewState.booking.Data.motif}}</p>
|
<p class="mt-1 text-sm text-gray-500">Motif : {{.ViewState.booking.Data.motif}}</p>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<h3 class="text-lg leading-6 font-medium text-gray-900">Réservation</h3>
|
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||||
|
Réservation
|
||||||
|
{{template "booking_status_badge" .}}
|
||||||
|
</h3>
|
||||||
<p class="mt-1 text-sm text-gray-500">Informations utiles sur la réservation.</p>
|
<p class="mt-1 text-sm text-gray-500">Informations utiles sur la réservation.</p>
|
||||||
|
{{if eq .ViewState.status_management "manual"}}
|
||||||
|
{{range .ViewState.status_options}}
|
||||||
|
{{if eq (index . "name") $.ViewState.booking.ManualStatus}}
|
||||||
|
{{if and (eq (index . "meta_status") "open") (isPast $.ViewState.booking.Startdate)}}
|
||||||
|
<div class="mt-3 flex items-center gap-2 rounded-lg bg-red-50 px-3 py-2 text-red-700 border border-red-200">
|
||||||
|
{{$.IconSet.Icon "hero:outline/exclamation-triangle" "h-6 w-6 flex-shrink-0"}}
|
||||||
|
<span class="text-sm font-medium">Retard : la date de début de réservation est dépassée</span>
|
||||||
|
</div>
|
||||||
|
{{else if and (eq (index . "meta_status") "active") (isPast $.ViewState.booking.Enddate)}}
|
||||||
|
<div class="mt-3 flex items-center gap-2 rounded-lg bg-red-50 px-3 py-2 text-red-700 border border-red-200">
|
||||||
|
{{$.IconSet.Icon "hero:outline/exclamation-triangle" "h-6 w-6 flex-shrink-0"}}
|
||||||
|
<span class="text-sm font-medium">Retard : la date de fin de réservation est dépassée</span>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-4 mt-4 flex-shrink-0">
|
<div class="ml-4 mt-4 flex-shrink-0">
|
||||||
@@ -181,9 +338,7 @@
|
|||||||
<dt class="text-sm font-medium text-gray-500">Prescripteur</dt>
|
<dt class="text-sm font-medium text-gray-500">Prescripteur</dt>
|
||||||
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||||
{{if .ViewState.booking.Data.booked_by.user}}
|
{{if .ViewState.booking.Data.booked_by.user}}
|
||||||
<a href="/app/members/{{.ViewState.booking.Data.booked_by.user.id}}" class="flex inline">
|
<a href="/app/members/{{.ViewState.booking.Data.booked_by.user.id}}" class="text-co-blue hover:underline">
|
||||||
<img class="h-5 w-5 rounded-co mr-1"
|
|
||||||
src="/app/members/{{.ViewState.booking.Data.booked_by.user.id}}/picture" alt="">
|
|
||||||
{{.ViewState.booking.Data.booked_by.user.display_name}}
|
{{.ViewState.booking.Data.booked_by.user.display_name}}
|
||||||
</a>
|
</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
@@ -308,55 +463,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
{{template "booking_documents" .}}
|
||||||
<p class="text-sm font-medium text-gray-500 my-4">Documents</p>
|
{{template "booking_status_history" .}}
|
||||||
{{if eq (len .ViewState.documents) 0}}
|
|
||||||
<p class="p-12 text-gray-500 text-center text-md">Aucun document</p>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
|
|
||||||
{{if gt (len .ViewState.documents) 0}}
|
|
||||||
|
|
||||||
<div class="-mx-4 mb-10 ring-1 ring-gray-300 sm:-mx-6 md:mx-0 md:rounded-lg">
|
|
||||||
<table class="min-w-full divide-y divide-gray-300 table-fixed">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Type</th>
|
|
||||||
<th scope="col" class="hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell">Nom du document</th>
|
|
||||||
<th scope="col" class="hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell">Ajouté le</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>
|
|
||||||
{{range .ViewState.documents}}
|
|
||||||
<tr>
|
|
||||||
<td class="relative py-4 pl-4 sm:pl-6 pr-3 text-sm">
|
|
||||||
<div class="font-medium text-gray-900">
|
|
||||||
<span class="bg-co-blue text-xs text-white rounded-xl p-1 mr-2">{{index $.ViewState.file_types_map .Metadata.Type}}</span>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="px-3 py-3.5 text-sm text-gray-900 table-cell max-w-10 overflow-hidden">
|
|
||||||
<p class=" overflow-hidden">{{.Metadata.Name}}</p>
|
|
||||||
</td>
|
|
||||||
<td class="px-3 py-3.5 text-sm text-gray-500 lg:table-cell">{{.LastModified.Format "02/01/2006"}}</td>
|
|
||||||
<td class="relative py-3.5 pl-3 pr-4 sm:pr-6 text-right text-sm font-medium">
|
|
||||||
<a href="/app/vehicles/bookings/{{$.ViewState.booking.ID}}/documents/{{.FileName}}" target="_blank">
|
|
||||||
<button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le document</span></button>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
|
|
||||||
<!-- More plans... -->
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,10 +18,11 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="bg-white shadow sm:rounded-lg sm:overflow-hidden my-4">
|
||||||
|
{{template "vehicle_booking_filters" .}}
|
||||||
|
{{template "bookings_list" .}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{template "vehicle_booking_filters" .}}
|
|
||||||
|
|
||||||
{{template "bookings_list" .}}
|
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
informations: '{{ .ViewState.vehicle.Data.informations}}',
|
informations: '{{ .ViewState.vehicle.Data.informations}}',
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
licence_plate: ['required', 'regexMatch:^[A-Z]{1,2}-[0-9]{1,3}-[A-Z]{1,2}$'],
|
licence_plate: ['required'],
|
||||||
name: ['required'],
|
name: ['required'],
|
||||||
},
|
},
|
||||||
formValidation: {
|
formValidation: {
|
||||||
|
|||||||
@@ -1,45 +1,74 @@
|
|||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
|
{{$defaultTab := "bookings"}}
|
||||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
||||||
<h1 class="text-2xl font-semibold text-gray-900">Gestion des véhicules et réservations</h1>
|
<h1 class="text-2xl font-semibold text-gray-900">Gestion des véhicules et réservations</h1>
|
||||||
|
|
||||||
|
<div class="bg-white shadow sm:rounded-lg sm:overflow-hidden my-4" x-data="{
|
||||||
|
tab: '{{or .ViewState.tab $defaultTab}}',
|
||||||
|
to(event) {
|
||||||
|
this.tab = event.target.value
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<div class="divide-y divide-gray-200">
|
||||||
|
<div>
|
||||||
|
<div class="hidden sm:block">
|
||||||
|
<div class="border-b border-gray-200 pl-4 flex justify-between items-center">
|
||||||
|
<nav class="-mb-px flex space-x-8" aria-label="Tabs">
|
||||||
|
<a href="#" @click="tab = 'bookings'"
|
||||||
|
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||||
|
:class="tab == 'bookings' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||||
|
Réservations </a>
|
||||||
|
|
||||||
|
<a href="#" @click="tab = 'vehicles'"
|
||||||
|
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
|
||||||
|
:class="tab == 'vehicles' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
|
||||||
|
Véhicules </a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="pr-4 flex space-x-2">
|
||||||
|
<div x-show="tab == 'bookings'" class="flex space-x-2">
|
||||||
|
<a href="/exports/fleets/bookings/group_bookings.xlsx?status={{.ViewState.filters.status}}&date_start={{.ViewState.filters.date_start}}&date_end={{.ViewState.filters.date_end}}&vehicle_type={{.ViewState.filters.vehicle_type}}">
|
||||||
|
<button type="button"
|
||||||
|
class="inline-flex items-center justify-center bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
|
||||||
|
{{$.IconSet.Icon "hero:outline/document-arrow-down" "h-5 w-5 mr-3"}}
|
||||||
|
Export
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
|
<a href="/app/vehicles-management/bookings/">
|
||||||
|
<button type="button"
|
||||||
|
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
|
||||||
|
{{$.IconSet.Icon "hero:outline/table-cells" "h-5 w-5 mr-3"}}
|
||||||
|
Historique
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div x-show="tab == 'vehicles'">
|
||||||
|
<a href="/app/vehicles-management/fleet/add">
|
||||||
|
<button type="button"
|
||||||
|
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
|
||||||
|
{{$.IconSet.Icon "hero:outline/plus-circle" "h-5 w-5 mr-3"}}
|
||||||
|
Ajouter un véhicule
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div x-show="tab == 'bookings'">
|
||||||
|
{{template "vehicle_booking_filters" .}}
|
||||||
|
{{template "bookings_list" .}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div x-show="tab == 'vehicles'">
|
||||||
|
{{template "vehicle_filters" .}}
|
||||||
|
{{template "vehicles_list" .}}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="sm:flex sm:items-center">
|
|
||||||
<div class="sm:flex-auto">
|
|
||||||
<h2 class="text-xl font-semibold text-gray-600 pt-8">Réservations en cours et à venir</h2>
|
|
||||||
</div>
|
|
||||||
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
|
|
||||||
<a href="/app/vehicles-management/bookings/">
|
|
||||||
<button type="button"
|
|
||||||
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
|
|
||||||
{{$.IconSet.Icon "hero:outline/table-cells" "h-5 w-5 mr-3"}}
|
|
||||||
Historique
|
|
||||||
</button>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{template "bookings_list" .}}
|
{{end}}
|
||||||
|
|
||||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="sm:flex sm:items-center">
|
|
||||||
<div class="sm:flex-auto">
|
|
||||||
<h2 class="text-xl font-semibold text-gray-600 pt-8">Véhicules</h2>
|
|
||||||
</div>
|
|
||||||
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
|
|
||||||
<a href="/app/vehicles-management/fleet/add">
|
|
||||||
<button type="button"
|
|
||||||
class="inline-flex items-center justify-center rounded-2xl border border-transparent bg-co-blue px-4 py-2 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
|
|
||||||
{{$.IconSet.Icon "hero:outline/plus-circle" "h-5 w-5 mr-3"}}
|
|
||||||
Ajouter un véhicule
|
|
||||||
</button>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{template "vehicles_list" .}}
|
|
||||||
|
|
||||||
{{end}}
|
|
||||||
|
|||||||
@@ -6,12 +6,15 @@
|
|||||||
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||||
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
||||||
"Courier New", monospace;
|
"Courier New", monospace;
|
||||||
|
--color-red-50: oklch(0.971 0.013 17.38);
|
||||||
|
--color-red-200: oklch(0.885 0.062 18.334);
|
||||||
--color-red-500: oklch(0.637 0.237 25.331);
|
--color-red-500: oklch(0.637 0.237 25.331);
|
||||||
--color-red-600: oklch(0.577 0.245 27.325);
|
--color-red-600: oklch(0.577 0.245 27.325);
|
||||||
--color-red-700: oklch(0.505 0.213 27.518);
|
--color-red-700: oklch(0.505 0.213 27.518);
|
||||||
--color-red-900: oklch(0.396 0.141 25.723);
|
--color-red-900: oklch(0.396 0.141 25.723);
|
||||||
--color-orange-50: oklch(0.98 0.016 73.684);
|
--color-orange-50: oklch(0.98 0.016 73.684);
|
||||||
--color-orange-200: oklch(0.901 0.076 70.697);
|
--color-orange-200: oklch(0.901 0.076 70.697);
|
||||||
|
--color-amber-500: oklch(0.769 0.188 70.08);
|
||||||
--color-yellow-50: oklch(0.987 0.026 102.212);
|
--color-yellow-50: oklch(0.987 0.026 102.212);
|
||||||
--color-green-100: oklch(0.962 0.044 156.743);
|
--color-green-100: oklch(0.962 0.044 156.743);
|
||||||
--color-green-600: oklch(0.627 0.194 149.214);
|
--color-green-600: oklch(0.627 0.194 149.214);
|
||||||
@@ -1817,6 +1820,9 @@
|
|||||||
.border-orange-200 {
|
.border-orange-200 {
|
||||||
border-color: var(--color-orange-200);
|
border-color: var(--color-orange-200);
|
||||||
}
|
}
|
||||||
|
.border-red-200 {
|
||||||
|
border-color: var(--color-red-200);
|
||||||
|
}
|
||||||
.border-transparent {
|
.border-transparent {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
@@ -1913,6 +1919,9 @@
|
|||||||
.bg-orange-50 {
|
.bg-orange-50 {
|
||||||
background-color: var(--color-orange-50);
|
background-color: var(--color-orange-50);
|
||||||
}
|
}
|
||||||
|
.bg-red-50 {
|
||||||
|
background-color: var(--color-red-50);
|
||||||
|
}
|
||||||
.bg-red-500 {
|
.bg-red-500 {
|
||||||
background-color: var(--color-red-500);
|
background-color: var(--color-red-500);
|
||||||
}
|
}
|
||||||
@@ -2469,6 +2478,9 @@
|
|||||||
.\[color\:red\]\/50\! {
|
.\[color\:red\]\/50\! {
|
||||||
color: color-mix(in oklab, red 50%, transparent) !important;
|
color: color-mix(in oklab, red 50%, transparent) !important;
|
||||||
}
|
}
|
||||||
|
.text-amber-500 {
|
||||||
|
color: var(--color-amber-500);
|
||||||
|
}
|
||||||
.text-blue-800 {
|
.text-blue-800 {
|
||||||
color: var(--color-blue-800);
|
color: var(--color-blue-800);
|
||||||
}
|
}
|
||||||
@@ -2514,9 +2526,15 @@
|
|||||||
.text-indigo-600 {
|
.text-indigo-600 {
|
||||||
color: var(--color-indigo-600);
|
color: var(--color-indigo-600);
|
||||||
}
|
}
|
||||||
|
.text-red-500 {
|
||||||
|
color: var(--color-red-500);
|
||||||
|
}
|
||||||
.text-red-600 {
|
.text-red-600 {
|
||||||
color: var(--color-red-600);
|
color: var(--color-red-600);
|
||||||
}
|
}
|
||||||
|
.text-red-700 {
|
||||||
|
color: var(--color-red-700);
|
||||||
|
}
|
||||||
.text-white {
|
.text-white {
|
||||||
color: var(--color-white);
|
color: var(--color-white);
|
||||||
}
|
}
|
||||||
@@ -3197,6 +3215,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.hover\:text-co-blue\/80 {
|
||||||
|
&:hover {
|
||||||
|
@media (hover: hover) {
|
||||||
|
color: color-mix(in oklab, var(--color-co-blue) 80%, transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.hover\:text-co-green {
|
.hover\:text-co-green {
|
||||||
&:hover {
|
&:hover {
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
@@ -3314,6 +3339,11 @@
|
|||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.focus\:bg-white {
|
||||||
|
&:focus {
|
||||||
|
background-color: var(--color-white);
|
||||||
|
}
|
||||||
|
}
|
||||||
.focus\:placeholder-gray-400 {
|
.focus\:placeholder-gray-400 {
|
||||||
&:focus {
|
&:focus {
|
||||||
&::placeholder {
|
&::placeholder {
|
||||||
|
|||||||
Reference in New Issue
Block a user