Add Vehicles states in admin

This commit is contained in:
Arnaud Delcasse 2023-01-17 08:26:46 +01:00
parent e0a98a0126
commit 7220c4e350
6 changed files with 41 additions and 12 deletions

View File

@ -33,13 +33,13 @@ views:
files:
- web/layouts/_partials/address_autocomplete.html
- web/layouts/beneficiaries/update.html
conseillers:
members:
display:
files:
- web/layouts/conseillers/display.html
- web/layouts/members/display.html
update:
files:
- web/layouts/conseillers/update.html
- web/layouts/members/update.html
vehicles:
search:
files:

View File

@ -56,7 +56,7 @@
<div
class="flex-1 flex items-center justify-between border-t border-r border-b border-gray-200 bg-white rounded-r-3xl truncate">
<div class="flex-1 px-4 py-2 text-sm truncate">
<a href="#" class="text-gray-900 font-medium hover:text-gray-600">Véhicules</a>
<a href="/app/administration/stats/vehicles" class="text-gray-900 font-medium hover:text-gray-600">Véhicules</a>
<p class="text-gray-500">{{len .ViewState.bookings}} réservations de véhicules</p>
</div>
</div>

View File

@ -151,14 +151,14 @@
x-transition:leave-start="transform opacity-100 scale-100"
x-transition:leave-end="transform opacity-0 scale-95">
<!-- Active: "bg-gray-100", Not Active: "" -->
<a href="/app/profile/{{.UserID}}" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
<a href="/app/members/{{.UserID}}" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
id="user-menu-item-0">Votre profil</a>
<a href="/app/profile/{{.UserID}}/update" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
<a href="/app/members/{{.UserID}}/update" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
id="user-menu-item-1">Paramètres</a>
<!-- <a href="/app/disconnect" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
id="user-menu-item-2">Se déconnecter</a> -->
<a href="/auth/disconnect" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
id="user-menu-item-2">Se déconnecter</a>
</div>
</div>
</div>

View File

@ -18,8 +18,10 @@
class="mt-6 flex flex-col-reverse justify-stretch space-y-4 space-y-reverse sm:flex-row-reverse sm:justify-end sm:space-x-reverse sm:space-y-0 sm:space-x-3 md:mt-0 md:flex-row md:space-x-3">
<!-- <button type="button"
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">Supprimer</button> -->
<a href="/app/profile/{{.ViewState.admins.ID}}/update" class="inline-flex"><button type="button"
{{if eq .UserID .ViewState.admins.ID}}
<a href="/app/members/{{.ViewState.admins.ID}}/update" class="inline-flex"><button type="button"
class="w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Modifier</button></a>
{{end}}
</div>
</div>

View File

@ -119,7 +119,7 @@
<div class="flex justify-end">
<p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
<a href="/app/profile/{{.ViewState.ID}}">
<a href="/app/members/{{.ViewState.ID}}">
<button type="button"
class="bg-white py-2 px-4 border border-gray-300 rounded-2xl shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
</a>

View File

@ -21,6 +21,12 @@
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Véhicule
</th>
<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>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Beneficiaire
</th>
@ -60,11 +66,32 @@
{{end}}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="text-gray-900" >Voiture</div>
<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" >{{.Vehicle.Data.name}}</div>
<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.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}}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{ (index $.ViewState.groups_map (index (index $.ViewState.vehicles_map .Vehicleid).Administrators 0)).Data.name }}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{if not .Data.administrator_unavailability}}
<div class="text-gray-900" ><img class="h-6 w-6 rounded-co"