Compare commits

...

2 Commits

Author SHA1 Message Date
Arnaud Delcasse 9280f36a62 many updates 2025-09-25 08:13:43 +02:00
Arnaud Delcasse d3e534fa72 Many improvements 2025-09-16 08:55:14 +02:00
29 changed files with 948 additions and 306 deletions

View File

@ -33,15 +33,41 @@ menu_items:
title: Agenda dispositifs
link: /app/agenda/
icon: hero:outline/calendar
- name: directory
title: Répertoire solutions
link: /app/directory/
icon: hero:outline/document-text
# - name: directory
# title: Répertoire solutions
# link: /app/directory/
# icon: hero:outline/document-text
- name: support
title: Support
link: /app/support/
icon: hero:outline/support
journey_tabs:
- name: all
title: Tous modes
enabled: true
- name: public-transit
title: Transports
enabled: true
- name: directory
title: Solutions locales
module: directory
- name: carpool
title: Covoiturage
enabled: true
- name: organized-carpool
title: Covoiturage solidaire
module: organized_carpool
- name: solidarity-transport
title: Transport solidaire
module: solidarity_transport
- name: vehicles
title: Véhicules
module: vehicles
# - name: others
# title: Autres
# enabled: true
views:
generic:
files:
@ -197,8 +223,10 @@ views:
- web/layouts/_partials/orb_address_autocomplete.html
- web/layouts/journeys/_partials/journeys-all.html
- web/layouts/journeys/_partials/journeys-others.html
- web/layouts/journeys/_partials/journeys-vehicles.html
- web/layouts/journeys/_partials/journeys-local-solutions.html
- web/layouts/journeys/_partials/journeys-carpool.html
- web/layouts/journeys/_partials/journeys-public-transit-motis.html
- web/layouts/journeys/_partials/journeys-public-transit-transitous.html
- web/layouts/journeys/_partials/journeys-solidarity-transport.html
- web/layouts/journeys/_partials/journeys-organized-carpools.html
- web/layouts/journeys/search.html
@ -274,6 +302,7 @@ views:
- web/layouts/solidarity_transport/_partials/driver_availabilities.html
- web/layouts/solidarity_transport/_partials/driver_history.html
- web/layouts/solidarity_transport/_partials/driver_documents.html
- web/layouts/solidarity_transport/_partials/driver_wallet.html
- web/layouts/solidarity_transport/driver_display.html
driver_journey:
files:
@ -307,6 +336,11 @@ views:
files:
- web/layouts/_partials/address_autocomplete.html
- web/layouts/organized_carpool/driver_create.html
driver_update:
files:
- web/layouts/agenda/_partials/address.html
- web/layouts/_partials/address_autocomplete.html
- web/layouts/organized_carpool/driver_update.html
driver_display:
files:
- web/layouts/_partials/address_autocomplete.html
@ -315,8 +349,14 @@ views:
- web/layouts/organized_carpool/driver_display.html
journey:
files:
- sms/organized_carpool/request_driver.tmpl
- web/layouts/_partials/submit_with_sms.html
- web/layouts/organized_carpool/_partials/journey_preview.html
- web/layouts/organized_carpool/journey.html
booking_display:
files:
- web/layouts/organized_carpool/_partials/booking_map.html
- web/layouts/organized_carpool/booking_display.html
administration:
home:
@ -406,6 +446,8 @@ icons:
tabler-icons:walk: <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-walk %s" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><circle cx="13" cy="4" r="1" /><line x1="7" y1="21" x2="10" y2="17" /><path d="M16 21l-2 -4l-3 -3l1 -6" /><path d="M6 12l2 -3l4 -1l3 3l3 1" /></svg>
tabler-icons:bus: <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-bus %s" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><circle cx="6" cy="17" r="2" /><circle cx="18" cy="17" r="2" /><path d="M4 17h-2v-11a1 1 0 0 1 1 -1h14a5 7 0 0 1 5 7v5h-2m-4 0h-8" /><polyline points="16 5 17.5 12 22 12" /><line x1="2" y1="10" x2="17" y2="10" /><line x1="7" y1="5" x2="7" y2="10" /><line x1="12" y1="5" x2="12" y2="10" /></svg>
tabler-icons:train: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-train %s"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M21 13c0 -3.87 -3.37 -7 -10 -7h-8" /><path d="M3 15h16a2 2 0 0 0 2 -2" /><path d="M3 6v5h17.5" /><path d="M3 11v4" /><path d="M8 11v-5" /><path d="M13 11v-4.5" /><path d="M3 19h18" /></svg>
hero:outline/map-pin: <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="M15 10.5a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25s-7.5-4.108-7.5-11.25a7.5 7.5 0 1115 0z" /></svg>
hero:outline/flag: <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="M3 3v1.5M3 21v-6m0 0l2.77-.693a9 9 0 016.208.682l.108.054a9 9 0 006.086.71l3.114-.732a48.524 48.524 0 01-.005-10.499l-3.11.732a9 9 0 01-6.085-.711l-.108-.054a9 9 0 00-6.208-.682L3 4.5M3 15V4.5" /></svg>
emails:
onboarding:
@ -470,3 +512,6 @@ sms:
solidarity_transport:
request_driver:
- sms/solidarity_transport/request_driver.tmpl
organized_carpool:
request_driver:
- sms/organized_carpool/request_driver.tmpl

View File

@ -0,0 +1,2 @@
{{ define "sms_template" }}[{{ .name }}] Nouvelle demande de covoiturage solidaire le {{ .datetime }}.
Acceptez ou refusez sur {{ .baseUrl }}/ext/oc/bp/{booking_id}{{ end }}

View File

@ -0,0 +1,21 @@
{{ define "beneficiary_autocomplete" }}
<div x-model="{
input: '',
}">
<input type="text"
class="p-2 mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl"
x-model="input">
<ul x-show="responselength > 0"
class="absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-xl py-1 text-base overflow-auto focus:outline-none sm:text-sm" tabindex="-1" role="listbox" aria-labelledby="listbox-label" aria-activedescendant="listbox-option-3">
<template x-for="item in autocomplete">
<a href="#">
<li class="text-gray-900 hover:bg-gray-200 cursor-default select-none relative py-2 pl-3 pr-9"
@click="select(item)">
<span class="font-normal block truncate" x-text="item.properties.label" ></span>
</li>
</a>
</template>
</ul>
</div>
{{ end }}

View File

@ -89,6 +89,28 @@
<p class="text-gray-500">Trouver des solutions et organiser les déplacements de ses bénéficiaires.</p>
</div>
</div>
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="solidarity_transport" name="modules.solidarity_transport" type="checkbox"
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
</div>
<div class="ml-3 text-sm">
<label for="modules.vehicles" class="font-medium text-gray-700">Transport solidaire</label>
<p class="text-gray-500">Organiser le transport solidaire ou transport d'utilité sociale avec des conducteurs solidaires.
</p>
</div>
</div>
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="organized_carpool" name="modules.organized_carpool" type="checkbox"
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
</div>
<div class="ml-3 text-sm">
<label for="modules.vehicles" class="font-medium text-gray-700">Covoiturage solidaire</label>
<p class="text-gray-500">Organiser le covoiturage solidaire, mettez en relation covoitureurs solidaires avec vos bénéficiaires.
</p>
</div>
</div>
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="vehicles" name="modules.vehicles" type="checkbox"

View File

@ -66,7 +66,7 @@ x-data="{
<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/beneficiaries/{{$.ViewState.beneficiary.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>
<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">Télécharger<span class="sr-only"> le document</span></button>
</a>
</td>
</tr>

View File

@ -111,6 +111,12 @@
x-model="fields.file_number" @blur="validateField('file_number')"
:class="formValidation.fields.file_number.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div>
{{ $fieldName := "address" }}
{{ template "address_autocomplete" dict "FieldName" $fieldName }}
<!-- will dolater : tags, groups, ... -->
</div>
</div>
</div>
@ -125,74 +131,34 @@
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
<div class="grid grid-cols-6 gap-6">
{{range .ViewState.profile_optional_fields}}
<div class="col-span-6 sm:col-span-3">
<label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
<label for="{{.name}}" class="block text-sm font-medium text-gray-700">{{.label}}</label>
{{if eq .type "select"}}
<div class="sm:mt-0 sm:col-span-2">
<select id="gender" name="gender" autocomplete="gender" x-model="gender"
<select id="{{.name}}" name="{{.name}}"
{{if eq .name "gender"}}x-model="gender"{{else}}x-model="other_properties.{{.name}}"{{end}}
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">
<option value="0">Inconnu</option>
<option value="1">Masculin</option>
<option value="2">Féminin</option>
<option value="9">Sans objet</option>
{{range .options}}
<option value="{{.value}}">{{.label}}</option>
{{end}}
</select>
</div>
</div>
<div class="col-span-6 sm:col-span-3">
<label for="situation" class="block text-sm font-medium text-gray-700">Situation sociale</label>
<div class="sm:mt-0 sm:col-span-2">
<select id="situation" name="situation" autocomplete="situation" x-model="other_properties.situation"
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">
<option value="">Inconnu</option>
<option value="BRSA">BRSA</option>
<option value="Demandeur d'emploi">Demandeur d'emploi</option>
<option value="Chantier">Chantier d'insertion</option>
<option value="Jeune -25">Jeune -25</option>
</select>
</div>
</div>
<div class="col-span-6 sm:col-span-3">
<label for="situation" class="block text-sm font-medium text-gray-700">Motif d'inscription</label>
<div class="sm:mt-0 sm:col-span-2">
<select id="situation" name="situation" autocomplete="situation" x-model="other_properties.subscription_reason"
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">
<option value="Autre">Inconnu</option>
<option value="Pas de permis">Pas de permis</option>
<option value="Pas de véhicule">Pas de véhicule</option>
<option value="Perte d'autonomie">Perte d'autonomie</option>
<option value="Autre">Autre</option>
</select>
</div>
</div>
{{if moduleAvailable "solidarity_transport"}}
<div class="col-span-6 sm:col-span-3">
<label for="status" class="block text-sm font-medium text-gray-700">Statut (prioritaire / non prioritaire)</label>
<div class="sm:mt-0 sm:col-span-2">
<select id="status" name="status" autocomplete="status" x-model="other_properties.status"
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">
<option value="Non prioritaire">Non prioritaire</option>
<option value="Prioritaire">Prioritaire</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="previous_solidarity_transport" class="block text-sm font-medium text-gray-700">Nombre de transports solidaires précédents</label>
<input type="number" name="previous solidarity_transport" id="previous_solidarity_transport" placeholder="0"
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.previous_solidarity_transport">
{{else if eq .type "textarea"}}
<textarea id="{{.name}}" name="{{.name}}" rows="3" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl"></textarea>
{{else if eq .type "date"}}
<input type="date" id="{{.name}}" name="{{.name}}" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{else if eq .type "number"}}
<input type="number" id="{{.name}}" name="{{.name}}" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{else}}
<input type="text" id="{{.name}}" name="{{.name}}" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{end}}
</div>
{{end}}
<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>
@ -212,22 +178,6 @@
</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 bénéficiaire, 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 }}
<!-- will dolater : tags, groups, ... -->
</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>

View File

@ -7,15 +7,15 @@
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8"
x-data="{
fields: {
first_name: '{{ .ViewState.Data.first_name }}',
last_name: '{{ .ViewState.Data.last_name }}',
email: '{{ .ViewState.Data.email }}',
phone_number: '{{ .ViewState.Data.phone_number }}',
birthdate: {{if .ViewState.Data.birthdate}}'{{ (timeFrom .ViewState.Data.birthdate).Format "2006-01-02" }}'{{else}}null{{end}},
file_number: '{{ .ViewState.Data.file_number }}',
gender: {{.ViewState.Data.gender}}
first_name: '{{ .ViewState.beneficiary.Data.first_name }}',
last_name: '{{ .ViewState.beneficiary.Data.last_name }}',
email: '{{ .ViewState.beneficiary.Data.email }}',
phone_number: '{{ .ViewState.beneficiary.Data.phone_number }}',
birthdate: {{if .ViewState.beneficiary.Data.birthdate}}'{{ (timeFrom .ViewState.beneficiary.Data.birthdate).Format "2006-01-02" }}'{{else}}null{{end}},
file_number: '{{ .ViewState.beneficiary.Data.file_number }}',
gender: {{.ViewState.beneficiary.Data.gender}}
},
other_properties: {{if .ViewState.Data.other_properties}}{{ json .ViewState.Data.other_properties }}{{else}}{}{{end}},
other_properties: {{if .ViewState.beneficiary.Data.other_properties}}{{ json .ViewState.beneficiary.Data.other_properties }}{{else}}{}{{end}},
other_properties_serialized: null,
rules: {
first_name: ['required'],
@ -114,6 +114,14 @@
:class="formValidation.fields.file_number.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div>
{{ $fieldName := "address" }}
{{if .ViewState.beneficiary.Data.address}}
{{$default := .ViewState.beneficiary.Data.address}}
{{ template "address" dict "FieldName" $fieldName "Default" $default}}
{{else}}
{{ template "address_autocomplete" dict "FieldName" $fieldName}}
{{end}}
</div>
</div>
</div>
@ -127,118 +135,42 @@
</div>
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
<div class="grid grid-cols-6 gap-6">
{{range .ViewState.profile_optional_fields}}
<div class="col-span-6 sm:col-span-3">
<label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
<label for="{{.name}}" class="block text-sm font-medium text-gray-700">{{.label}}</label>
{{if eq .type "select"}}
<div class="sm:mt-0 sm:col-span-2">
<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>
<option value="9" :selected="fields.gender == '9'">Sans objet</option>
</select>
</div>
</div>
<div class="col-span-6 sm:col-span-3">
<label for="situation" class="block text-sm font-medium text-gray-700">Situation sociale</label>
<div class="sm:mt-0 sm:col-span-2">
<select id="situation" name="situation" autocomplete="situation" x-model="other_properties.situation"
<select id="{{.name}}" name="{{.name}}"
{{if eq .name "gender"}}x-model="fields.gender"{{else}}x-model="other_properties.{{.name}}"{{end}}
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">
<option value="">Inconnu</option>
<option value="BRSA">BRSA</option>
<option value="Demandeur d'emploi">Demandeur d'emploi</option>
<option value="Chantier">Chantier</option>
<option value="Jeune -25">Jeune -25</option>
{{range .options}}
<option value="{{.value}}">{{.label}}</option>
{{end}}
</select>
</div>
</div>
<div class="col-span-6 sm:col-span-3">
<label for="situation" class="block text-sm font-medium text-gray-700">Motif d'inscription</label>
<div class="sm:mt-0 sm:col-span-2">
<select id="subscription_reason" name="subscription_reason" autocomplete="subscription_reason" x-model="other_properties.subscription_reason"
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">
<option value="Autre">Inconnu</option>
<option value="Pas de permis">Pas de permis</option>
<option value="Pas de véhicule">Pas de véhicule</option>
<option value="Perte d'autonomie">Perte d'autonomie</option>
<option value="Autre">Autre</option>
</select>
</div>
</div>
{{if moduleAvailable "solidarity_transport"}}
<div class="col-span-6 sm:col-span-3">
<label for="status" class="block text-sm font-medium text-gray-700">Statut (prioritaire / non prioritaire)</label>
<div class="sm:mt-0 sm:col-span-2">
<select id="status" name="status" autocomplete="status" x-model="other_properties.status"
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">
<option value="Non prioritaire">Non prioritaire</option>
<option value="Prioritaire">Prioritaire</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="previous_solidarity_transport" class="block text-sm font-medium text-gray-700">Nombre de transports solidaires précédents</label>
<input type="text" name="previous solidarity_transport" id="previous_solidarity_transport" placeholder="0"
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.previous_solidarity_transport">
{{else if eq .type "textarea"}}
<textarea id="{{.name}}" name="{{.name}}" rows="3" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl"></textarea>
{{else if eq .type "date"}}
<input type="date" id="{{.name}}" name="{{.name}}" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{else if eq .type "number"}}
<input type="number" id="{{.name}}" name="{{.name}}" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{else}}
<input type="text" id="{{.name}}" name="{{.name}}" x-model="other_properties.{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{end}}
</div>
{{end}}
<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 bénéficiaire, 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" }}
{{if .ViewState.Data.address}}
{{$default := .ViewState.Data.address}}
{{ template "address" dict "FieldName" $fieldName "Default" $default}}
{{else}}
{{ template "address_autocomplete" dict "FieldName" $fieldName}}
{{end}}
<!-- will dolater : tags, groups, ... -->
</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/beneficiaries/{{.ViewState.ID}}">
<a href="/app/beneficiaries/{{.ViewState.beneficiary.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>

View File

@ -21,8 +21,8 @@
<div class="px-4 pt-4 flex text-sm text-grey-900 font-bold">
<div class="flex-1">
{{.IconSet.Icon "tabler-icons:bus" "h-6 w-6 inline-flex mr-4"}}
{{$itinerary.StartTime.Format "15:04"}} - {{$itinerary.EndTime.Format "15:04"}}
({{divideInt $itinerary.Duration 60}} Minutes)
{{ timeFormat $itinerary.StartTime "15:04" }} - {{ timeFormat $itinerary.EndTime "15:04" }}
({{shortDuration $itinerary.Duration}})
</div>
<div></div>
</div>

View File

@ -0,0 +1,13 @@
{{define "journeys_local_solutions"}}
<!--KNOWLEDGE BASE-->
<div class="p-10">
{{ range .ViewState.kb_data }}
<div class="m-4">
<h2 class="text-sm font-bold">{{.title}}</h2>
<p class="text-sm">{{.description}}</p>
<p class="text-sm text-co-blue"><a href="{{.url}}" target="_blank">Voir plus ...</a></p>
</div>
{{ end }}
</div>
{{end}}

View File

@ -5,13 +5,12 @@
<p class="p-12 text-gray-500 text-center text-md">Aucun covoitureur solidaire disponible pour ce trajet.</p>
{{else}}
<h3 class="p-4 text-lg">Covoitureurs solidaires</h3>
<table class="min-w-full divide-y divide-gray-300 border-gray-300 border-t-1">
<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">
Covoitureurs disponibles
Covoitureurs solidaires
</th>
<th scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">
@ -41,7 +40,7 @@
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{ .Distance }} km</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/organized-carpool/drivers/{{$driver.ID}}/journeys/{{.Id}}?{{unescapeHTML $.ViewState.querystring}}">
href="/app/organized-carpool/drivers/{{$driver.ID}}/journeys/{{.Id}}">
Organiser
</a>
</td>

View File

@ -2,8 +2,8 @@
{{ range .ViewState.journeys }}
<div class="p-4 pb-8">
<div class="flex text-md text-grey-900 font-bold">
<div class="flex-1">{{ .StartTime.Format "15:04" }} - {{ .EndTime.Format "15:04" }}</div>
<div>{{ divideInt .Duration 60 }} Minutes</div>
<div class="flex-1">{{ timeFormat .StartTime "15:04" }} - {{ timeFormat .EndTime "15:04" }}</div>
<div>{{ shortDuration .Duration }}</div>
</div>
<div class="flow-root">
<ul role="list" class="-mb-8">
@ -30,7 +30,7 @@
</div>
{{ else }}
<div>
<p class="text-xs text-gray-500">Attendre <a href="#" class="font-medium text-gray-900">{{ divideInt .Duration 60 }} minutes</a></p>
<p class="text-xs text-gray-500">Attendre <a href="#" class="font-medium text-gray-900">{{ shortDuration .Duration }}</a></p>
</div>
{{ end }}
</div>
@ -57,7 +57,7 @@
</div>
<div class="ml-16 pt-2">
<div>
<p class="text-sm text-gray-500">Départ <a href="#" class="font-medium text-gray-900">{{.StartTime.Format "15:04"}}</a> - Arrivée <a href="#" class="font-medium text-gray-900">{{.EndTime.Format "15:04"}}</a></p>
<p class="text-sm text-gray-500">Départ <a href="#" class="font-medium text-gray-900">{{timeFormat .StartTime "15:04"}}</a> - Arrivée <a href="#" class="font-medium text-gray-900">{{timeFormat .EndTime "15:04"}}</a></p>
</div>
<div>
<p class="text-sm text-gray-500">De <a href="#" class="font-medium text-gray-900">{{.From.Name}}</a> à <a href="#" class="font-medium text-gray-900">{{.To.Name}}</a></p>
@ -87,7 +87,7 @@
</div>
<div class="ml-16 pt-2">
<div>
<p class="text-sm text-gray-500">Départ <a href="#" class="font-medium text-gray-900">{{.StartTime.Format "15:04"}}</a> - Arrivée <a href="#" class="font-medium text-gray-900">{{.EndTime.Format "15:04"}}</a></p>
<p class="text-sm text-gray-500">Départ <a href="#" class="font-medium text-gray-900">{{timeFormat .StartTime "15:04"}}</a> - Arrivée <a href="#" class="font-medium text-gray-900">{{timeFormat .EndTime "15:04"}}</a></p>
</div>
<div>
<p class="text-sm text-gray-500">De <a href="#" class="font-medium text-gray-900">{{.From.Name}}</a> à <a href="#" class="font-medium text-gray-900">{{.To.Name}}</a></p>

View File

@ -0,0 +1,36 @@
{{define "journeys_vehicles"}}
<!--VEHICLES-->
{{if moduleAvailable "vehicles"}}
<div class="p-4 flex text-sm text-grey-900">
<div class="flex-1">
{{.IconSet.Icon "tabler-icons:car" "h-6 w-6 inline-flex mr-4"}}
<span class=" font-bold">{{len .ViewState.vehicles}} véhicules</span> partagés disponibles ce jour là et la semaine suivante
</div>
<div>
</div>
</div>
<div class="p-2">
<table class="min-w-full divide-y divide-gray-300">
<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 md:pl-0">Véhicule</th>
<th scope="col" class="py-3.5 px-3 text-left text-sm font-semibold text-gray-900">Numéro</th>
<th scope="col" class="py-3.5 px-3 text-left text-sm font-semibold text-gray-900">Lieu</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
{{range .ViewState.vehicles}}
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6 md:pl-0">{{.Data.name}}</td>
<td class="whitespace-nowrap py-4 px-3 text-sm text-gray-500">{{.Data.licence_plate}}</td>
<td class="whitespace-nowrap py-4 px-3 text-sm text-gray-500">{{if .Data.address}}{{.Data.address.properties.label}}{{end}}</td>
</tr>
{{end}}
</tbody>
</table>
</div>
<div class="p-4 text-center">
<a href="/app/vehicles/"><button class="text-md px-4 py-1 bg-gray-200 text-co-blue rounded-xl">Réserver un véhicule</button></a>
</div>
{{end}}
{{end}}

View File

@ -39,14 +39,14 @@
<div class="py-4 grid grid-cols-2">
<div class="lg:col-span-1">
<label for="departuredate" class="block text-sm font-medium text-gray-700">Le</label>
<label for="departuredate" class="block text-sm font-medium text-gray-700">Date de départ</label>
<div class="mt-1">
<input type="date" id="departuredate" name="departuredate" value="{{.ViewState.departuredate}}"
class="p-2 shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-l-2xl border-r-1">
</div>
</div>
<div class="lg:col-span-1">
<label for="departuretime" class="block text-sm font-medium text-gray-700">A</label>
<label for="departuretime" class="block text-sm font-medium text-gray-700">Heure de départ</label>
<div class="mt-1">
<input type="time" id="departuretime" name="departuretime" value="{{.ViewState.departuretime}}"
class="p-2 shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-r-2xl border-l-0">
@ -78,52 +78,25 @@
<label for="tabs" class="sr-only">Select a tab</label>
<select id="tabs" name="tabs" @change="to"
class="block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
<option value="all">Tous modes</option>
<option value="carpool">Covoiturage</option>
<option value="public-transit">Transports</option>
<option value="solidarity-transport">Transport solidaire</option> -->
<option value="others">Autres</option>
{{range .ViewState.journey_tabs}}
{{if or .enabled (and .module (moduleAvailable .module))}}
<option value="{{.name}}">{{.title}}</option>
{{end}}
{{end}}
</select>
</div>
<div class="hidden sm:block">
<div class="border-b border-gray-200 pl-4">
<nav class="-mb-px flex space-x-8" aria-label="Tabs">
<div class="border-b border-gray-200 pl-4 overflow-x-auto">
<nav class="-mb-px flex space-x-8 min-w-max" aria-label="Tabs">
<!-- Current: "border-indigo-500 text-indigo-600", Default: "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300" -->
<a href="#" @click="tab = 'all'"
{{range .ViewState.journey_tabs}}
{{if or .enabled (and .module (moduleAvailable .module))}}
<a href="#" @click="tab = '{{.name}}'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'all' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Tous modes </a>
<a href="#" @click="tab = 'carpool'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'carpool' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Covoiturage </a>
<a href="#" @click="tab = 'public-transit'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'public-transit' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Transports </a>
{{ if moduleAvailable "solidarity_transport"}}
<a href="#" @click="tab = 'solidarity-transport'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'solidarity-transport' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Transport solidaire </a>
:class="tab == '{{.name}}' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
{{.title}} </a>
{{end}}
{{if moduleAvailable "organized_carpool"}}
<a href="#" @click="tab = 'organized-carpool'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'organized-carpool' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Covoiturage solidaire </a>
{{end}}
<a href="#" @click="tab = 'others'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'others' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Autres </a>
</nav>
</div>
</div>
@ -134,6 +107,8 @@
<div x-show="tab == 'public-transit'">{{template "journeys_public_transit" .}}</div>
<div x-show="tab == 'organized-carpool'">{{template "journeys_organized_carpool" .}}</div>
<div x-show="tab == 'solidarity-transport'">{{template "journeys_solidarity_transport" .}}</div>
<div x-show="tab == 'vehicles'">{{template "journeys_vehicles" .}}</div>
<div x-show="tab == 'directory'">{{template "journeys_local_solutions" .}}</div>
<div x-show="tab == 'others'">{{template "journeys_others" .}}</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
{{define "content"}}
{{if eq .UserID .ViewState.ID}}
{{if eq .UserID .ViewState.user.ID}}
<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 vos informations</h1>
@ -8,11 +8,11 @@
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8"
x-data="{
fields: {
first_name: '{{ .ViewState.Data.first_name }}',
last_name: '{{ .ViewState.Data.last_name }}',
email: '{{ .ViewState.Data.email }}',
phone_number: '{{ .ViewState.Data.phone_number }}',
gender: {{.ViewState.Data.gender}}
first_name: '{{ .ViewState.user.Data.first_name }}',
last_name: '{{ .ViewState.user.Data.last_name }}',
email: '{{ .ViewState.user.Data.email }}',
phone_number: '{{ .ViewState.user.Data.phone_number }}',
gender: {{.ViewState.user.Data.gender}}
},
rules: {
first_name: ['required'],
@ -58,7 +58,7 @@
<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" value="{{.ViewState.Data.first_name}}" name="first_name" id="first_name" autocomplete="given-name"
<input type="text" value="{{.ViewState.user.Data.first_name}}" name="first_name" id="first_name" autocomplete="given-name"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
@blur="validateField('first_name')"
:class="formValidation.fields.first_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
@ -66,7 +66,7 @@
<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" value="{{.ViewState.Data.last_name}}" autocomplete="family-name"
<input type="text" name="last_name" id="last_name" value="{{.ViewState.user.Data.last_name}}" autocomplete="family-name"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
@blur="validateField('last_name')"
:class="formValidation.fields.last_name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
@ -74,7 +74,7 @@
<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" value="{{.ViewState.Data.email}}"
<input type="text" name="email" id="email" autocomplete="email" value="{{.ViewState.user.Data.email}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
@blur="validateField('email')"
:class="formValidation.fields.email.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
@ -101,19 +101,33 @@
</div>
<div class="mt-5 space-y-6 md:mt-0 md:col-span-2">
<div class="grid grid-cols-6 gap-6">
{{range .ViewState.profile_optional_fields}}
<div class="col-span-6 sm:col-span-3">
<label for="gender" class="block text-sm font-medium text-gray-700">Genre</label>
<label for="{{.name}}" class="block text-sm font-medium text-gray-700">{{.label}}</label>
{{if eq .type "select"}}
<div class="sm:mt-0 sm:col-span-2">
<select id="gender" name="gender" autocomplete="gender" x-model="gender"
<select id="{{.name}}" name="{{.name}}"
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">
<option value="0">Inconnu</option>
<option value="1" :selected="fields.gender == '1'">Masculin</option>
<option value="2" :selected="fields.gender == '2'">Féminin</option>
<option value="9" :selected="fields.gender == '9'">Sans objet</option>
{{range .options}}
<option value="{{.value}}">{{.label}}</option>
{{end}}
</select>
</div>
{{else if eq .type "textarea"}}
<textarea id="{{.name}}" name="{{.name}}" rows="3"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl"></textarea>
{{else if eq .type "date"}}
<input type="date" id="{{.name}}" name="{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{else if eq .type "number"}}
<input type="number" id="{{.name}}" name="{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{else}}
<input type="text" id="{{.name}}" name="{{.name}}"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm border-gray-300 rounded-2xl">
{{end}}
</div>
{{end}}
</div>
</div>
</div>
@ -121,7 +135,7 @@
<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/members/{{.ViewState.ID}}">
<a href="/app/members/{{.ViewState.user.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>
@ -146,7 +160,7 @@
</div>
</div>
<div class="flex justify-center items-center mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense ">
<a href="/app/members/{{.ViewState.ID}}"class="rounded-2xl mt-3 inline-flex w-full justify-center rounded-l-2xl border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:col-start-1 sm:mt-0 sm:text-sm">Annuler</a>
<a href="/app/members/{{.ViewState.user.ID}}"class="rounded-2xl mt-3 inline-flex w-full justify-center rounded-l-2xl border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:col-start-1 sm:mt-0 sm:text-sm">Annuler</a>
</div>
</div>
</div>

View File

@ -0,0 +1,180 @@
{{ define "organized_carpool_map" }}
<div id="map" class="w-full h-full min-h-96"></div>
<script>
let protocol = new pmtiles.Protocol();
maplibregl.addProtocol("pmtiles",protocol.tile);
var map = new maplibregl.Map({
container: 'map', // container id
style: "/public/maps/protomaps-light/style.json",
});
const geojsonPoints = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [{{ .booking.PassengerPickupLng }}, {{ .booking.PassengerPickupLat }}]
},
"properties": {
"label": "{{ .booking.PassengerPickupAddress }}",
"type": "pickup"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [{{ .booking.PassengerDropLng }}, {{ .booking.PassengerDropLat }}]
},
"properties": {
"label": "{{ .booking.PassengerDropAddress }}",
"type": "drop"
}
}
]
}
map.on('load', async () => {
// Add route polyline if available
// Add driver route if available
{{if .booking.DriverRoute}}
console.log("DriverRoute found");
try {
const driverRoute = JSON.parse(`{{ .booking.DriverRoute.Serialized }}`);
console.log("Parsed driverRoute:", driverRoute);
console.log("DriverRoute type:", driverRoute.type);
console.log("DriverRoute features:", driverRoute.features);
console.log("DriverRoute features count:", driverRoute.features ? driverRoute.features.length : 0);
console.log("DriverRoute keys:", Object.keys(driverRoute));
if (driverRoute.features && driverRoute.features.length > 0) {
console.log("First feature:", driverRoute.features[0]);
console.log("LineString features:", driverRoute.features.filter(f => f.geometry && f.geometry.type === 'LineString'));
} else {
console.log("No features found, checking alternative structure");
console.log("All driverRoute properties:", driverRoute);
}
map.addSource('driver_route', {
type: "geojson",
data: driverRoute
});
map.addLayer({
'id': 'driver_route',
'type': 'line',
'source': 'driver_route',
'filter': ['==', ['geometry-type'], 'LineString'], // Only show LineString geometries
'layout': {
'line-join': 'round',
'line-cap': 'round',
},
'paint': {
'line-color': '#243887', // Blue - main application color
'line-width': 3
},
});
console.log("Driver route layer added successfully");
} catch (error) {
console.error("Error adding driver route:", error);
}
{{else}}
console.log("No DriverRoute available");
{{end}}
// Add passenger route if available
{{if .booking.PassengerRoute}}
console.log("PassengerRoute found");
try {
const passengerRoute = JSON.parse(`{{ .booking.PassengerRoute.Serialized }}`);
console.log("Parsed passengerRoute:", passengerRoute);
console.log("PassengerRoute type:", passengerRoute.type);
console.log("PassengerRoute features count:", passengerRoute.features ? passengerRoute.features.length : 0);
map.addSource('passenger_route', {
type: "geojson",
data: passengerRoute
});
map.addLayer({
'id': 'passenger_route',
'type': 'line',
'source': 'passenger_route',
'filter': ['==', ['geometry-type'], 'LineString'], // Only show LineString geometries
'layout': {
'line-join': 'round',
'line-cap': 'round',
},
'paint': {
'line-color': '#243887', // Blue - main application color
'line-width': 3
},
});
console.log("Passenger route layer added successfully");
} catch (error) {
console.error("Error adding passenger route:", error);
}
{{else}}
console.log("No PassengerRoute available");
{{end}}
map.addSource('carpool_points', {
type: "geojson",
data: geojsonPoints
})
// Add pickup point
map.addLayer({
'id': 'pickup_point',
'type': 'circle',
'source': 'carpool_points',
'filter': ['==', ['get', 'type'], 'pickup'],
'paint': {
'circle-color': '#243887', // Blue - main application color
'circle-radius': 8,
'circle-stroke-color': '#fff',
'circle-stroke-width': 2
},
});
// Add drop point
map.addLayer({
'id': 'drop_point',
'type': 'circle',
'source': 'carpool_points',
'filter': ['==', ['get', 'type'], 'drop'],
'paint': {
'circle-color': '#243887', // Blue - main application color
'circle-radius': 8,
'circle-stroke-color': '#fff',
'circle-stroke-width': 2
},
});
// Add popup on click
map.on('click', 'pickup_point', (e) => {
new maplibregl.Popup()
.setLngLat(e.lngLat)
.setHTML(`<strong>Point de départ</strong><br>${e.features[0].properties.label}`)
.addTo(map);
});
map.on('click', 'drop_point', (e) => {
new maplibregl.Popup()
.setLngLat(e.lngLat)
.setHTML(`<strong>Destination</strong><br>${e.features[0].properties.label}`)
.addTo(map);
});
// Change cursor on hover
map.on('mouseenter', 'pickup_point', () => map.getCanvas().style.cursor = 'pointer');
map.on('mouseleave', 'pickup_point', () => map.getCanvas().style.cursor = '');
map.on('mouseenter', 'drop_point', () => map.getCanvas().style.cursor = 'pointer');
map.on('mouseleave', 'drop_point', () => map.getCanvas().style.cursor = '');
var bbox = turf.bbox(geojsonPoints)
map.fitBounds(bbox, { padding: 50 })
})
</script>
{{ end }}

View File

@ -40,32 +40,32 @@
{{range .ViewState.bookings}}
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<a class="text-co-blue" href="/app/organized-carpool/drivers/{{.DriverId}}">
{{ (index $.ViewState.drivers_map .DriverId).Data.first_name }}
{{ (index $.ViewState.drivers_map .DriverId).Data.last_name }}
<a class="text-co-blue" href="/app/organized-carpool/drivers/{{.Driver.Id}}">
{{ (index $.ViewState.drivers_map .Driver.Id).Data.first_name }}
{{ (index $.ViewState.drivers_map .Driver.Id).Data.last_name }}
</a>
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<a class="text-co-blue" href="/app/beneficiaries/{{.PassengerId}}">
{{ (index $.ViewState.passengers_map .PassengerId).Data.first_name }}
{{ (index $.ViewState.passengers_map .PassengerId).Data.last_name }}
<a class="text-co-blue" href="/app/beneficiaries/{{.Passenger.Id}}">
{{ (index $.ViewState.passengers_map .Passenger.Id).Data.first_name }}
{{ (index $.ViewState.passengers_map .Passenger.Id).Data.last_name }}
</a>
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{ .Journey.PassengerPickup.Properties.label }}
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
{{ .PassengerPickupAddress }}
</td>
<td class="py-4 pl-4 pr-3 text-sm sm:pl-6">
{{ .PassengerDropAddress }}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{ .Journey.PassengerDrop.Properties.label }}
{{ timeFormat .PassengerPickupDate.AsTime "02/01/2006 15:04" }}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{ .Journey.PassengerPickupDate.Format "02/01/2006 15:04" }}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{ if eq .Status "WAITING_CONFIRMATION"}}
{{ if eq .Status.String "WAITING_DRIVER_CONFIRMATION"}}
<span class="p-1 text-xs bg-gray-300 rounded-xl">Attente confirmation</span>
{{ else if eq .Status "VALIDATED"}}
{{ else if eq .Status.String "VALIDATED"}}
<span class="p-1 text-xs bg-co-green rounded-xl">Validé</span>
{{ else if eq .Status "CANCELLED"}}
{{ else if eq .Status.String "CANCELLED"}}
<span class="p-1 text-xs bg-co-red text-white rounded-xl">Annulé</span>
{{ end }}
</td>

View File

@ -65,7 +65,11 @@
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">{{if .Data.address_destination}}{{.Data.address_destination.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 carpoolDriverValidatedProfile . (carpoolDocuments .ID) }}
<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>
{{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"

View File

@ -12,11 +12,23 @@
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Départ passager</dt>
<dd class="mt-1 text-sm text-gray-900">{{(index .journey.Features 0).Properties.MustString "label"}}</dd>
<dd class="mt-1 text-sm text-gray-900">
{{ if .journey.ExtraMembers.passenger_pickup }}
{{ .journey.ExtraMembers.passenger_pickup.properties.label }}
{{ else }}
Adresse non disponible
{{ end }}
</dd>
</div>
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Destination passager</dt>
<dd class="mt-1 text-sm text-gray-900">{{(index .journey.Features 1).Properties.MustString "label"}}</dd>
<dd class="mt-1 text-sm text-gray-900">
{{ if .journey.ExtraMembers.passenger_drop }}
{{ .journey.ExtraMembers.passenger_drop.properties.label }}
{{ else }}
Adresse non disponible
{{ end }}
</dd>
</div>
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Départ conducteur</dt>

View File

@ -0,0 +1,168 @@
{{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">
Covoiturage solidaire
</h1>
{{ if eq .ViewState.booking.Status.String "WAITING_DRIVER_CONFIRMATION"}}
<div class="mt-4"><span class="p-2 text-sm bg-gray-300 rounded-2xl px-4">Attente confirmation</span></div>
{{ else if eq .ViewState.booking.Status.String "CONFIRMED"}}
<div class="mt-4"><span class="p-1 text-sm bg-co-green rounded-2xl px-4">Confirmé</span></div>
{{ else if eq .ViewState.booking.Status.String "CANCELLED"}}
<div class="mt-4"><span class="p-1 text-sm bg-co-red text-white rounded-2xl px-4">Annulé</span></div>
{{ end }}
<div class="mt-6 flex justify-end space-x-3">
{{if eq .ViewState.booking.Status.String "WAITING_DRIVER_CONFIRMATION" }}
<a href="/app/organized-carpool/bookings/{{.ViewState.booking.Id}}/confirm" class="inline-flex">
<button type="button" class="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">
Confirmer
</button>
</a>
{{end}}
{{if ne .ViewState.booking.Status.String "WAITING_DRIVER_CONFIRMATION" }}
<a href="/app/organized-carpool/bookings/{{.ViewState.booking.Id}}/waitconfirmation" class="inline-flex">
<button type="button" class="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">
Remettre en attente
</button>
</a>
{{end}}
{{if ne .ViewState.booking.Status.String "CANCELLED" }}
{{$dialog := "cancel"}}
<div x-data="{ {{ $dialog }}: false}">
<button @click="{{ $dialog }} = !{{ $dialog }}" type="button" class="bg-co-red border-gray-300 border px-4 py-2 text-white items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
Annuler
</button>
<div x-show="{{$dialog}}" class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true">
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 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-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full max-w-lg sm:p-6">
<form method="POST" action="/app/organized-carpool/bookings/{{.ViewState.booking.Id}}/cancel">
<div class="mx-auto flex h-12 w-12 items-center justify-center rounded-co bg-co-blue text-white">
{{$.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}}
</div>
<div class="mt-3 text-center sm:mt-5">
<h3 class="text-lg font-medium leading-6 text-gray-900" id="modal-title">Annuler</h3>
<div class="mt-2">
<p class="text-sm text-gray-500">Êtes-vous sûr de vouloir annuler ce covoiturage ?</p>
</div>
</div>
<div class="mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2">
<button @click="{{$dialog}} = !{{$dialog}}" type="button" class="mt-3 inline-flex w-full justify-center rounded-l-2xl border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:col-start-1 sm:mt-0 sm:text-sm">Annuler</button>
<button type="submit" class="inline-flex w-full justify-center rounded-r-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:col-start-2 sm:text-sm">Confirmer</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{{end}}
<a href='/app/journeys/?departure={"type":"Feature","geometry":{"type":"Point","coordinates":[{{.ViewState.booking.PassengerPickupLng}},{{.ViewState.booking.PassengerPickupLat}}]},"properties":{"label":"{{.ViewState.booking.PassengerPickupAddress}}"}}&destination={"type":"Feature","geometry":{"type":"Point","coordinates":[{{.ViewState.booking.PassengerDropLng}},{{.ViewState.booking.PassengerDropLat}}]},"properties":{"label":"{{.ViewState.booking.PassengerDropAddress}}"}}&passengerid={{.ViewState.passenger.ID}}' class="inline-flex">
<button type="button" class="px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm bg-white text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">
Dupliquer
</button>
</a>
{{if eq .ViewState.booking.Status.String "CANCELLED" }}
<a href='/app/journeys/?departure={"type":"Feature","geometry":{"type":"Point","coordinates":[{{.ViewState.booking.PassengerPickupLng}},{{.ViewState.booking.PassengerPickupLat}}]},"properties":{"label":"{{.ViewState.booking.PassengerPickupAddress}}"}}&destination={"type":"Feature","geometry":{"type":"Point","coordinates":[{{.ViewState.booking.PassengerDropLng}},{{.ViewState.booking.PassengerDropLat}}]},"properties":{"label":"{{.ViewState.booking.PassengerDropAddress}}"}}&departuredate={{ timeFormat .ViewState.booking.PassengerPickupDate.AsTime "2006-01-02"}}&departuretime={{ timeFormat .ViewState.booking.PassengerPickupDate.AsTime "15:04"}}&passengerid={{.ViewState.passenger.ID}}&organized_carpool_exclude_driver={{.ViewState.driver.ID}}' class="inline-flex">
<button type="button" class="px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm bg-white text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">
Solliciter un autre conducteur
</button>
</a>
{{end}}
</div>
</div>
<div class="max-w-7xl mx-auto py-8 px-4 sm:px-6 md:px-8">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Booking Details -->
<div class="bg-white shadow overflow-hidden sm:rounded-lg">
<div class="px-4 py-5 sm:px-6">
<h3 class="text-lg leading-6 font-medium text-gray-900">Détails du covoiturage</h3>
<p class="mt-1 max-w-2xl text-sm text-gray-500">Informations sur le trajet</p>
</div>
<div class="border-t border-gray-200 px-4 py-5 sm:p-0">
<dl class="sm:divide-y sm:divide-gray-200">
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium text-gray-500">Conducteur</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
<a class="text-co-blue" href="/app/organized-carpool/drivers/{{ .ViewState.driver.ID }}">{{ .ViewState.driver.Data.first_name }} {{ .ViewState.driver.Data.last_name }}</a>
</dd>
</div>
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium text-gray-500">Passager</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
<a class="text-co-blue" href="/app/beneficiaries/{{ .ViewState.driver.ID }}">{{ .ViewState.passenger.Data.first_name }} {{ .ViewState.passenger.Data.last_name }}</a>
</dd>
</div>
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium text-gray-500">Départ conducteur</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
{{ .ViewState.driverDepartureAddress }}
</dd>
</div>
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium text-gray-500">Prise en charge passager</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
{{ .ViewState.booking.PassengerPickupAddress }}
</dd>
</div>
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium text-gray-500">Dépose passager</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
{{ .ViewState.booking.PassengerDropAddress }}
</dd>
</div>
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium text-gray-500">Arrivée conducteur</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
{{ if .ViewState.driverArrivalAddress }}
{{ .ViewState.driverArrivalAddress }}
{{ end }}
</dd>
</div>
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium text-gray-500">Date et heure</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
{{ timeFormat .ViewState.booking.PassengerPickupDate.AsTime "02/01/2006 15:04" }}
</dd>
</div>
<div class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium text-gray-500">Prix</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
{{ if .ViewState.booking.Price }}
{{ if eq .ViewState.booking.Price.Type.String "FREE" }}
<span class="text-co-green font-medium">Gratuit</span>
{{ else if eq .ViewState.booking.Price.Type.String "PAYING" }}
<span class="font-medium">{{ printf "%.2f" .ViewState.booking.Price.Amount }} {{ .ViewState.booking.Price.Currency }}</span>
{{ else }}
<span class="text-gray-500">Prix non défini</span>
{{ end }}
{{ else }}
<span class="text-gray-500">Prix non disponible</span>
{{ end }}
</dd>
</div>
</dl>
</div>
</div>
<!-- Map -->
<div class="bg-white shadow overflow-hidden sm:rounded-lg">
<div class="border-t border-gray-200 h-full">
<div class="h-full min-h-96">
{{ template "organized_carpool_map" .ViewState }}
</div>
</div>
</div>
</div>
</div>
{{ end }}

View File

@ -28,8 +28,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/organized-carpool/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>
@ -44,6 +44,16 @@
</div>
<div class="border-t border-gray-200 px-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="text-sm font-medium text-gray-500">Profil validé</dt>
<dd class="mt-1 text-sm text-gray-900">
{{if carpoolDriverValidatedProfile .ViewState.driver .ViewState.documents}}
<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>
{{end}}
</dd>
</div>
{{if .ViewState.driver.Data.email}}
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Email</dt>

View File

@ -0,0 +1,174 @@
{{ 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 covoitureur solidaire</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 covoitureur solidaire</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}}
{{ $fieldName := "address_destination" }}
{{if .ViewState.driver.Data.address_destination}}
{{$default := .ViewState.driver.Data.address_destination}}
{{ template "address" dict "FieldName" $fieldName "Default" $default "Label" "Adresse destination"}}
{{else}}
{{ template "address_autocomplete" dict "FieldName" $fieldName "Label" "Adresse destination"}}
{{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="other_properties.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>
</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/organized-carpool/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 covoitureur solidaire</button>
</div>
</form>
</div>
{{end}}

View File

@ -5,11 +5,32 @@
<div class="max-w-7xl mx-auto py-8 px-4 sm:px-6 md:px-8">
{{template "journey_preview" (dict "journey" .ViewState.journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries)}}
{{if ne .ViewState.passenger.ID ""}}
<div class="max-w-7xl m-auto px-4 sm:px-6 md:px-8 flex justify-items-center">
<div class="max-w-7xl m-auto px-4 sm:px-6 md:px-8 flex flex-col justify-items-center">
<form method="POST">
<button class="w-100 bg-co-blue border-gray-300 border px-4 py-2 text-white items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
Envoyer la mise en relation
</button>
<div class="m-auto text-center">
<label for="motivation" class="block text-sm font-medium text-gray-700">Motif du trajet</label>
<select name="motivation" id="motivation"
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">
<option value="Administratif">Administratif</option>
<option value="Commerce">Commerce</option>
<option value="Courses">Courses</option>
<option value="Insertion">Insertion</option>
<option value="Loisirs">Loisirs</option>
<option value="Travail">Travail</option>
<option value="Formation">Formation</option>
<option value="Visite à un proche">Visite à un proche</option>
<option value="Santé">Santé</option>
<option selected="selected" value="">Autre&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
</select>
</div>
{{template "submit_with_sms"
dict "IconSet" .IconSet
"Viewstate" .ViewState
"ComponentState" (dict "submitText" "Envoyer la demande de covoiturage"
"doNotSendOption" true)
"SMSState" (dict "name" (.ViewState.config.GetString "service_name")
"datetime" (or (timeFormat .ViewState.journey.ExtraMembers.departure_date "02/01/2006") "À définir")
"baseUrl" (.ViewState.config.GetString "base_url") )}}
</form>
</div>
{{end}}

View File

@ -4,7 +4,7 @@
<h1 class="text-2xl font-semibold text-gray-900">Covoiturage solidaire</h1>
<div class="bg-white shadow sm:rounded-lg sm:overflow-hidden my-4" x-data="{
tab: 'drivers',
tab: 'trips',
to(event) {
this.tab = event.target.value
}
@ -14,6 +14,11 @@
<div class="hidden sm:block">
<div class="border-b border-gray-200 pl-4">
<nav class="-mb-px flex space-x-8" aria-label="Tabs">
<a href="#" @click="tab = 'trips'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'trips' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Trajets </a>
<a href="#" @click="tab = 'drivers'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'drivers' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
@ -23,21 +28,16 @@
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'beneficiaries' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Bénéficiaires </a>-->
<a href="#" @click="tab = 'trips'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'solidarityService' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Trajets </a>
</nav>
</div>
</div>
</div>
<div x-show="tab == 'trips'">{{template "carpool_bookings_list" .}}</div>
<div x-show="tab == 'drivers'">{{template "carpool_drivers_list" .}}</div>
<div x-show="tab == 'beneficiaries'">1</div>
<div x-show="tab == 'trips'">{{template "carpool_bookings_list" .}}</div>
</div>
</div>

View File

@ -67,7 +67,7 @@ x-data="{
<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/solidarity-transport/drivers/{{$.ViewState.driver.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>
<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">Télécharger<span class="sr-only"> le document</span></button>
</a>
</td>
</tr>

View File

@ -0,0 +1,46 @@
{{define "driver_wallet"}}
<div class="px-4 py-6 sm:px-6 text-center"
x-data="{
walletdialog: false
}">
<div class="px-4 py-5 sm:px-6">
<p class="text-center text-lg">Solde : {{if .ViewState.driver.Data.wallet}}{{ printf "%.2f" .ViewState.driver.Data.wallet }}{{else}}0{{end}} €</p>
<button @click="walletdialog = !walletdialog"
class="rounded-2xl border border-transparent bg-co-blue px-4 py-2 my-4 mt-8 w-full 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">
Créditer le compte
</button>
<div class="relative z-10" aria-labelledby="modal-title" role="dialog" aria-modal="true"
x-show="walletdialog">
<div class="fixed inset-0 bg-gray-900 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-lg 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>
<div class="mt-3 text-center sm:mt-5">
<h3 class="text-lg font-medium leading-6 text-gray-900" id="modal-title">Créditer le compte</h3>
<div class="mt-2">
<p class="text-sm text-gray-500">Créditer le compte mobilité du conducteur</p>
</div>
</div>
</div>
<form method="POST" action="/app/wallets/{{.ViewState.driver.ID}}/credit" class="my-4">
<div class="my-8">
<input type="number" step="0.01" id="amount" name="amount" value="0"
class="w-full shadow-sm focus:ring-co-blue focus:border-co-blue px-2 p-1 sm:text-sm border-gray-300 rounded-2xl">
</div>
<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">Ajouter</button>
</div>
<div class="mt-5 sm:mt-6">
<button @click="walletdialog=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>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
{{end}}

View File

@ -38,7 +38,7 @@
</div>
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Horaire départ conducteur</dt>
<dd class="mt-1 text-sm text-gray-900">{{ .driver_journey.DriverDepartureDate.Format "02/01/2006 15:04"}}</dd>
<dd class="mt-1 text-sm text-gray-900">{{ timeFormat .driver_journey.DriverDepartureDate "02/01/2006 15:04"}}</dd>
</div>
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Horaire rendez vous passager</dt>

View File

@ -129,6 +129,8 @@
<option value="documents">Documents</option>
<option value="wallet">Compte mobilité</option>
<option value="history">Historique</option>
</select>
</div>
@ -146,6 +148,11 @@
:class="tab == 'documents' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Documents </a>
<a href="#" @click="tab = 'wallet'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'wallet' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
Compte mobilité </a>
<a href="#" @click="tab = 'history'"
class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm"
:class="tab == 'history' ? 'border-co-blue text-co-blue' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'">
@ -157,6 +164,7 @@
</div>
<div x-show="tab == 'documents'">{{template "driver_files" .}}</div>
<div x-show="tab == 'wallet'">{{template "driver_wallet" .}}</div>
<div x-show="tab == 'history'">{{template "driver_history" .}}</div>
</div>

View File

@ -701,6 +701,9 @@
.h-50 {
height: calc(var(--spacing) * 50);
}
.h-96 {
height: calc(var(--spacing) * 96);
}
.h-full {
height: 100%;
}
@ -716,6 +719,12 @@
.max-h-screen {
max-height: 100vh;
}
.min-h-96 {
min-height: calc(var(--spacing) * 96);
}
.min-h-100 {
min-height: calc(var(--spacing) * 100);
}
.min-h-full {
min-height: 100%;
}
@ -761,9 +770,6 @@
.w-48 {
width: calc(var(--spacing) * 48);
}
.w-100 {
width: calc(var(--spacing) * 100);
}
.w-auto {
width: auto;
}
@ -803,6 +809,9 @@
.min-w-full {
min-width: 100%;
}
.min-w-max {
min-width: max-content;
}
.min-w-screen {
min-width: 100vw;
}
@ -1243,6 +1252,9 @@
.gap-6 {
gap: calc(var(--spacing) * 6);
}
.gap-8 {
gap: calc(var(--spacing) * 8);
}
.-space-y-px {
:where(& > :not(:last-child)) {
--tw-space-y-reverse: 0;
@ -3594,6 +3606,11 @@
grid-template-columns: repeat(1, minmax(0, 1fr));
}
}
.lg\:grid-cols-2 {
@media (width >= 64rem) {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
.lg\:grid-cols-3 {
@media (width >= 64rem) {
grid-template-columns: repeat(3, minmax(0, 1fr));
@ -3672,13 +3689,6 @@
}
}
}
.dark\:focus-visible\:outline-indigo-500 {
@media (prefers-color-scheme: dark) {
&:focus-visible {
outline-color: var(--color-indigo-500);
}
}
}
}
@font-face {
font-family: "Manometer";

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB