Many improvements
This commit is contained in:
parent
f12f7f581f
commit
d3e534fa72
41
config.yaml
41
config.yaml
|
@ -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,6 +223,8 @@ 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-solidarity-transport.html
|
||||
|
@ -307,6 +335,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
|
||||
|
|
|
@ -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 }}
|
|
@ -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"
|
||||
|
@ -161,4 +183,4 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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'],
|
||||
|
@ -113,6 +113,14 @@
|
|||
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" }}
|
||||
{{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>
|
||||
|
@ -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>
|
||||
|
|
|
@ -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}}
|
|
@ -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}}
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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}}
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
Loading…
Reference in New Issue