From 4bb249ef2acd1fc88a11f26a9b18cc7c4f98ca23 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 23 May 2025 09:57:36 +0200 Subject: [PATCH] change sms --- config.yaml | 26 +++++ emails/auth/retrieve-password.html | 4 +- .../booking_driver_accept.html | 5 + .../booking_driver_decline.html | 5 + sms/solidarity_transport/driver_accept.tmpl | 1 + sms/solidarity_transport/request_driver.tmpl | 2 + web/layouts/_partials/submit_with_sms.html | 45 +++++++++ web/layouts/agenda/_partials/address.html | 6 +- web/layouts/beneficiaries/update.html | 9 +- .../journeys/_partials/journeys-all.html | 10 +- .../journeys-public-transit-motis.html | 43 ++++++++- .../_partials/journey_map.html | 89 ++++++++++++++++++ .../_partials/journey_preview.html | 87 +---------------- .../solidarity_transport/driver_journey.html | 18 +++- .../ext/booking_proposal.html | 94 +++++++++++++++++++ web/public/css/main.css | 72 +++++++++----- 16 files changed, 388 insertions(+), 128 deletions(-) create mode 100644 emails/solidarity_transport/booking_driver_accept.html create mode 100644 emails/solidarity_transport/booking_driver_decline.html create mode 100644 sms/solidarity_transport/driver_accept.tmpl create mode 100644 sms/solidarity_transport/request_driver.tmpl create mode 100644 web/layouts/_partials/submit_with_sms.html create mode 100644 web/layouts/solidarity_transport/_partials/journey_map.html create mode 100644 web/layouts/solidarity_transport/ext/booking_proposal.html diff --git a/config.yaml b/config.yaml index a57b203..f8f97cf 100644 --- a/config.yaml +++ b/config.yaml @@ -269,13 +269,26 @@ views: - web/layouts/solidarity_transport/driver_display.html driver_journey: files: + - web/layouts/solidarity_transport/_partials/journey_map.html + - sms/solidarity_transport/request_driver.tmpl + - web/layouts/_partials/submit_with_sms.html - web/layouts/solidarity_transport/_partials/journey_preview.html - web/layouts/solidarity_transport/driver_journey.html booking_display: files: + - web/layouts/solidarity_transport/_partials/journey_map.html - web/layouts/solidarity_transport/_partials/journey_preview.html - web/layouts/solidarity_transport/booking_display.html + ext: + booking_proposal: + files: + - sms/solidarity_transport/driver_accept.tmpl + - web/layouts/_partials/submit_with_sms.html + - web/layouts/solidarity_transport/_partials/journey_map.html + - web/layouts/solidarity_transport/_partials/journey_preview.html + - web/layouts/solidarity_transport/ext/booking_proposal.html + organized_carpool: overview: files: @@ -367,6 +380,7 @@ icons: hero:outline/information-circle: hero:outline/map: hero:outline/office-building: + hero:outline/paper-airplane: hero:outline/paper-clip: hero:outline/plus-circle: hero:outline/shield-check: @@ -381,6 +395,7 @@ icons: tabler-icons:car: tabler-icons:walk: tabler-icons:bus: + tabler-icons:train: emails: onboarding: @@ -429,6 +444,17 @@ emails: files: - emails/layout.html - emails/onboarding/delete-subscriber.html + solidarity_transport: + boking_driver_accept: + subject: Trajet accepté par un conducteur + files: + - emails/layout.html + - emails/solidarity_transport/booking_driver_accept.html + boking_driver_decline: + subject: Trajet accepté par un conducteur + files: + - emails/layout.html + - emails/solidarity_transport/booking_driver_accept.html sms: solidarity_transport: diff --git a/emails/auth/retrieve-password.html b/emails/auth/retrieve-password.html index 0bc2260..d42571a 100644 --- a/emails/auth/retrieve-password.html +++ b/emails/auth/retrieve-password.html @@ -1,5 +1,5 @@ {{define "content"}}

Bonjour,

Vous avez demandé à réinitialiser votre mot de passe pour {{.username}}

-

Pour créer votre nouveau mot de passe, cliquez sur le lien suivant : http://localhost:9000/auth/lost-password/recover?key={{.key}}

-{{end}} \ No newline at end of file +

Pour créer votre nouveau mot de passe, cliquez sur le lien suivant : {{ .baseUrl }}/auth/lost-password/recover?key={{.key}}

+{{end}} diff --git a/emails/solidarity_transport/booking_driver_accept.html b/emails/solidarity_transport/booking_driver_accept.html new file mode 100644 index 0000000..b07a0e7 --- /dev/null +++ b/emails/solidarity_transport/booking_driver_accept.html @@ -0,0 +1,5 @@ +{{define "content"}} +

Bonjour,

+

Trajet accepté par un conducteur.

+

Voir le trajet : {{ .baseUrl }}/solidarity-transport/bookings/{{.bookingid}}

+{{end}} diff --git a/emails/solidarity_transport/booking_driver_decline.html b/emails/solidarity_transport/booking_driver_decline.html new file mode 100644 index 0000000..ac762b4 --- /dev/null +++ b/emails/solidarity_transport/booking_driver_decline.html @@ -0,0 +1,5 @@ +{{define "content"}} +

Bonjour,

+

Trajet refusé par un conducteur.

+

Voir le trajet : {{ .baseUrl }}/solidarity-transport/bookings/{{.bookingid}}

+{{end}} diff --git a/sms/solidarity_transport/driver_accept.tmpl b/sms/solidarity_transport/driver_accept.tmpl new file mode 100644 index 0000000..2c62e2d --- /dev/null +++ b/sms/solidarity_transport/driver_accept.tmpl @@ -0,0 +1 @@ +{{ define "sms_template" }}[{{ .name }}] Un conducteur solidaire vient d'accepter votre trajet vers {{.address}} le {{.date}}. Son numéro : {{.phone_number}}.{{ end }} diff --git a/sms/solidarity_transport/request_driver.tmpl b/sms/solidarity_transport/request_driver.tmpl new file mode 100644 index 0000000..543cb4a --- /dev/null +++ b/sms/solidarity_transport/request_driver.tmpl @@ -0,0 +1,2 @@ +{{ define "sms_template" }}[{{ .name }}] Nouvelle demande de trajet solidaire{{ .datetime }}. +Acceptez ou refusez sur {{ .baseUrl }}/ext/st/bp/{booking_id}{{ end }} diff --git a/web/layouts/_partials/submit_with_sms.html b/web/layouts/_partials/submit_with_sms.html new file mode 100644 index 0000000..cd90e12 --- /dev/null +++ b/web/layouts/_partials/submit_with_sms.html @@ -0,0 +1,45 @@ +{{ define "submit_with_sms" }} +{{ $dialog := (or .ComponentState.dialogVar "dialog") }} +{{ $fieldName := (or .ComponentState.fieldName "message") }} +{{ $submitText := (or .ComponentState.submitText "Valider") }} +{{ $headerText := (or .ComponentState.headerText "Envoyer un message") }} +{{ $cancelText := (or .ComponentState.cancelText "Annuler" )}} +{{ $validateText := (or .ComponentState.validateText "Envoyer" )}} +{{ $infoText := (or .ComponentState.infoText "Le message suivant sera envoyé. Vous pouvez le personnaliser." )}} +
+ + +{{ end }} diff --git a/web/layouts/agenda/_partials/address.html b/web/layouts/agenda/_partials/address.html index 06fc040..0952b2d 100644 --- a/web/layouts/agenda/_partials/address.html +++ b/web/layouts/agenda/_partials/address.html @@ -22,7 +22,7 @@ this.responselength = 0 this.address = this.def this.input = `{{ .Default.properties.label}}` - result = await fetch('https://geocode.ridygo.fr/v1/autocomplete/\?text=' + this.input) + result = await fetch('https://api-adresse.data.gouv.fr/search/?q=' + this.input) json = await result.json() bb = json['features'][0] @@ -33,7 +33,7 @@ return [bb] } - result = await fetch('https://geocode.ridygo.fr/v1/autocomplete/\?text=' + this.input) + result = await fetch('https://api-adresse.data.gouv.fr/search/?q=' + this.input) json = await result.json() this.responselength = json['features'].length @@ -64,4 +64,4 @@
-{{ end }} \ No newline at end of file +{{ end }} diff --git a/web/layouts/beneficiaries/update.html b/web/layouts/beneficiaries/update.html index afd5302..a011eb9 100644 --- a/web/layouts/beneficiaries/update.html +++ b/web/layouts/beneficiaries/update.html @@ -15,6 +15,13 @@ file_number: '{{ .ViewState.Data.file_number }}', gender: {{.ViewState.Data.gender}} }, + other_properties: { + situation: '{{.ViewState.Data.other_properties.situation}}', + subscription_reason: '{{.ViewState.Data.other_properties.subscription_reason}}', + status: '{{.ViewState.Data.other_properties.status}}', + comment: '{{.ViewState.Data.other_properties.comment}}' + }, + other_properties_serialized: null, rules: { first_name: ['required'], last_name: ['required'], @@ -151,7 +158,7 @@
- + {{template "submit_with_sms" + dict "IconSet" .IconSet + "Viewstate" .ViewState + "ComponentState" (dict "submitText" "Valider" + "headerText" "Validez le trajet" + "infoText" "Le message suivant sera envoyé à votre passager. Vous pouvez le personnaliser.") + "SMSState" (dict "name" (.ViewState.config.GetString "service_name") + "address" .ViewState.booking.Journey.PassengerDrop.Properties.label + "date" (.ViewState.booking.Journey.PassengerPickupDate.Format "02/01/2006 15:04") + "phone_number" .ViewState.driver.Data.phone_number)}} + +
+ + +
+ {{end}} +
+
+ + +{{end}} diff --git a/web/public/css/main.css b/web/public/css/main.css index 21ab23e..5835d80 100644 --- a/web/public/css/main.css +++ b/web/public/css/main.css @@ -1,11 +1,11 @@ -/*! tailwindcss v4.0.9 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v4.0.8 | MIT License | https://tailwindcss.com */ @layer theme, base, components, utilities; @layer theme { :root, :host { - --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", - "Courier New", monospace; + --font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', + 'Noto Color Emoji'; + --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', + monospace; --color-red-500: oklch(0.637 0.237 25.331); --color-green-100: oklch(0.962 0.044 156.743); --color-green-800: oklch(0.448 0.119 151.328); @@ -55,7 +55,6 @@ --font-weight-extrabold: 800; --tracking-tight: -0.025em; --tracking-wide: 0.025em; - --radius-sm: 0.25rem; --radius-md: 0.375rem; --radius-lg: 0.5rem; --radius-xl: 0.75rem; @@ -68,16 +67,10 @@ --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); --default-font-family: var(--font-sans); --default-font-feature-settings: var(--font-sans--font-feature-settings); - --default-font-variation-settings: var( - --font-sans--font-variation-settings - ); + --default-font-variation-settings: var(--font-sans--font-variation-settings); --default-mono-font-family: var(--font-mono); - --default-mono-font-feature-settings: var( - --font-mono--font-feature-settings - ); - --default-mono-font-variation-settings: var( - --font-mono--font-variation-settings - ); + --default-mono-font-feature-settings: var(--font-mono--font-feature-settings); + --default-mono-font-variation-settings: var(--font-mono--font-variation-settings); --color-co-blue: #243887; --color-co-red: #ff1300; --color-co-green: #6cc11f; @@ -96,9 +89,9 @@ line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; - font-family: var( --default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" ); + font-family: var( --default-font-family, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji' ); font-feature-settings: var(--default-font-feature-settings, normal); - font-variation-settings: var( --default-font-variation-settings, normal ); + font-variation-settings: var(--default-font-variation-settings, normal); -webkit-tap-highlight-color: transparent; } body { @@ -126,9 +119,9 @@ font-weight: bolder; } code, kbd, samp, pre { - font-family: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace ); - font-feature-settings: var( --default-mono-font-feature-settings, normal ); - font-variation-settings: var( --default-mono-font-variation-settings, normal ); + font-family: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace ); + font-feature-settings: var(--default-mono-font-feature-settings, normal); + font-variation-settings: var(--default-mono-font-variation-settings, normal); font-size: 1em; } small { @@ -216,13 +209,13 @@ :-moz-ui-invalid { box-shadow: none; } - button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button { + button, input:where([type='button'], [type='reset'], [type='submit']), ::file-selector-button { appearance: button; } ::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; } - [hidden]:where(:not([hidden="until-found"])) { + [hidden]:where(:not([hidden='until-found'])) { display: none !important; } } @@ -461,6 +454,9 @@ .mx-auto { margin-inline: auto; } + .-my-1 { + margin-block: calc(var(--spacing) * -1); + } .-my-1\.5 { margin-block: calc(var(--spacing) * -1.5); } @@ -509,6 +505,9 @@ .mt-10 { margin-top: calc(var(--spacing) * 10); } + .-mr-1 { + margin-right: calc(var(--spacing) * -1); + } .-mr-1\.5 { margin-right: calc(var(--spacing) * -1.5); } @@ -686,6 +685,9 @@ .h-16 { height: calc(var(--spacing) * 16); } + .h-50 { + height: calc(var(--spacing) * 50); + } .h-full { height: 100%; } @@ -701,15 +703,27 @@ .max-h-screen { max-height: 100vh; } + .min-h-10 { + min-height: calc(var(--spacing) * 10); + } + .min-h-50 { + min-height: calc(var(--spacing) * 50); + } .min-h-full { min-height: 100%; } .min-h-screen { min-height: 100vh; } + .w-0 { + width: calc(var(--spacing) * 0); + } .w-0\.5 { width: calc(var(--spacing) * 0.5); } + .w-1 { + width: calc(var(--spacing) * 1); + } .w-1\/2 { width: calc(1/2 * 100%); } @@ -746,6 +760,9 @@ .w-48 { width: calc(var(--spacing) * 48); } + .w-50 { + width: calc(var(--spacing) * 50); + } .w-100 { width: calc(var(--spacing) * 100); } @@ -1452,9 +1469,6 @@ .rounded-md { border-radius: var(--radius-md); } - .rounded-sm { - border-radius: var(--radius-sm); - } .rounded-xl { border-radius: var(--radius-xl); } @@ -1947,6 +1961,9 @@ .py-12 { padding-block: calc(var(--spacing) * 12); } + .pt-1 { + padding-top: calc(var(--spacing) * 1); + } .pt-1\.5 { padding-top: calc(var(--spacing) * 1.5); } @@ -3153,6 +3170,11 @@ grid-template-columns: repeat(3, minmax(0, 1fr)); } } + .sm\:flex-row { + @media (width >= 40rem) { + flex-direction: row; + } + } .sm\:flex-row-reverse { @media (width >= 40rem) { flex-direction: row-reverse;