Files
parcoursmob-default-theme/web/layouts/vehicles_management/booking-display.html

477 lines
37 KiB
HTML

{{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>
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none"
x-data="{
changeVehicle: false,
changeStatus: false,
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) {
if(this.selectedvehicle == '') {
event.preventDefault()
}
return true
}
}">
{{if and (ne .ViewState.booking.Status -1) (not .ViewState.booking.Deleted)}}
<button type="button" @click="changeVehicle = ! changeVehicle"
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>
{{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"
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>
</a>
{{end}}
{{end}}
<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>
{{if eq (len .ViewState.alternative_vehicles) 0}}
<div class="mt-4 text-center">
<p class="text-sm text-gray-500">Aucun véhicule disponible pour les dates de cette réservation.</p>
</div>
{{else}}
<form method="POST" action="/app/vehicles-management/bookings/{{.ViewState.booking.ID}}/change-vehicle" class="mt-4" @submit="submitSelectedvehicle">
<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 }}
<option value="{{.ID}}">{{.Data.licence_plate}} - {{.Data.name}} ({{.Type}})</option>
{{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>
{{end}}
<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>
{{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 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.beneficiary.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.beneficiary.Data.birthdate).Format
"02/01/2006"}}</dd>
</div>
{{end}}
{{if and .ViewState.beneficiary.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.beneficiary.Data.gender}}</dd>
</div>
{{end}}
{{if .ViewState.beneficiary.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.beneficiary.Data.address.properties.label}}
</dd>
</div>
{{end}}
{{if .ViewState.beneficiary.Data.file_number}}
<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">Numéro de dossier (CAF / Pole emploi)</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
{{.ViewState.beneficiary.Data.file_number}}
</dd>
</div>
{{end}}
<div>
<a href="/app/beneficiaries/{{.ViewState.beneficiary.ID}}">
<button type="button"
class="w-full items-center px-4 py-2 border border-transparent shadow-sm text-xs font-medium rounded-2xl text-white bg-co-blue hover:bg-co-blue hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Fiche bénéficiaire</button>
</a>
</div>
</dl>
</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 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">
{{if .ViewState.booking.Deleted}}
<h3 class="text-lg leading-6 font-medium text-gray-900">Réservation annulée le {{if .ViewState.booking.Data.deleted_at}}{{(timeFrom .ViewState.booking.Data.deleted_at).Format "02/01/2006"}}{{else}}{{(timeFrom .ViewState.booking.Unavailableto).Format "02/01/2006"}}{{end}}</h3>
{{if .ViewState.booking.Data.deleted_by}}
<p class="mt-1 text-sm text-gray-500">
Annulée par : {{index (index .ViewState.booking.Data.deleted_by "user") "display_name"}} ({{index (index .ViewState.booking.Data.deleted_by "group") "name"}})
</p>
{{end}}
{{if .ViewState.booking.Data.reason}}
<p class="mt-1 text-sm text-gray-500">Motif : {{.ViewState.booking.Data.reason}}</p>
{{else if .ViewState.booking.Data.motif}}
<p class="mt-1 text-sm text-gray-500">Motif : {{.ViewState.booking.Data.motif}}</p>
{{end}}
{{else}}
<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>
{{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}}
</div>
<div class="ml-4 mt-4 flex-shrink-0">
<!-- <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">SMS</button>
<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">Email</button> -->
<!-- <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="text-co-blue hover:underline">
{{.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">Kilométrage</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
{{.ViewState.vehicle.Data.kilometers}} km</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">
{{.ViewState.vehicle.Type}}</dd>
</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 et heure de prise en charge</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.Startdate).Format "02/01/2006 à 15:04"}}</div>
{{if (not .ViewState.booking.Deleted)}}
<a href="#" class="text-co-blue hover:text-co-blue ml-5" @click="updateOpen = ! updateOpen">Modifier</a>
{{end}}
</div>
<form method="POST" class="inline-flex flex-col gap-2" x-show="updateOpen">
<div class="flex gap-2">
<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">
<input type="time" name="starttime" value="{{(timeFrom .ViewState.booking.Startdate).Format "15:04"}}"
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 self-start">
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 et heure de restitution</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 à 15:04"}}</div>
{{if (not .ViewState.booking.Deleted)}}
<a href="#" class="text-co-blue hover:text-co-blue ml-5" @click="updateOpen = ! updateOpen">Modifier</a>
{{end}}
</div>
<form method="POST" class="inline-flex flex-col gap-2" x-show="updateOpen">
<div class="flex gap-2">
<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">
<input type="time" name="endtime" value="{{(timeFrom .ViewState.booking.Enddate).Format "15:04"}}"
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 self-start">
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>
{{if (not .ViewState.booking.Deleted)}}
<a href="#" class="text-co-blue hover:text-co-blue ml-5" @click="updateOpen = ! updateOpen">Modifier</a>
{{end}}
</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>
{{if (not .ViewState.booking.Deleted)}}
<a href="#" class="text-co-blue hover:text-co-blue ml-5" @click="updateOpen = ! updateOpen">Modifier</a>
{{end}}
</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>
{{template "booking_documents" .}}
{{template "booking_status_history" .}}
</dl>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{{end}}