Administration, organizations access rights and véhicles booking

This commit is contained in:
2022-08-12 14:53:54 +02:00
parent 7225d027c9
commit 0bb915059d
34 changed files with 1839 additions and 245 deletions

View File

@@ -7,26 +7,23 @@
<table class="min-w-full divide-y divide-gray-300">
<thead class="bg-gray-50">
<tr>
<th scope="col"
<!-- <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">
</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">
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Immatriculation
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
<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">
Prescripteur
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
<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">
<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">
@@ -35,33 +32,38 @@
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
{{range .ViewState.vehicles}}
{{$vehicle := .}}
{{range .Bookings}}
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<!-- <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" >aa</div>
<div class="text-gray-900" >{{$vehicle.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" ></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" >COOPGO</div>
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="text-gray-900" >aa</div>
<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">
<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" >aa</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">
<a :href="'/app/beneficiaries/' + beneficiary.id"
<a href="/app/vehicles-management/bookings/{{.ID}}"
class="text-co-blue hover:text-co-blue">Voir</a>
</td>
</tr>
{{end}}
{{end}}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,259 @@
{{define "calendar"}}
<div class="flex items-center">
<h2 class="flex-auto font-semibold text-gray-900">Août 2022</h2>
<button type="button"
class="-my-1.5 flex flex-none items-center justify-center p-1.5 text-gray-400 hover:text-gray-500">
<span class="sr-only">Mois précédent</span>
<!-- Heroicon name: solid/chevron-left -->
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
aria-hidden="true">
<path fill-rule="evenodd"
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
clip-rule="evenodd" />
</svg>
</button>
<button type="button"
class="-my-1.5 -mr-1.5 ml-2 flex flex-none items-center justify-center p-1.5 text-gray-400 hover:text-gray-500">
<span class="sr-only">Mois suivant</span>
<!-- Heroicon name: solid/chevron-right -->
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
aria-hidden="true">
<path fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd" />
</svg>
</button>
</div>
<div class="mt-10 grid grid-cols-7 text-center text-xs leading-6 text-gray-500">
<div>L</div>
<div>M</div>
<div>M</div>
<div>J</div>
<div>V</div>
<div>S</div>
<div>D</div>
</div>
<div class="mt-2 grid grid-cols-7 text-sm">
<div class="py-2">
<!--
Always include: "mx-auto flex h-8 w-8 items-center justify-center rounded-full"
Is selected, include: "text-white"
Is not selected and is today, include: "text-indigo-600"
Is not selected and is not today and is current month, include: "text-gray-900"
Is not selected and is not today and is not current month, include: "text-gray-400"
Is selected and is today, include: "bg-indigo-600"
Is selected and is not today, include: "bg-gray-900"
Is not selected, include: "hover:bg-gray-200"
Is selected or is today, include: "font-semibold"
-->
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-01">1</time>
</button>
</div>
<div class="py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-02">2</time>
</button>
</div>
<div class="py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-03">3</time>
</button>
</div>
<div class="py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-04">4</time>
</button>
</div>
<div class="py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-05">5</time>
</button>
</div>
<div class="py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-06">6</time>
</button>
</div>
<div class="py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-07">7</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-08">8</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-09">9</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-10">10</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-11">11</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full bg-gray-900 font-semibold text-white">
<time datetime="2022-08-12">12</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-13">13</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-14">14</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-15">15</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-16">16</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-17">17</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-18">18</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-19">19</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-20">20</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-21">21</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-22">22</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-23">23</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-24">24</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-25">25</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-26">26</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-27">27</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-28">28</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-29">29</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-30">30</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-900 hover:bg-gray-200">
<time datetime="2022-08-31">31</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-400 hover:bg-gray-200">
<time datetime="2022-09-01">1</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-400 hover:bg-gray-200">
<time datetime="2022-09-02">2</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-400 hover:bg-gray-200">
<time datetime="2022-09-03">3</time>
</button>
</div>
<div class="border-t border-gray-200 py-2">
<button type="button"
class="mx-auto flex h-8 w-8 items-center justify-center rounded-full text-gray-400 hover:bg-gray-200">
<time datetime="2022-09-04">4</time>
</button>
</div>
</div>
{{end}}

View File

@@ -9,16 +9,16 @@
<tr>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Immatriculation
Numéro (Immat / Bicycode)
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Gestionnaire
<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">
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Modèle
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">
Gestionnaire
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Lieu
</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
<span class="sr-only">Actions</span>
@@ -26,24 +26,26 @@
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
{{range .ViewState.vehicles}}
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="text-gray-900" >aa</div>
<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" >aa</div>
<div class="text-gray-900" >{{if eq .Type "electric_bike"}}Vélo électrique{{else}}Voiture{{end}}</div>
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="text-gray-900" >aa</div>
<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" >aa</div>
<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/beneficiaries/' + beneficiary.id"
<a href="/app/vehicles-management/fleet/{{.ID}}"
class="text-co-blue hover:text-co-blue">Voir</a>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>