diff --git a/config.yaml b/config.yaml index b12b14c..ed97388 100644 --- a/config.yaml +++ b/config.yaml @@ -17,6 +17,10 @@ menu_items: title: Transport solidaire link: /app/solidarity-transport/ icon: tabler-icons:car + - name: organized_carpool + title: Covoiturage solidaire + link: /app/organized-carpool/ + icon: tabler-icons:car - name: vehicles title: Véhicules partagés link: /app/vehicles/ @@ -94,8 +98,7 @@ views: - web/layouts/administration/_partials/groups_admins.html - web/layouts/administration/_partials/group_members.html - web/layouts/group/settings.html - - + vehicles: search: files: @@ -196,6 +199,7 @@ views: - web/layouts/journeys/_partials/journeys-carpool.html - web/layouts/journeys/_partials/journeys-public-transit.html - web/layouts/journeys/_partials/journeys-solidarity-transport.html + - web/layouts/journeys/_partials/journeys-organized-carpools.html - web/layouts/journeys/search.html list: files: @@ -251,6 +255,7 @@ views: files: - web/layouts/solidarity_transport/_partials/drivers_list.html - web/layouts/solidarity_transport/_partials/bookings_list.html + - web/layouts/solidarity_transport/_partials/bookings_history.html - web/layouts/solidarity_transport/overview.html driver_create: files: @@ -271,6 +276,27 @@ views: - web/layouts/solidarity_transport/_partials/journey_preview.html - web/layouts/solidarity_transport/booking_display.html + organized_carpool: + overview: + files: + - web/layouts/organized_carpool/_partials/drivers_list.html + - web/layouts/organized_carpool/_partials/bookings_list.html + - web/layouts/organized_carpool/overview.html + driver_create: + files: + - web/layouts/_partials/address_autocomplete.html + - web/layouts/organized_carpool/driver_create.html + driver_display: + files: + - web/layouts/_partials/address_autocomplete.html + - web/layouts/organized_carpool/_partials/driver_availabilities.html + - web/layouts/solidarity_transport/_partials/driver_documents.html + - web/layouts/organized_carpool/driver_display.html + journey: + files: + - web/layouts/organized_carpool/_partials/journey_preview.html + - web/layouts/organized_carpool/journey.html + administration: home: files: diff --git a/web/assets/js/main.js b/web/assets/js/main.js index bd5f41d..773e98d 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -1,6 +1,7 @@ import '@kingshott/iodine'; import Alpine from 'alpinejs' import { Protocol } from "pmtiles"; +import { layers, namedFlavor } from '@protomaps/basemaps'; window.Alpine = Alpine diff --git a/web/layouts/beneficiaries/create.html b/web/layouts/beneficiaries/create.html index a725af1..dec1d48 100644 --- a/web/layouts/beneficiaries/create.html +++ b/web/layouts/beneficiaries/create.html @@ -14,6 +14,8 @@ birthdate: null, file_number: null }, + other_properties: {}, + other_properties_serialized: null, rules: { first_name: ['required'], last_name: ['required'], @@ -41,6 +43,7 @@ this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field]) }, submit(event) { + this.other_properties_serialized = JSON.stringify(this.other_properties) this.validate() if(!this.formValidation.valid) { this.isFormValid = false @@ -50,6 +53,7 @@ } }">
+
@@ -101,7 +105,7 @@ :class="formValidation.fields.birthdate.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
- +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+
+ + +
+

Covoitureurs solidaires

+ + {{template "journeys_organized_carpool" .}}

Transport solidaire

diff --git a/web/layouts/journeys/_partials/journeys-organized-carpools.html b/web/layouts/journeys/_partials/journeys-organized-carpools.html new file mode 100644 index 0000000..d6ec72a --- /dev/null +++ b/web/layouts/journeys/_partials/journeys-organized-carpools.html @@ -0,0 +1,53 @@ + +{{define "journeys_organized_carpool"}} +{{if .ViewState.organized_carpools}} +{{ if eq (len .ViewState.organized_carpools) 0}} +

Aucun covoitureur solidaire disponible pour ce trajet.

+{{else}} + + + + + + + + + + + + + {{ range .ViewState.organized_carpools }} + {{ $driver := (index $.ViewState.solidarity_drivers .Driver.Id)}} + + + + + + + + {{ end }} + +
+ Covoitureurs disponibles + + Départ conducteur + + Arrivée conducteur + + Distance du covoiturage + +   +
{{ $driver.Data.first_name }} {{ $driver.Data.last_name }}{{ .DriverDepartureAddress }}{{ .DriverArrivalAddress }}{{ .Distance }} km + + Organiser + +
+{{end}} +{{end}} +{{end}} diff --git a/web/layouts/journeys/search.html b/web/layouts/journeys/search.html index 48569f1..d5abf0c 100644 --- a/web/layouts/journeys/search.html +++ b/web/layouts/journeys/search.html @@ -110,6 +110,11 @@ :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 + + Covoiturage solidaire + @@ -122,6 +127,7 @@
{{template "journeys_all" .}}
{{template "journeys_carpool" .}}
{{template "journeys_public_transit" .}}
+
{{template "journeys_organized_carpool" .}}
{{template "journeys_solidarity_transport" .}}
{{template "journeys_others" .}}
diff --git a/web/layouts/layout.html b/web/layouts/layout.html index 126a357..236b316 100644 --- a/web/layouts/layout.html +++ b/web/layouts/layout.html @@ -6,14 +6,16 @@ PARCOURSMOB - - + + - + + + diff --git a/web/layouts/organized_carpool/_partials/bookings_list.html b/web/layouts/organized_carpool/_partials/bookings_list.html new file mode 100644 index 0000000..0f7dbfc --- /dev/null +++ b/web/layouts/organized_carpool/_partials/bookings_list.html @@ -0,0 +1,82 @@ + +{{ define "carpool_bookings_list" }} +{{if eq (len .ViewState.bookings) 0}} +
Aucun trajet déclaré
+{{else}} + + + + + + + + + + + + + + {{range .ViewState.bookings}} + + + + + + + + + + {{ end }} + +
+ Conducteur + + Passager + + Départ + + Destination + + Date + + Statut + +   +
+ + {{ (index $.ViewState.drivers_map .DriverId).Data.first_name }} + {{ (index $.ViewState.drivers_map .DriverId).Data.last_name }} + + + + {{ (index $.ViewState.passengers_map .PassengerId).Data.first_name }} + {{ (index $.ViewState.passengers_map .PassengerId).Data.last_name }} + + + {{ .Journey.PassengerPickup.Properties.label }} + + {{ .Journey.PassengerDrop.Properties.label }} + + {{ .Journey.PassengerPickupDate.Format "02/01/2006 15:04" }} + + {{ if eq .Status "WAITING_CONFIRMATION"}} + Attente confirmation + {{ else if eq .Status "VALIDATED"}} + Validé + {{ else if eq .Status "CANCELLED"}} + Annulé + {{ end }} + + + Voir + +
+{{end}} +{{end}} diff --git a/web/layouts/organized_carpool/_partials/driver_availabilities.html b/web/layouts/organized_carpool/_partials/driver_availabilities.html new file mode 100644 index 0000000..0c8eb84 --- /dev/null +++ b/web/layouts/organized_carpool/_partials/driver_availabilities.html @@ -0,0 +1,119 @@ + +{{define "driver_availabilities"}} + +
+
+

Trajets

+
+
+ +
+ + +{{end}} diff --git a/web/layouts/organized_carpool/_partials/drivers_list.html b/web/layouts/organized_carpool/_partials/drivers_list.html new file mode 100644 index 0000000..078c9d5 --- /dev/null +++ b/web/layouts/organized_carpool/_partials/drivers_list.html @@ -0,0 +1,73 @@ + +{{ define "carpool_drivers_list" }} +
+
+

+
+
+ + + + +
+
+ + + + + + + + + + + + + {{ range .ViewState.drivers }} + + + + + + + + + {{ end }} + +
+ Nom + + Adresse départ + + Adresse destination + + Téléphone + + Profil validé + +   +
{{ .Data.first_name }} {{ .Data.last_name }}{{if .Data.address}}{{.Data.address.properties.label}}{{end}}{{if .Data.address_destination}}{{.Data.address_destination.properties.label}}{{end}}{{ .Data.phone_number }} + Oui + + + Voir + +
+{{ end }} diff --git a/web/layouts/organized_carpool/_partials/journey_preview.html b/web/layouts/organized_carpool/_partials/journey_preview.html new file mode 100644 index 0000000..38fd900 --- /dev/null +++ b/web/layouts/organized_carpool/_partials/journey_preview.html @@ -0,0 +1,271 @@ + +{{define "journey_preview"}} +
+
+
+

Le trajet

+

Informations sur le trajet

+
+
+
+
+
+
+
Départ passager
+
{{(index .journey.Features 0).Properties.MustString "label"}}
+
+
+
Destination passager
+
{{(index .journey.Features 1).Properties.MustString "label"}}
+
+
+
Départ conducteur
+
{{(index .journey.Features 0).Properties.MustString "label"}}
+
+
+
Destination conducteur
+
{{(index .journey.Features 1).Properties.MustString "label"}}
+
+
+
Prix (passager)
+
0 EUR
+
+
+
+
+
+ +
+
+
+
+
+
+
+

Conducteur

+

{{.driver.Data.first_name}} {{.driver.Data.last_name}}

+
+
+
+
+ {{if .driver.Data.email}} +
+
Email
+
{{.driver.Data.email}}
+
+ {{end}} + {{if .driver.Data.phone_number}} +
+
Téléphone
+
{{.driver.Data.phone_number}}
+
+ {{end}} + {{if .driver.Data.birthdate}} +
+
Date de naissance
+
{{(timeFrom .driver.Data.birthdate).Format + "02/01/2006"}}
+
+ {{end}} + {{if and .driver.Data.gender (ne .driver.Data.gender "0")}} +
+
Genre
+
{{genderISO5218 .driver.Data.gender}}
+
+ {{end}} + {{if .driver.Data.address}} +
+
Adresse
+
{{.driver.Data.address.properties.label}}
+
+ {{end}} + {{if .driver.Data.file_number}} +
+
Numéro de dossier (CAF / Pole emploi)
+
{{.driver.Data.file_number}}
+
+ {{end}} +
+
+ +
+
+
+
+

Passager

+

{{if ne .passenger.ID "" }}{{.passenger.Data.first_name}} {{.passenger.Data.last_name}}{{end}}

+
+
+
+ {{if eq .passenger.ID ""}} +
+ +
+ + +
+ + + + +
    + + + + +
+
+
+ +
+ + + {{ else }} +
+ {{if .passenger.Data.email}} +
+
Email
+
{{.passenger.Data.email}}
+
+ {{end}} + {{if .passenger.Data.phone_number}} +
+
Téléphone
+
{{.passenger.Data.phone_number}}
+
+ {{end}} + {{if .passenger.Data.birthdate}} +
+
Date de naissance
+
{{(timeFrom .passenger.Data.birthdate).Format + "02/01/2006"}}
+
+ {{end}} + {{if and .passenger.Data.gender (ne .passenger.Data.gender "0")}} +
+
Genre
+
{{genderISO5218 .passenger.Data.gender}}
+
+ {{end}} + {{if .passenger.Data.address}} +
+
Adresse
+
{{.passenger.Data.address.properties.label}}
+
+ {{end}} + {{if .passenger.Data.file_number}} +
+
Numéro de dossier (CAF / Pole emploi)
+
{{.passenger.Data.file_number}}
+
+ {{end}} +
+
Compte mobilié (solde)
+
{{if .passenger.Data.wallet}}{{ .passenger.Data.wallet }}{{else}}0{{end}} EUR
+
+
+
+ + {{end}} +
+ + +{{end}} diff --git a/web/layouts/organized_carpool/driver_create.html b/web/layouts/organized_carpool/driver_create.html new file mode 100644 index 0000000..8a6d8a9 --- /dev/null +++ b/web/layouts/organized_carpool/driver_create.html @@ -0,0 +1,178 @@ + +{{ define "content" }} + +
+

Créer un covoitureur solidaire

+
+ +
+
+
+
+
+

Informations obligatoires

+

Informations personnelles obligatoires pour créer le conducteur

+
+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ {{ $fieldName := "address" }} + {{ template "address_autocomplete" dict "FieldName" $fieldName "FieldLabel" "Adresse principale" }} + +
+
+
+
+ +
+
+
+

Informations optionnelles

+

Autres informations de profil optionnelles

+
+
+
+ {{ $fieldName2 := "address_destination" }} + {{ template "address_autocomplete" dict "FieldName" $fieldName2 "FieldLabel" "Adresse destination" }} + +
+ +
+ +
+
+ + + + +
+
+
+
+ + +
+

Certains champs de sont pas valides.

+ + + + +
+
+
+{{end}} + diff --git a/web/layouts/organized_carpool/driver_display.html b/web/layouts/organized_carpool/driver_display.html new file mode 100644 index 0000000..8b94853 --- /dev/null +++ b/web/layouts/organized_carpool/driver_display.html @@ -0,0 +1,139 @@ + +{{define "content"}} +
+ +
+
+
+
+ + +
+
+
+

{{.ViewState.driver.Data.first_name}} + {{.ViewState.driver.Data.last_name}}

+

{{if .ViewState.driver.Metadata.created}}Ajouté le par + Conseiller 1{{end}} +

+
+
+
+ + +
+
+ +
+
+
+
+
+

+ Informations personnelles

+

Informations générales sur le conducteur solidaire.

+
+
+
+ {{if .ViewState.driver.Data.email}} +
+
Email
+
{{.ViewState.driver.Data.email}}
+
+ {{end}} + {{if .ViewState.driver.Data.phone_number}} +
+
Téléphone
+
{{.ViewState.driver.Data.phone_number}}
+
+ {{end}} + {{if .ViewState.driver.Data.birthdate}} +
+
Date de naissance
+
{{(timeFrom .ViewState.driver.Data.birthdate).Format + "02/01/2006"}}
+
+ {{end}} + {{if and .ViewState.driver.Data.gender (ne .ViewState.driver.Data.gender "0")}} +
+
Genre
+
{{genderISO5218 .ViewState.driver.Data.gender}}
+
+ {{end}} + {{if .ViewState.driver.Data.address}} +
+
Adresse principale
+
{{.ViewState.driver.Data.address.properties.label}}
+
+ {{end}} + {{if .ViewState.driver.Data.address_destination}} +
+
Adresse destination
+
{{.ViewState.driver.Data.address_destination.properties.label}}
+
+ {{end}} +
+
+
+
+ +
+
+
+
+
+ + +
+ +
+ +
{{template "driver_files" .}}
+ +
+
+
+
+ +
+ {{template "driver_availabilities" .}} +
+
+
+{{end}} diff --git a/web/layouts/organized_carpool/journey.html b/web/layouts/organized_carpool/journey.html new file mode 100644 index 0000000..df37fe6 --- /dev/null +++ b/web/layouts/organized_carpool/journey.html @@ -0,0 +1,17 @@ +{{define "content"}} +
+

Organiser le covoiturage

+
+
+ {{template "journey_preview" (dict "journey" .ViewState.journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries)}} +{{if ne .ViewState.passenger.ID ""}} +
+
+ +
+
+{{end}} + +{{end}} diff --git a/web/layouts/organized_carpool/overview.html b/web/layouts/organized_carpool/overview.html new file mode 100644 index 0000000..475cef3 --- /dev/null +++ b/web/layouts/organized_carpool/overview.html @@ -0,0 +1,48 @@ +{{ define "content" }} + +
+

Covoiturage solidaire

+ +
+
+
+ +
+ +
{{template "carpool_drivers_list" .}}
+ + +
1
+
{{template "carpool_bookings_list" .}}
+ +
+
+ + +
+ +{{ end }} diff --git a/web/layouts/solidarity_transport/_partials/bookings_history.html b/web/layouts/solidarity_transport/_partials/bookings_history.html new file mode 100644 index 0000000..75150ff --- /dev/null +++ b/web/layouts/solidarity_transport/_partials/bookings_history.html @@ -0,0 +1,82 @@ + +{{ define "solidarity_bookings_history" }} +{{if eq (len .ViewState.bookings_history) 0}} +
Aucun trajet dans le passé
+{{else}} + + + + + + + + + + + + + + {{range .ViewState.bookings_history}} + + + + + + + + + + {{ end }} + +
+ Conducteur + + Passager + + Départ + + Destination + + Date + + Statut + +   +
+ + {{ (index $.ViewState.drivers_map .DriverId).Data.first_name }} + {{ (index $.ViewState.drivers_map .DriverId).Data.last_name }} + + + + {{ (index $.ViewState.passengers_map .PassengerId).Data.first_name }} + {{ (index $.ViewState.passengers_map .PassengerId).Data.last_name }} + + + {{ .Journey.PassengerPickup.Properties.label }} + + {{ .Journey.PassengerDrop.Properties.label }} + + {{ .Journey.PassengerPickupDate.Format "02/01/2006 15:04" }} + + {{ if eq .Status "WAITING_CONFIRMATION"}} + Attente confirmation + {{ else if eq .Status "VALIDATED"}} + Validé + {{ else if eq .Status "CANCELLED"}} + Annulé + {{ end }} + + + Voir + +
+{{end}} +{{end}} diff --git a/web/layouts/solidarity_transport/_partials/drivers_list.html b/web/layouts/solidarity_transport/_partials/drivers_list.html index e3fdbb2..9acd730 100644 --- a/web/layouts/solidarity_transport/_partials/drivers_list.html +++ b/web/layouts/solidarity_transport/_partials/drivers_list.html @@ -52,7 +52,11 @@ {{if .Data.address}}{{.Data.address.properties.label}}{{end}} {{ .Data.phone_number }} + {{if and .Data.other_properties (gt .Data.other_properties.last_subscription_date "2025")}} Oui + {{else}} + Non + {{end}} Destination conducteur
{{.driver_journey.DriverArrival.Properties.label}}
-
Kilomètres passager
{{.driver_journey.PassengerDistance}} km
@@ -54,35 +53,88 @@
diff --git a/web/layouts/solidarity_transport/driver_create.html b/web/layouts/solidarity_transport/driver_create.html index c7c305b..a892688 100644 --- a/web/layouts/solidarity_transport/driver_create.html +++ b/web/layouts/solidarity_transport/driver_create.html @@ -13,6 +13,8 @@ phone_number: null, birthdate: null, }, + other_properties: {}, + other_properties_serialized: null, rules: { first_name: ['required'], last_name: ['required'], @@ -38,6 +40,7 @@ this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field]) }, submit(event) { + this.other_properties_serialized = JSON.stringify(this.other_properties) this.validate() if(!this.formValidation.valid) { this.isFormValid = false @@ -47,6 +50,7 @@ } }">
+
@@ -124,6 +128,13 @@
+ +
+ + +