Aller-retour et autres améliorations (transport soolidaire)

This commit is contained in:
Arnaud Delcasse 2025-05-28 07:31:27 +02:00
parent 5e260b1072
commit d487f8b387
11 changed files with 277 additions and 26 deletions

View File

@ -261,6 +261,11 @@ views:
files:
- web/layouts/_partials/address_autocomplete.html
- web/layouts/solidarity_transport/driver_create.html
driver_update:
files:
- web/layouts/agenda/_partials/address.html
- web/layouts/_partials/address_autocomplete.html
- web/layouts/solidarity_transport/driver_update.html
driver_display:
files:
- web/layouts/_partials/address_autocomplete.html
@ -367,6 +372,8 @@ icons:
svg:
coopgo:parcoursmob/monogram: <svg xmlns="http://www.w3.org/2000/svg" class="%s" viewBox="0 0 61.85 33.58"><defs><style>.cls-1{fill:#ff1300;}.cls-2{fill:#243887;}</style></defs><g id="Calque_2" data-name="Calque 2"><g id="Calque_1-2" data-name="Calque 1"><path class="cls-1" d="M44.978,0C31.337,0,28.1,6.824,27.875,15.505H39.536V9.434a.727.727,0,0,1,1.123-.607L52.6,16.453,40.659,24.08a.729.729,0,0,1-1.123-.608v-6.1H27.865c.075,8.427,1.527,16.213,17.113,16.213,14.867,0,16.872-7.764,16.872-17.032C61.85,7.91,59.894,0,44.978,0Z"/><polygon class="cls-1" points="41.412 21.385 49.133 16.453 41.412 11.521 41.412 21.385"/><path class="cls-2" d="M14.175,11.4l-.019,4.151H26.311a14.781,14.781,0,0,0,.819-5.141C27.046,3.767,22.545,0,14.764,0H1.052A1.147,1.147,0,0,0,0,1.24V31.87a1.149,1.149,0,0,0,1.094,1.239H11.525a1.145,1.145,0,0,0,1.051-1.239V10.41h.758C13.88,10.41,14.175,10.756,14.175,11.4Z"/><path class="cls-2" d="M14.148,17.3l-.015,3.514H18.97A7.521,7.521,0,0,0,25.458,17.3Z"/></g></g></svg>
hero:outline/archive-box: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z" /></svg>
hero:outline/arrow-long-right: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3" /></svg>
hero:outline/arrow-path-rounded-square: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3" /></svg>
hero:outline/briefcase: <svg xmlns="http://www.w3.org/2000/svg" class="%s" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" /></svg>
hero:outline/support: <svg xmlns="http://www.w3.org/2000/svg" class="%s" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="%s"><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z" /></svg>
hero:outline/group_module: <svg xmlns="http://www.w3.org/2000/svg" class="%s" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z" /></svg>

View File

@ -15,12 +15,7 @@
file_number: '{{ .ViewState.Data.file_number }}',
gender: {{.ViewState.Data.gender}}
},
other_properties: {
situation: '{{.ViewState.Data.other_properties.situation}}',
subscription_reason: '{{.ViewState.Data.other_properties.subscription_reason}}',
status: '{{.ViewState.Data.other_properties.status}}',
comment: '{{.ViewState.Data.other_properties.comment}}'
},
other_properties: {{if .ViewState.Data.other_properties}}{{ json .ViewState.Data.other_properties }}{{else}}{}{{end}},
other_properties_serialized: null,
rules: {
first_name: ['required'],
@ -49,6 +44,7 @@
this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field])
},
submit(event) {
this.other_properties_serialized = JSON.stringify(this.other_properties)
this.validate()
if(!this.formValidation.valid) {
this.isFormValid = false
@ -58,6 +54,7 @@
}
}">
<form class="space-y-6" method="POST" @submit="submit">
<input type="hidden" name="other_properties" x-model="other_properties_serialized" />
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
<div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1">
@ -133,8 +130,8 @@
<div class="col-span-6 sm:col-span-3">
<label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
<div class="sm:mt-0 sm:col-span-2">
<select id="gender" name="gender" autocomplete="gender" x-model="gender"
class="max-w-lg mt-1 block focus:ring-co-blue focus:border-co-blue w-full shadow-sm sm:max-w-xs sm:text-sm border-gray-300 rounded-2xl">
<select id="gender" name="gender" autocomplete="gender" x-model="fields.gender"
class="max-w-lg mt-1 block focus:ring-co-blue focus:border-co-blue w-3xs-full shadow-sm sm:max-w-xs sm:text-sm border-gray-300 rounded-2xl">
<option value="0">Inconnu</option>
<option value="1" :selected="fields.gender == '1'">Masculin</option>
<option value="2" :selected="fields.gender == '2'">Féminin</option>

View File

@ -21,6 +21,10 @@
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Distance passager
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Commentaire
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
&nbsp;
@ -36,6 +40,7 @@
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ $driver.Data.first_name }} {{ $driver.Data.last_name }}</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .DriverDistance }} km</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .PassengerDistance }} km</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{if $driver.Data.other_properties}}{{ $driver.Data.other_properties.comment }}{{end}}</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<a class="text-co-blue hover:text-co-blue"
href="/app/solidarity-transport/drivers/{{$driver.ID}}/journeys/{{.Id}}">

View File

@ -66,10 +66,10 @@
</div>
<div class="my-4 inline-flex justify-items-center">
<div class="p-1">De</div>
<input type="time" id="starttime" name="starttime" value="08:00"
<input type="time" id="starttime" name="starttime" value="06:00"
class="shadow-sm focus:ring-co-blue focus:border-co-blue p-1 sm:text-sm border-gray-300 rounded-l-2xl border-l-0">
<div class="p-1 px-4">à</div>
<input type="time" id="endtime" name="endtime" value="18:00"
<input type="time" id="endtime" name="endtime" value="20:00"
class="shadow-sm focus:ring-co-blue focus:border-co-blue p-1 sm:text-sm border-gray-300 rounded-r-2xl border-l-0">
</div>

View File

@ -59,7 +59,7 @@
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .Data.phone_number }}</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{if and .Data.other_properties (gt .Data.other_properties.last_subscription_date "2025")}}
{{if and .Data.other_properties (and .Data.other_properties.last_subscription_date (gt .Data.other_properties.last_subscription_date "2025"))}}
<span class="p-1 px-2 text-xs bg-co-green rounded-2xl">Oui</span>
{{else}}
<span class="p-1 px-2 text-xs bg-co-red text-white rounded-2xl">Non</span>

View File

@ -5,6 +5,9 @@
<h3 class="text-lg leading-6 font-medium text-gray-900">Le trajet</h3>
<h2 class="text-sm leading-6 font-medium text-gray-600">Informations sur le trajet</h2>
</div>
<div>
{{if eq .driver_journey.Noreturn true}}<span class="text-sm p-2 bg-co-red text-white rounded-xl">Aller simple</span>{{else}}<span class="text-sm p-2 bg-co-red text-white rounded-xl">Aller-retour</span>{{end}}
</div>
</div>
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2">
<div class="p-4 py-5 sm:px-6">

View File

@ -135,6 +135,12 @@
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="other_properties.last_subscription_date">
</div>
<div class="col-span-6 sm:col-span-3">
<label for="comment" class="block text-sm font-medium text-gray-700">Commentaire</label>
<textarea name="comment" id="comment"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="other_properties.comment"></textarea>
</div>
<!-- <div class="col-span-3 sm:col-span-3">
<label class="block text-sm font-medium text-gray-700"> Photo </label>

View File

@ -26,8 +26,8 @@
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">Désarchiver</button></a>{{end}}
<!-- <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/solidarity-transport/drivers/{{.ViewState.driver.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>-->
<a href="/app/solidarity-transport/drivers/{{.ViewState.driver.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>
</div>
</div>
@ -85,6 +85,12 @@
<dd class="mt-1 text-sm text-gray-900">{{ .ViewState.driver.Data.other_properties.last_subscription_date}}</dd>
</div>
{{end}}
{{if and .ViewState.driver.Data.other_properties .ViewState.driver.Data.other_properties.comment}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Commentaire</dt>
<dd class="mt-1 text-sm text-gray-900">{{ .ViewState.driver.Data.other_properties.comment}}</dd>
</div>
{{end}}
</dl>
</div>
</div>

View File

@ -2,6 +2,28 @@
{{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">Organiser le transport solidaire</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">
<form method="POST" action="/app/solidarity-transport/drivers/{{.ViewState.driver.ID}}/journeys/{{.ViewState.driver_journey.Id}}/noreturn">
{{if .ViewState.driver_journey.Noreturn}}
<button type="submit"
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">
{{$.IconSet.Icon "hero:outline/arrow-path-rounded-square" "h-5 w-5 mr-3"}}
Changer en aller-retour
</button>
{{else}}
<button type="submit"
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">
{{$.IconSet.Icon "hero:outline/arrow-long-right" "h-5 w-5 mr-3"}}
Changer en aller simple
</button>
{{end}}
</form>
</div>
</div>
</div>
<div class="max-w-7xl mx-auto py-8 px-4 sm:px-6 md:px-8">
{{template "journey_preview" (dict "driver_journey" .ViewState.driver_journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries)}}
@ -13,6 +35,13 @@
<p class="text-xl text-co-red text-center p-4">Le solde du compte mobilité est insuffisant.</p>
{{end}}
<form method="POST">
{{if not .ViewState.driver_journey.Noreturn}}
<div class="m-auto text-center">
<label for="return_waiting_time" class="block text-sm font-medium text-gray-700">Durée d'attente à destination (minutes)</label>
<input type="number" name="return_waiting_time" value="30"
class="p-2 mt-1 mb-4 focus:ring-co-blue focus:border-co-blue block shadow-sm sm:text-sm rounded-2xl bg-white m-auto" />
</div>
{{end}}
{{template "submit_with_sms"
dict "IconSet" .IconSet
"Viewstate" .ViewState

View File

@ -0,0 +1,195 @@
{{ 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">Modifier le conducteur</h1>
</div>
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8"
x-data="{
fields: {
first_name: '{{.ViewState.driver.Data.first_name}}',
last_name: '{{.ViewState.driver.Data.last_name}}',
email: '{{.ViewState.driver.Data.email}}' ,
phone_number: '{{.ViewState.driver.Data.phone_number}}',
birthdate: {{if .ViewState.driver.Data.birthdate}}'{{ (timeFrom .ViewState.driver.Data.birthdate).Format "2006-01-02" }}'{{else}}null{{end}},
},
other_properties: {{if .ViewState.driver.Data.other_properties}}{{ json .ViewState.driver.Data.other_properties }}{{else}}{}{{end}},
other_properties_serialized: '{{ json .ViewState.driver.Data.other_properties }}',
rules: {
first_name: ['required'],
last_name: ['required'],
email: ['required', 'email'],
phone_number: ['required', 'regexMatch:^((\\+)33|0)[1-9](\\d{2}){4}$'],
birthdate: ['required'],
},
formValidation: {
valid: false,
fields: {
first_name: {valid: null},
last_name: {valid: null},
email: {valid: null},
phone_number: {valid: null},
birthdate: {valid: null},
}
},
isFormValid: true,
validate() {
this.formValidation = Iodine.assert(this.fields, this.rules)
},
validateField(field) {
this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field])
},
submit(event) {
this.other_properties_serialized = JSON.stringify(this.other_properties)
this.validate()
if(!this.formValidation.valid) {
this.isFormValid = false
event.preventDefault()
}
return this.formValidation.valid
}
}">
<form class="space-y-6" method="POST" @submit="submit">
<input type="hidden" name="other_properties" x-model="other_properties_serialized" />
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
<div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1">
<h3 class="text-lg font-medium leading-6 text-gray-900">Informations obligatoires</h3>
<p class="mt-1 text-sm text-gray-500">Informations personnelles obligatoires pour créer le conducteur</p>
</div>
<div class="mt-5 md:mt-0 md:col-span-2">
<div class="grid grid-cols-6 gap-6">
<div class="col-span-6 sm:col-span-3">
<label for="first_name" class="block text-sm font-medium text-gray-700">Prénom</label>
<input type="text" name="first_name" id="first_name" autocomplete="given-name"
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="fields.first_name" @blur="validateField('first_name')"
:class="formValidation.fields.first_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div>
<div class="col-span-6 sm:col-span-3">
<label for="last_name" class="block text-sm font-medium text-gray-700">Nom</label>
<input type="text" name="last_name" id="last_name" autocomplete="family-name"
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="fields.last_name" @blur="validateField('last_name')"
:class="formValidation.fields.last_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div>
<div class="col-span-6 sm:col-span-3">
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
<input type="text" name="email" id="email" autocomplete="email"
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="fields.email" @blur="validateField('email')"
:class="formValidation.fields.email.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div>
<div class="col-span-6 sm:col-span-3">
<label for="phone_number" class="block text-sm font-medium text-gray-700">Numéro de
téléphone</label>
<input type="text" name="phone_number" id="phone_number" autocomplete="phone" placeholder="+33612345678"
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="fields.phone_number" @blur="validateField('phone_number')"
:class="formValidation.fields.phone_number.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div>
<div class="col-span-6 sm:col-span-3">
<label for="birthdate" class="block text-sm font-medium text-gray-700">Date de
naissance</label>
<input type="date" name="birthdate" id="birthdate" autocomplete="birthdate" placeholder="JJ/MM/AAAA"
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="fields.birthdate" @blur="validateField('birthdate')"
:class="formValidation.fields.birthdate.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div>
{{ $fieldName := "address" }}
{{if .ViewState.driver.Data.address}}
{{$default := .ViewState.driver.Data.address}}
{{ template "address" dict "FieldName" $fieldName "Default" $default}}
{{else}}
{{ template "address_autocomplete" dict "FieldName" $fieldName}}
{{end}}
</div>
</div>
</div>
</div>
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
<div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1">
<h3 class="text-lg font-medium leading-6 text-gray-900">Informations optionnelles</h3>
<p class="mt-1 text-sm text-gray-500">Autres informations de profil optionnelles</p>
</div>
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
<div class="grid grid-cols-6 gap-6">
<div class="col-span-6 sm:col-span-3">
<label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
<div class="sm:mt-0 sm:col-span-2">
<select id="gender" name="gender" autocomplete="gender" x-model="gender"
class="p-2 max-w-lg mt-1 block focus:ring-co-blue focus:border-co-blue w-full shadow-sm sm:max-w-xs sm:text-sm border-gray-300 rounded-2xl">
<option value="0">Inconnu</option>
<option value="1">Masculin</option>
<option value="2">Féminin</option>
<option value="9">Sans objet</option>
</select>
</div>
</div>
<div class="col-span-6 sm:col-span-3">
<label for="last_subscription_date" class="block text-sm font-medium text-gray-700">Date de dernière adhésion</label>
<input type="date" name="last_subscription_date" id="last_subscription_date" autocomplete="last_subscription_date" placeholder="JJ/MM/AAAA"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="other_properties.last_subscription_date">
</div>
<div class="col-span-6 sm:col-span-3">
<label for="comment" class="block text-sm font-medium text-gray-700">Commentaire</label>
<textarea name="comment" id="comment"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="other_properties.comment"></textarea>
</div>
<!-- <div class="col-span-3 sm:col-span-3">
<label class="block text-sm font-medium text-gray-700"> Photo </label>
<div class="mt-1 flex items-center space-x-5">
<span class="inline-block h-12 w-12 rounded-co overflow-hidden bg-gray-100">
{{.IconSet.Icon "img:profile-picture-placeholder" "h-full w-full"}}
</span>
<button type="button"
class="bg-white py-2 px-3 border border-gray-300 rounded-2xl shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
Charger la photo
</button>
</div>
</div> -->
</div>
</div>
</div>
</div>
<!--<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
<div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1">
<h3 class="text-lg font-medium leading-6 text-gray-900">Paramètres</h3>
<p class="mt-1 text-sm text-gray-500">Paramètres liés au conducteur, utiles pour exploiter les fonctionnalités de PARCOURSMOB</p>
</div>
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
{{ $fieldName := "address" }}
{{ template "address_autocomplete" dict "FieldName" $fieldName }}
</div>
</div>
</div>-->
<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/solidarity-transport/drivers/{{.ViewState.driver.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>
<button type="submit"
class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-2xl text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Modifier le conducteur solidaire</button>
</div>
</form>
</div>
{{end}}

View File

@ -37,29 +37,32 @@
<div class="p-4 py-5 sm:px-6">
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
<div class="sm:col-span-1">
<dt class="font-medium text-gray-500">Départ passager</dt>
<dt class="font-medium text-gray-500">Type de de trajet</dt>
{{if .ViewState.booking.Journey.Noreturn}}<dd class="mt-1 text-gray-900">Aller simple (pas de retour)</dd>
{{else}}<dd class="mt-1 text-gray-900">Aller-retour ({{.ViewState.booking.ReturnWaitingDuration | shortDuration}} d'attente estimée sur place)</dd>{{end}}
</div>
<div class="sm:col-span-1">
<dt class="font-medium text-gray-500">Passager</dt>
<dd class="mt-1 text-gray-900">{{.ViewState.passenger.Data.first_name}} {{.ViewState.passenger.Data.last_name}}</dd>
</div>
<div class="sm:col-span-1">
<dt class="font-medium text-gray-500">Lieu de récupération du passager</dt>
<dd class="mt-1 text-gray-900">{{.ViewState.booking.Journey.PassengerPickup.Properties.label}}</dd>
</div>
<div class="sm:col-span-1">
<dt class="font-medium text-gray-500">Destination passager</dt>
<dt class="font-medium text-gray-500">Lieu de destination</dt>
<dd class="mt-1 text-gray-900">{{.ViewState.booking.Journey.PassengerDrop.Properties.label}}</dd>
</div>
<div class="sm:col-span-1">
<dt class="font-medium text-gray-500">Kilomètres passager</dt>
<dd class="mt-1 text-gray-900">{{.ViewState.booking.Journey.PassengerDistance}} km</dd>
</div>
<div class="sm:col-span-1">
<dt class="font-medium text-gray-500">Kilomètres conducteur</dt>
<dd class="mt-1 text-gray-900">{{.ViewState.booking.Journey.DriverDistance}} km</dd>
</div>
<div class="sm:col-span-1">
<dt class="font-medium text-gray-500">Horaire rendez vous passager</dt>
<dt class="font-medium text-gray-500">Date et heure du rendez-vous</dt>
<dd class="mt-1 text-gray-900">{{ .ViewState.booking.Journey.PassengerPickupDate.Format "02/01/2006 15:04"}}</dd>
</div>
{{if eq .ViewState.booking.Status "VALIDATED"}}
<div class="sm:col-span-1">
<dt class="font-medium text-gray-500">Temps de trajet</dt>
<dd class="mt-1 text-gray-900">{{ printf "%.0f" .ViewState.booking.Journey.Duration.Minutes }} min</dd>
<dt class="font-medium text-gray-500">Numéro de téléphone du passager</dt>
<dd class="mt-1 text-co-blue"><a href="tel:{{.ViewState.passenger.Data.phone_number}}">{{ .ViewState.passenger.Data.phone_number}}</a></dd>
</div>
{{end}}
</dl>
</div>
<div>