diff --git a/config.yaml b/config.yaml index c1b9959..6dd13f3 100644 --- a/config.yaml +++ b/config.yaml @@ -97,13 +97,9 @@ views: - web/layouts/beneficiaries/_partials/beneficiary-events.html - web/layouts/beneficiaries/_partials/beneficiary-files.html - web/layouts/beneficiaries/_partials/beneficiary-organizations.html - - web/layouts/beneficiaries/_partials/beneficiary-diags.html - web/layouts/beneficiaries/_partials/beneficiary-wallet.html - web/layouts/beneficiaries/_partials/beneficiary-solidarity-transport.html - web/layouts/beneficiaries/display.html - create_diag: - files: - - web/layouts/beneficiaries/create-diag.html update: files: - web/layouts/_partials/address_autocomplete.html @@ -330,8 +326,10 @@ views: organized_carpool: overview: files: + - web/layouts/organized_carpool/_partials/booking_filters.html - web/layouts/organized_carpool/_partials/drivers_list.html - web/layouts/organized_carpool/_partials/bookings_list.html + - web/layouts/organized_carpool/_partials/bookings_history.html - web/layouts/organized_carpool/overview.html driver_create: files: diff --git a/web/layouts/beneficiaries/display.html b/web/layouts/beneficiaries/display.html index e46a17f..186bd35 100644 --- a/web/layouts/beneficiaries/display.html +++ b/web/layouts/beneficiaries/display.html @@ -209,7 +209,6 @@
{{template "beneficiary_wallet" .}}
{{if moduleAvailable "solidarity_transport"}}
{{template "beneficiary_solidarity_transport" .}}
{{end}}
{{template "beneficiary_organizations" .}}
- diff --git a/web/layouts/journeys/_partials/journeys-organized-carpools.html b/web/layouts/journeys/_partials/journeys-organized-carpools.html index 06b484b..3c30aad 100644 --- a/web/layouts/journeys/_partials/journeys-organized-carpools.html +++ b/web/layouts/journeys/_partials/journeys-organized-carpools.html @@ -22,7 +22,7 @@ - Distance du covoiturage + Date et heure @@ -41,7 +41,11 @@ {{ $driver.Data.first_name }} {{ $driver.Data.last_name }} {{ .DriverDepartureAddress }} {{ .DriverArrivalAddress }} - {{ .Distance }} km + + {{ if .PassengerPickupDate }} + {{ .PassengerPickupDate.AsTime.Format "02/01/2006 15:04" }} + {{ end }} + {{if carpoolDriverValidatedProfile $driver (carpoolDocuments $driver.ID) }} Oui @@ -51,7 +55,7 @@ + href="/app/organized-carpool/drivers/{{$driver.ID}}/journeys/{{.Id}}?passengerid={{$.ViewState.passengerid}}"> Organiser diff --git a/web/layouts/organized_carpool/_partials/booking_filters.html b/web/layouts/organized_carpool/_partials/booking_filters.html new file mode 100644 index 0000000..c9e7c29 --- /dev/null +++ b/web/layouts/organized_carpool/_partials/booking_filters.html @@ -0,0 +1,45 @@ +{{ define "booking_filters" }} +{{$tab := or .tab "carpoolService"}} + +
+ + + +
+ +
+
+ +
+ + +
+
+
+ +
+ +
+ + +
+
+ + +
+ +
+ +
+ +
+{{ end }} diff --git a/web/layouts/organized_carpool/_partials/bookings_history.html b/web/layouts/organized_carpool/_partials/bookings_history.html new file mode 100644 index 0000000..0f8c9cc --- /dev/null +++ b/web/layouts/organized_carpool/_partials/bookings_history.html @@ -0,0 +1,96 @@ + +{{ define "carpool_bookings_history" }} +{{template "booking_filters" dict "tab" "carpoolHistory" "filters" .ViewState.hist_filters }} +{{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 + + Prix + +   +
+ + {{ (index $.ViewState.drivers_map .Driver.Id).Data.first_name }} + {{ (index $.ViewState.drivers_map .Driver.Id).Data.last_name }} + + + + {{ (index $.ViewState.passengers_map .Passenger.Id).Data.first_name }} + {{ (index $.ViewState.passengers_map .Passenger.Id).Data.last_name }} + + + {{ .PassengerPickupAddress }} + + {{ .PassengerDropAddress }} + + {{ timeFormat .PassengerPickupDate.AsTime "02/01/2006 15:04" }} + + {{ if eq .Status.String "WAITING_DRIVER_CONFIRMATION"}} + Attente confirmation + {{ else if eq .Status.String "CONFIRMED"}} + Confirmé + {{ else if eq .Status.String "VALIDATED"}} + Validé + {{ else if eq .Status.String "CANCELLED"}} + Annulé + {{ end }} + + {{ if .Price }} + {{ printf "%.2f" (round2 .Price.Amount) }} {{ .Price.Currency }} + {{ else }} + N/A + {{ end }} + + + Voir + +
+{{end}} +{{end}} diff --git a/web/layouts/organized_carpool/_partials/bookings_list.html b/web/layouts/organized_carpool/_partials/bookings_list.html index 33c179e..f8e51b1 100644 --- a/web/layouts/organized_carpool/_partials/bookings_list.html +++ b/web/layouts/organized_carpool/_partials/bookings_list.html @@ -1,5 +1,6 @@ {{ define "carpool_bookings_list" }} +{{template "booking_filters" dict "tab" "carpoolService" "filters" .ViewState.filters }} {{if eq (len .ViewState.bookings) 0}}
Aucun trajet déclaré
{{else}} @@ -30,6 +31,10 @@ class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6"> Statut + + Prix +   @@ -63,12 +68,23 @@ {{ if eq .Status.String "WAITING_DRIVER_CONFIRMATION"}} Attente confirmation + {{ else if eq .Status.String "WAITING_PASSENGER_CONFIRMATION"}} + Attente confirmation passager + {{ else if eq .Status.String "CONFIRMED"}} + Confirmé {{ else if eq .Status.String "VALIDATED"}} Validé {{ else if eq .Status.String "CANCELLED"}} Annulé {{ end }} + + {{ if .Price }} + {{ printf "%.2f" (round2 .Price.Amount) }} {{ .Price.Currency }} + {{ else }} + N/A + {{ end }} + Voir diff --git a/web/layouts/organized_carpool/_partials/journey_preview.html b/web/layouts/organized_carpool/_partials/journey_preview.html index 526dd6f..2aaa291 100644 --- a/web/layouts/organized_carpool/_partials/journey_preview.html +++ b/web/layouts/organized_carpool/_partials/journey_preview.html @@ -39,9 +39,31 @@
{{(index .journey.Features 1).Properties.MustString "label"}}
-
Prix (passager)
-
0 EUR
+
Date et heure
+
+ {{ if .journey.ExtraMembers.departure_date }} + {{ timeFormat .journey.ExtraMembers.departure_date "02/01/2006 15:04" }} + {{ else }} + Non définie + {{ end }} +
+
+
Prix (passager)
+
+ {{if .pricing_result}} + {{ printf "%.2f" (round2 .pricing_result.passenger.Amount) }} {{.pricing_result.passenger.Currency}} + {{else}} + 0.00 EUR + {{end}} +
+
+ {{if and .pricing_result .pricing_result.driver (gt (round2 .pricing_result.driver.Amount) 0.0)}} +
+
Indemnité conducteur
+
{{ printf "%.2f" (round2 .pricing_result.driver.Amount) }} {{.pricing_result.driver.Currency}}
+
+ {{end}}
Distance passager
{{ printf "%.2f" .journey.ExtraMembers.passenger_distance }} km
@@ -299,7 +321,7 @@
Compte mobilié (solde)
-
{{if .passenger.Data.wallet}}{{ .passenger.Data.wallet }}{{else}}0{{end}} EUR
+
{{ printf "%.2f" (round2 .passenger_wallet_balance) }} EUR
diff --git a/web/layouts/organized_carpool/booking_display.html b/web/layouts/organized_carpool/booking_display.html index cf1c20e..61d2c8d 100644 --- a/web/layouts/organized_carpool/booking_display.html +++ b/web/layouts/organized_carpool/booking_display.html @@ -135,13 +135,13 @@
-
Prix
+
Prix (passager)
{{ if .ViewState.booking.Price }} {{ if eq .ViewState.booking.Price.Type.String "FREE" }} Gratuit {{ else if eq .ViewState.booking.Price.Type.String "PAYING" }} - {{ printf "%.2f" .ViewState.booking.Price.Amount }} {{ .ViewState.booking.Price.Currency }} + {{ printf "%.2f" (round2 .ViewState.booking.Price.Amount) }} {{ .ViewState.booking.Price.Currency }} {{ else }} Prix non défini {{ end }} @@ -150,6 +150,24 @@ {{ end }}
+ {{if and .ViewState.booking.DriverCompensationAmount .ViewState.booking.DriverCompensationCurrency}} + {{if gt (round2 .ViewState.booking.DriverCompensationAmount) 0.0}} +
+
Indemnité conducteur
+
+ {{ printf "%.2f" (round2 .ViewState.booking.DriverCompensationAmount) }} {{ .ViewState.booking.DriverCompensationCurrency }} +
+
+ {{end}} + {{end}} + {{if .ViewState.booking.Motivation}} +
+
Motif
+
+ {{.ViewState.booking.Motivation}} +
+
+ {{end}} diff --git a/web/layouts/organized_carpool/journey.html b/web/layouts/organized_carpool/journey.html index ee9b3bc..9be8751 100644 --- a/web/layouts/organized_carpool/journey.html +++ b/web/layouts/organized_carpool/journey.html @@ -3,24 +3,22 @@

Organiser le covoiturage

- {{template "journey_preview" (dict "journey" .ViewState.journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries)}} + {{template "journey_preview" (dict "journey" .ViewState.journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries "passenger_wallet_balance" .ViewState.passenger_wallet_balance "pricing_result" .ViewState.pricing_result)}} {{if ne .ViewState.passenger.ID ""}}
+ {{if .ViewState.passenger}} + {{if lt .ViewState.passenger_wallet_balance .ViewState.pricing_result.passenger.Amount}} +

Le solde du compte mobilité est insuffisant.

+ {{end}} + {{end}}
{{template "submit_with_sms" diff --git a/web/layouts/organized_carpool/overview.html b/web/layouts/organized_carpool/overview.html index 01006d8..246b159 100644 --- a/web/layouts/organized_carpool/overview.html +++ b/web/layouts/organized_carpool/overview.html @@ -1,10 +1,10 @@ {{ define "content" }} - +{{$defaultTab := "carpoolService"}}

Covoiturage solidaire

-
{{template "carpool_bookings_list" .}}
+
{{template "carpool_bookings_list" .}}
{{template "carpool_drivers_list" .}}
-
1
+
{{template "carpool_bookings_history" .}}
diff --git a/web/layouts/solidarity_transport/_partials/bookings_history.html b/web/layouts/solidarity_transport/_partials/bookings_history.html index dbe367f..ccbc372 100644 --- a/web/layouts/solidarity_transport/_partials/bookings_history.html +++ b/web/layouts/solidarity_transport/_partials/bookings_history.html @@ -75,7 +75,7 @@ {{ end }} - {{ .Journey.Price.Amount }} {{ .Journey.Price.Currency }} + {{ printf "%.2f" (round2 .Journey.Price.Amount) }} {{ .Journey.Price.Currency }} diff --git a/web/layouts/solidarity_transport/_partials/journey_preview.html b/web/layouts/solidarity_transport/_partials/journey_preview.html index cd967be..3bffd2a 100644 --- a/web/layouts/solidarity_transport/_partials/journey_preview.html +++ b/web/layouts/solidarity_transport/_partials/journey_preview.html @@ -52,25 +52,25 @@
Prix (passager)
{{if .pricing_result}} - {{ printf "%.2f" .pricing_result.passenger.Amount }} {{.pricing_result.passenger.Currency}} + {{ printf "%.2f" (round2 .pricing_result.passenger.Amount) }} {{.pricing_result.passenger.Currency}} {{else if .booking}} - {{ printf "%.2f" .booking.Journey.Price.Amount }} {{.booking.Journey.Price.Currency}} + {{ printf "%.2f" (round2 .booking.Journey.Price.Amount) }} {{.booking.Journey.Price.Currency}} {{else}} 0.00 EUR {{end}}
- {{if and .pricing_result .pricing_result.driver (gt .pricing_result.driver.Amount 0.0)}} + {{if and .pricing_result .pricing_result.driver (gt (round2 .pricing_result.driver.Amount) 0.0)}}
Indemnité conducteur
-
{{ printf "%.2f" .pricing_result.driver.Amount }} {{.pricing_result.driver.Currency}}
+
{{ printf "%.2f" (round2 .pricing_result.driver.Amount) }} {{.pricing_result.driver.Currency}}
{{else if .booking}} {{if .booking.DriverCompensationAmount}} - {{if gt . 0.0}} + {{if gt (round2 .booking.DriverCompensationAmount) 0.0}}
Indemnité conducteur
-
{{ printf "%.2f" . }} {{.booking.DriverCompensationCurrency}}
+
{{ printf "%.2f" (round2 .booking.DriverCompensationAmount) }} {{.booking.DriverCompensationCurrency}}
{{end}} {{end}} @@ -272,7 +272,7 @@ {{end}}
Compte mobilié (solde)
-
{{ printf "%.2f" .passenger_wallet_balance }} EUR
+
{{ printf "%.2f" (round2 .passenger_wallet_balance) }} EUR
diff --git a/web/layouts/solidarity_transport/booking_display.html b/web/layouts/solidarity_transport/booking_display.html index b2ae86b..d7424d1 100644 --- a/web/layouts/solidarity_transport/booking_display.html +++ b/web/layouts/solidarity_transport/booking_display.html @@ -157,6 +157,22 @@ {{end}} + {{if .ViewState.booking.Data.motivation}} +
+
Motif
+
+ {{$motivation := .ViewState.booking.Data.motivation}} + {{$found := false}} + {{range .ViewState.booking_motivations}} + {{if eq .value $motivation}} + {{.label}} + {{$found = true}} + {{end}} + {{end}} + {{if not $found}}{{$motivation}}{{end}} +
+
+ {{end}}
Distance passager
@@ -172,27 +188,19 @@
Prix (passager)
- {{ printf "%.2f" .ViewState.booking.Journey.Price.Amount }} {{ .ViewState.booking.Journey.Price.Currency }} + {{ printf "%.2f" (round2 .ViewState.booking.Journey.Price.Amount) }} {{ .ViewState.booking.Journey.Price.Currency }}
{{if .ViewState.booking.DriverCompensationAmount}} - {{if gt .ViewState.booking.DriverCompensationAmount 0.0}} + {{if gt (round2 .ViewState.booking.DriverCompensationAmount) 0.0}}
Indemnité conducteur
- {{ printf "%.2f" .ViewState.booking.DriverCompensationAmount }} {{.ViewState.booking.DriverCompensationCurrency}} + {{ printf "%.2f" (round2 .ViewState.booking.DriverCompensationAmount) }} {{.ViewState.booking.DriverCompensationCurrency}}
{{end}} {{end}} - {{if .ViewState.booking.Data.motivation}} -
-
Motif
-
- {{ .ViewState.booking.Data.motivation }} -
-
- {{end}} diff --git a/web/layouts/solidarity_transport/driver_journey.html b/web/layouts/solidarity_transport/driver_journey.html index 5a4c3b4..f53ceb4 100644 --- a/web/layouts/solidarity_transport/driver_journey.html +++ b/web/layouts/solidarity_transport/driver_journey.html @@ -45,14 +45,9 @@ {{template "submit_with_sms"