2022-11-06 17:19:13 +00:00
|
|
|
{{define "content"}}
|
|
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
|
|
|
|
<h1 class="text-2xl font-semibold text-gray-900">Réservation de véhicule</h1>
|
|
|
|
|
|
|
|
<div class="sm:flex sm:items-center">
|
|
|
|
<div class="sm:flex-auto">
|
|
|
|
<p class="mt-2 text-sm text-gray-700"></p>
|
|
|
|
</div>
|
2022-12-05 16:24:24 +00:00
|
|
|
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none"
|
|
|
|
x-data="{
|
|
|
|
changeVehicle: false,
|
|
|
|
selectedvehicle: ''
|
|
|
|
}">
|
|
|
|
<button type="button" @click="changeVehicle = ! changeVehicle"
|
2022-11-06 17:19:13 +00:00
|
|
|
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
|
|
|
|
</button>
|
2023-05-03 12:15:44 +00:00
|
|
|
|
|
|
|
<a href="/app/vehicles-management/bookings/{{.ViewState.booking.ID}}/delete">
|
2022-11-06 17:19:13 +00:00
|
|
|
<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">
|
|
|
|
Annuler
|
|
|
|
</button>
|
2023-05-03 12:15:44 +00:00
|
|
|
</a>
|
2022-12-05 16:24:24 +00:00
|
|
|
|
|
|
|
<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 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" id="modal-title">Changer de véhicule</h3>
|
|
|
|
</div>
|
|
|
|
<form method="POST" action="/app/vehicles-management/bookings/{{.ViewState.booking.ID}}/change-vehicle" class="mt-4">
|
|
|
|
<select x-model="selectedvehicle" id="vehicle" name="vehicle" class="mt-1 block w-full rounded-2xl border-gray-300 py-2 pl-3 pr-10 text-base focus:border-co-blue focus:outline-none focus:ring-co-blue sm:text-sm">
|
|
|
|
<option value=""></option>
|
|
|
|
{{range .ViewState.alternative_vehicles }}
|
2022-12-05 18:16:24 +00:00
|
|
|
<option value="{{.ID}}">{{.Data.name}} ({{.Type}})</option>
|
2022-12-05 16:24:24 +00:00
|
|
|
{{end}}
|
|
|
|
</select>
|
|
|
|
<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">Changer de véhicule</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<div class="mt-5 sm:mt-6">
|
|
|
|
<button @click="changeVehicle=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>
|
|
|
|
</div>
|
2022-11-06 17:19:13 +00:00
|
|
|
</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="space-y-6 lg:col-start-1 lg:col-span-1">
|
|
|
|
<div class="bg-white shadow sm:rounded-2xl">
|
|
|
|
<h2 id="timeline-title" class="text-lg font-medium text-gray-900 p-4 sm:px-6">Bénéficiaire</h2>
|
|
|
|
<div class="border-t border-gray-200 px-4 py-5 sm:px-6">
|
|
|
|
<div>
|
|
|
|
<div class="mt-5 border-gray-200">
|
|
|
|
<dl class="sm:divide-y sm:divide-gray-200">
|
|
|
|
<div class="sm:pb-5 sm:grid sm:grid-cols-3 sm:gap-4">
|
|
|
|
<dt class="text-sm font-medium text-gray-500">Nom</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
|
|
{{.ViewState.beneficiary.Data.first_name}}
|
|
|
|
{{.ViewState.beneficiary.Data.last_name}}</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">Email</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
|
|
{{.ViewState.beneficiary.Data.email}}</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">Téléphone</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
|
|
{{.ViewState.beneficiary.Data.phone_number}}</dd>
|
|
|
|
</div>
|
|
|
|
{{if .ViewState.Data.birthdate}}
|
|
|
|
<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 naissance</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">{{(timeFrom
|
|
|
|
.ViewState.Data.birthdate).Format
|
|
|
|
"02/01/2006"}}</dd>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{if and .ViewState.Data.gender (ne .ViewState.Data.gender "0")}}
|
|
|
|
<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 naissance</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">{{genderISO5218
|
|
|
|
.ViewState.Data.gender}}</dd>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{if .ViewState.Data.address}}
|
|
|
|
<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">Adresse</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
|
|
{{.ViewState.Data.address.properties.label}}
|
|
|
|
</dd>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<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 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">
|
|
|
|
<h3 class="text-lg leading-6 font-medium text-gray-900">Réservation</h3>
|
|
|
|
<p class="mt-1 text-sm text-gray-500">Informations utiles sur la réservation.</p>
|
|
|
|
</div>
|
|
|
|
<div class="ml-4 mt-4 flex-shrink-0">
|
2022-11-07 00:26:09 +00:00
|
|
|
<!-- <button type="button"
|
2022-11-06 17:19:13 +00:00
|
|
|
class="relative inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-xs font-medium rounded-2xl text-co-blue bg-gray-100 hover:bg-co-blue hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">SMS</button>
|
|
|
|
<button type="button"
|
2022-11-07 00:26:09 +00:00
|
|
|
class="relative inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-xs font-medium rounded-2xl text-co-blue bg-gray-100 hover:bg-co-blue hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Email</button> -->
|
2022-11-06 17:19:13 +00:00
|
|
|
<!-- <button type="button"
|
|
|
|
class="relative inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-xs font-medium rounded-2xl text-co-blue bg-gray-100 hover:bg-co-blue hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Imprimer</button> -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="px-4 py-5 sm:px-6">
|
|
|
|
<div>
|
|
|
|
<div class="mt-5 border-gray-200">
|
|
|
|
<dl class="sm:divide-y sm:divide-gray-200">
|
|
|
|
<!-- <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
|
|
|
|
</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">Prescripteur</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}}
|
|
|
|
{{if .ViewState.booking.Data.booked_by.group}}{{.ViewState.booking.Data.booked_by.group.name}}{{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">
|
|
|
|
{{.ViewState.vehicle.Data.name}}</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">Immatriculation</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
|
|
|
{{.ViewState.vehicle.Data.licence_plate}}</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">Type</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
2022-12-05 18:16:24 +00:00
|
|
|
{{.ViewState.vehicle.Type}}</dd>
|
2022-11-06 17:19:13 +00:00
|
|
|
</div>
|
|
|
|
{{if .ViewState.vehicle.Data.address}}
|
|
|
|
<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">Lieu de récupération</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">{{.ViewState.vehicle.Data.address.properties.label}}</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">Date de récupération</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2 inline-flex"
|
|
|
|
x-data="{ updateOpen: false }">
|
|
|
|
<div class="w-full inline-flex" x-show="!updateOpen">
|
|
|
|
<div class="flex-1">{{(timeFrom .ViewState.booking.Startdate).Format "02/01/2006"}}</div>
|
|
|
|
<a href="#" class="text-co-blue hover:text-co-blue ml-5" @click="updateOpen = ! updateOpen">Modifier</a>
|
|
|
|
</div>
|
|
|
|
<form method="POST" class="inline-flex" x-show="updateOpen">
|
|
|
|
<div class="flex-1">
|
|
|
|
<input type="date" name="startdate" value="{{(timeFrom .ViewState.booking.Startdate).Format "2006-01-02"}}"
|
|
|
|
class="shadow-sm focus:ring-co-blue focus:border-co-blue block sm:text-sm border-gray-300 rounded-2xl">
|
|
|
|
</div>
|
|
|
|
<button
|
|
|
|
class=" justify-center text-co-blue px-4">
|
|
|
|
OK
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</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 retour</dt>
|
|
|
|
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"
|
|
|
|
x-data="{ updateOpen: false }">
|
|
|
|
<div class="w-full inline-flex" x-show="!updateOpen">
|
|
|
|
<div class="flex-1">{{(timeFrom .ViewState.booking.Enddate).Format "02/01/2006"}}</div>
|
|
|
|
<a href="#" class="text-co-blue hover:text-co-blue ml-5" @click="updateOpen = ! updateOpen">Modifier</a>
|
|
|
|
</div>
|
|
|
|
<form method="POST" class="inline-flex" x-show="updateOpen">
|
|
|
|
<div class="flex-1">
|
|
|
|
<input type="date" name="enddate" value="{{(timeFrom .ViewState.booking.Enddate).Format "2006-01-02"}}"
|
|
|
|
class="shadow-sm focus:ring-co-blue focus:border-co-blue block sm:text-sm border-gray-300 rounded-2xl">
|
|
|
|
</div>
|
|
|
|
<button
|
|
|
|
class=" justify-center text-co-blue px-4">
|
|
|
|
OK
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</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">Indisponible à partir du</dt>
|
|
|
|
<dd class="mt-1 text-sm font-bold text-co-red sm:mt-0 sm:col-span-2 inline-flex"
|
|
|
|
x-data="{ updateOpen: false }">
|
|
|
|
<div class="w-full inline-flex" x-show="!updateOpen">
|
|
|
|
<div class="flex-1">{{(timeFrom .ViewState.booking.Unavailablefrom).Format "02/01/2006"}}</div>
|
|
|
|
<a href="#" class="text-co-blue hover:text-co-blue ml-5" @click="updateOpen = ! updateOpen">Modifier</a>
|
|
|
|
</div>
|
|
|
|
<form method="POST" class="inline-flex" x-show="updateOpen">
|
|
|
|
<div class="flex-1">
|
|
|
|
<input type="date" name="unavailablefrom" value="{{(timeFrom .ViewState.booking.Unavailablefrom).Format "2006-01-02"}}"
|
|
|
|
class="shadow-sm focus:ring-co-blue focus:border-co-blue block sm:text-sm border-gray-300 rounded-2xl">
|
|
|
|
</div>
|
|
|
|
<button
|
|
|
|
class=" justify-center text-co-blue px-4">
|
|
|
|
OK
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</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">Sera à nouveau disponible le</dt>
|
|
|
|
<dd class="mt-1 text-sm font-bold text-co-green sm:mt-0 sm:col-span-2 inline-flex"
|
|
|
|
x-data="{ updateOpen: false }">
|
|
|
|
<div class="w-full inline-flex" x-show="!updateOpen">
|
|
|
|
<div class="flex-1">{{(timeFrom .ViewState.booking.Unavailableto).Format "02/01/2006"}}</div>
|
|
|
|
<a href="#" class="text-co-blue hover:text-co-blue ml-5" @click="updateOpen = ! updateOpen">Modifier</a>
|
|
|
|
</div>
|
|
|
|
<form method="POST" class="inline-flex" x-show="updateOpen">
|
|
|
|
<div class="flex-1">
|
|
|
|
<input type="date" name="unavailableto" value="{{(timeFrom .ViewState.booking.Unavailableto).Format "2006-01-02"}}"
|
|
|
|
class="shadow-sm focus:ring-co-blue focus:border-co-blue block sm:text-sm border-gray-300 rounded-2xl">
|
|
|
|
</div>
|
|
|
|
<button
|
|
|
|
class=" justify-center text-co-blue px-4">
|
|
|
|
OK
|
|
|
|
</button>
|
|
|
|
</dd>
|
|
|
|
</div>
|
|
|
|
<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>
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|