From 27ce05a91a0fc8c0cc1006c5a5ddc21077438cf9 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Thu, 25 Sep 2025 13:25:33 +0200 Subject: [PATCH] Configurable fields in solidarity driver profile + wallet details display + change SMS --- sms/solidarity_transport/driver_accept.tmpl | 2 +- .../_partials/beneficiary-wallet.html | 109 ++++++++++++++++-- .../_partials/driver_wallet.html | 73 +++++++++++- .../_partials/journey_preview.html | 2 +- .../solidarity_transport/booking_display.html | 2 +- .../solidarity_transport/driver_create.html | 53 ++++++--- .../solidarity_transport/driver_display.html | 61 ++++++++-- .../solidarity_transport/driver_journey.html | 5 +- .../solidarity_transport/driver_update.html | 53 ++++++--- web/public/css/main.css | 62 ++++++++++ 10 files changed, 353 insertions(+), 69 deletions(-) diff --git a/sms/solidarity_transport/driver_accept.tmpl b/sms/solidarity_transport/driver_accept.tmpl index d435dff..8f6480d 100644 --- a/sms/solidarity_transport/driver_accept.tmpl +++ b/sms/solidarity_transport/driver_accept.tmpl @@ -1 +1 @@ -{{ define "sms_template" }}[{{ .name }}] {{ .driver_first_name }} {{ .driver_last_name }} vient d'accepter votre trajet vers {{.address}} le {{.date}}.{{ end }} +{{ define "sms_template" }}[{{ .name }}] {{ .driver_first_name }} {{ .driver_last_name }} vient d'accepter votre trajet vers {{.address}} le {{.date}}. Le conducteur vous contactera pour organiser le trajet.{{ end }} diff --git a/web/layouts/beneficiaries/_partials/beneficiary-wallet.html b/web/layouts/beneficiaries/_partials/beneficiary-wallet.html index 1ed85c8..af7718e 100644 --- a/web/layouts/beneficiaries/_partials/beneficiary-wallet.html +++ b/web/layouts/beneficiaries/_partials/beneficiary-wallet.html @@ -1,11 +1,11 @@ {{define "beneficiary_wallet"}} -
-
-

Solde : {{if .ViewState.beneficiary.Data.wallet}}{{ printf "%.2f" .ViewState.beneficiary.Data.wallet }}{{else}}0{{end}} €

- @@ -15,7 +15,7 @@
-
+
@@ -25,15 +25,33 @@
-
- +
+
+ + +
+ +
+ + +
+ +
+ + +
-
+ +
-
-
- +
@@ -42,5 +60,72 @@
+ + {{if .ViewState.beneficiary.Data.wallet_history}} +
+

Historique des opérations

+ + + + + + + + + + + + + + + + + + + + {{range $index, $operation := .ViewState.beneficiary.Data.wallet_history}} + + + + + + + + {{end}} + +
DateCréditDébitMoyen de paiementDescription
+ Solde initial + + {{if .ViewState.beneficiary.Data.wallet}}{{ printf "%.2f" .ViewState.beneficiary.Data.wallet }} €{{else}}0.00 €{{end}} + + - + + - + + - +
+ {{if $operation.timestamp}}{{timeFormat $operation.timestamp "02/01/2006 15:04"}}{{end}} + + {{if $operation.amount}} + {{if or (eq $operation.operation_type "credit") (not $operation.operation_type)}} + {{ printf "%.2f" $operation.amount }} € + {{end}} + {{end}} + + {{if eq $operation.operation_type "debit"}} + {{ printf "%.2f" $operation.amount }} € + {{end}} + + {{$operation.payment_method}} + + {{$operation.description}} +
+
+ {{else}} +
+

Aucune opération enregistrée

+
+ {{end}} +
{{end}} diff --git a/web/layouts/solidarity_transport/_partials/driver_wallet.html b/web/layouts/solidarity_transport/_partials/driver_wallet.html index 5b7251f..5f44dcf 100644 --- a/web/layouts/solidarity_transport/_partials/driver_wallet.html +++ b/web/layouts/solidarity_transport/_partials/driver_wallet.html @@ -1,10 +1,10 @@ {{define "driver_wallet"}} -
-
-

Solde : {{if .ViewState.driver.Data.wallet}}{{ printf "%.2f" .ViewState.driver.Data.wallet }}{{else}}0{{end}} €

+
+

Solde : {{ printf "%.2f" .ViewState.wallet_balance }} €

+ + {{if .ViewState.driver.Data.wallet_history}} +
+

Historique des opérations

+ + + + + + + + + + + + + + + + + + + + {{range $index, $operation := .ViewState.driver.Data.wallet_history}} + + + + + + + + {{end}} + +
DateCréditDébitMoyen de paiementDescription
+ Solde initial + + {{if .ViewState.driver.Data.wallet}}{{ printf "%.2f" .ViewState.driver.Data.wallet }} €{{else}}0.00 €{{end}} + + - + + - + + - +
+ {{if $operation.timestamp}}{{timeFormat $operation.timestamp "02/01/2006 15:04"}}{{end}} + + {{if $operation.amount}} + {{if or (eq $operation.operation_type "credit") (not $operation.operation_type)}} + {{ printf "%.2f" $operation.amount }} € + {{end}} + {{end}} + + {{if eq $operation.operation_type "debit"}} + {{ printf "%.2f" $operation.amount }} € + {{end}} + + {{$operation.payment_method}} + + {{$operation.description}} +
+
+ {{else}} +
+

Aucune opération enregistrée

+
+ {{end}} +
{{end}} \ No newline at end of file diff --git a/web/layouts/solidarity_transport/_partials/journey_preview.html b/web/layouts/solidarity_transport/_partials/journey_preview.html index 69d0833..fae5e3b 100644 --- a/web/layouts/solidarity_transport/_partials/journey_preview.html +++ b/web/layouts/solidarity_transport/_partials/journey_preview.html @@ -249,7 +249,7 @@ {{end}}
Compte mobilié (solde)
-
{{if .passenger.Data.wallet}}{{ printf "%.2f" .passenger.Data.wallet }}{{else}}0{{end}} EUR
+
{{ printf "%.2f" .passenger_wallet_balance }} EUR
diff --git a/web/layouts/solidarity_transport/booking_display.html b/web/layouts/solidarity_transport/booking_display.html index 5541154..cb64024 100644 --- a/web/layouts/solidarity_transport/booking_display.html +++ b/web/layouts/solidarity_transport/booking_display.html @@ -120,7 +120,7 @@
- {{template "journey_preview" (dict "driver_journey" .ViewState.booking.Journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries)}} + {{template "journey_preview" (dict "driver_journey" .ViewState.booking.Journey "driver" .ViewState.driver "passenger" .ViewState.passenger "beneficiaries" .ViewState.beneficiaries "passenger_wallet_balance" .ViewState.passenger_wallet_balance)}}
{{ end }} diff --git a/web/layouts/solidarity_transport/driver_create.html b/web/layouts/solidarity_transport/driver_create.html index 82c4288..0422c63 100644 --- a/web/layouts/solidarity_transport/driver_create.html +++ b/web/layouts/solidarity_transport/driver_create.html @@ -116,31 +116,46 @@
+ {{range .ViewState.profile_optional_fields}}
- + + {{if eq .type "select"}}
-
+ {{else if eq .type "textarea"}} + + {{else if eq .type "multicheckbox"}} +
+ {{$name := .name}} + {{range .options}} + + {{end}} +
+ {{else if eq .type "date"}} + + {{else if eq .type "number"}} + + {{else}} + + {{end}}
- -
- - -
-
- - -
+ {{end}}