Add dispositifs

This commit is contained in:
2022-09-05 07:25:05 +02:00
parent 0bb915059d
commit 8aa8fc927b
29 changed files with 1425 additions and 329 deletions

View File

@@ -92,9 +92,24 @@
<div class="sm:pb-5 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="text-sm font-medium text-gray-500">Gestionnaire</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
COOPGO
{{.ViewState.group.Data.name}}
</dd>
</div>
{{if .ViewState.booking.Data.booked_by}}
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4">
<!-- <div class="sm:pb-5 sm:grid sm:grid-cols-3 sm:gap-4"> -->
<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">
{{if .ViewState.booking.Data.booked_by.user}}
<a href="/app/members/{{.ViewState.booking.Data.booked_by.user.id}}" class="flex inline">
<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}}
</a>
{{end}}
</dd>
</div>
{{end}}
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="text-sm font-medium text-gray-500">Véhicule</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
@@ -122,7 +137,7 @@
"02/01/2006"}}</dd>
</div>
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="text-sm font-medium text-gray-500">Date de fin</dt>
<dt class="text-sm font-medium text-gray-500">Date de retour</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">{{(timeFrom .ViewState.booking.Enddate).Format
"02/01/2006"}}</dd>
</div>

View File

@@ -0,0 +1,68 @@
{{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>
<!-- <th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Statut
</th> -->
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Type
</th>
<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>
<!-- <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">
<div class="text-gray-900" >Voiture</div>
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="text-gray-900" ><img class="h-6 w-6 rounded-co"
src="/app/beneficiaries/{{.Driver}}/picture" alt=""></div>
</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">
<div class="text-gray-900" >Du {{(timeFrom .Startdate).Format "02/01/2006"}} au {{(timeFrom .Enddate).Format "02/01/2006"}}</div>
</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}}

View File

@@ -7,7 +7,7 @@
<p class="mt-2 text-sm text-gray-700"></p>
</div>
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
<a href="/app/vehicles-management/fleet/add">
<a href="/app/vehicles/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">
Voir les prêts de véhicules
@@ -33,7 +33,7 @@
return this.beneficiaries.filter(b => b['data']['first_name'].includes(text) || b['data']['last_name'].includes(text))
},
fields: {
beneficiaryid: null,
beneficiaryid: {{if .ViewState.search}}'{{.ViewState.search.beneficiary.ID}}'{{else}}null{{end}},
},
selectbeneficiary(beneficiary) {
console.log(beneficiary)