From 68091016536b135356ea81b85ecfe9769a93430a Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Sat, 29 Nov 2025 23:27:57 +0100 Subject: [PATCH 1/2] feat: Use different icons for booking expander meta --- assets/sass/_variables.scss | 4 ++++ assets/sass/booking.scss | 16 ++++++++++++-- layouts/partials/booking.html | 39 ++++++++++++++++++++--------------- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/assets/sass/_variables.scss b/assets/sass/_variables.scss index 5a55b60b..536a9f73 100644 --- a/assets/sass/_variables.scss +++ b/assets/sass/_variables.scss @@ -27,6 +27,8 @@ html { --color-onLight: #{$color-onLight}; --color-table-border: #{$color-table-border}; --color-body: rgb(33, 37, 41); + --color-success: #0a8754; + --color-error: #c41e3a; --border-radius-s: 0.4rem; --border-radius-m: 0.8rem; --border-radius-l: 1.6rem; @@ -57,6 +59,8 @@ html[data-theme="dark"] { --color-onLight: #ffffff; --color-table-border: #555; --color-body: #e0e0e0; + --color-success: #2ea44f; + --color-error: #f85149; --pagefind-ui-border: #555; --box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.5); --box-shadow-light: 0.4rem 0.4rem 0.4rem rgba(0, 0, 0, 0.3); diff --git a/assets/sass/booking.scss b/assets/sass/booking.scss index 678d7dc9..2b8edca7 100644 --- a/assets/sass/booking.scss +++ b/assets/sass/booking.scss @@ -68,10 +68,8 @@ } .o-booking__meta { - text-align: center; display: flex; flex-direction: column; - align-items: center; justify-content: center; @media (max-width: #{$breakpoint-md}) { @@ -81,6 +79,20 @@ display: none; } } + + &-item { + display: flex; + align-items: center; + gap: 0.4rem; + + &--success { + color: var(--color-success); + } + + &--error { + color: var(--color-error); + } + } } .o-booking__links { diff --git a/layouts/partials/booking.html b/layouts/partials/booking.html index b92f0757..1bc7cbc9 100644 --- a/layouts/partials/booking.html +++ b/layouts/partials/booking.html @@ -14,23 +14,28 @@ {{- end }}
- {{- if ne .reservations "nil" -}} -
- {{- T "booking.reservation" }} - {{ if .reservations -}}✅{{- else -}}⛔{{- end -}} -
- {{- end -}} - {{- if ne .fip_50 "nil" -}} -
- {{- T "booking.fip-50" }} - {{ if .fip_50 -}}✅{{- else -}}⛔{{- end -}} -
- {{- end -}} - {{- if ne .fip_global_fare "nil" -}} -
- {{- T "booking.fip-global-fare" }} - {{ if .fip_global_fare -}}✅{{- else -}}⛔{{- end -}} -
+ {{- $metaFields := slice + (dict "key" "reservations" "value" .reservations "label" "booking.reservation") + (dict "key" "fip_50" "value" .fip_50 "label" "booking.fip-50") + (dict "key" "fip_global_fare" "value" .fip_global_fare "label" "booking.fip-global-fare") + -}} + {{- range $metaFields -}} + {{- if ne .value "nil" -}} +
+ {{- if .value -}} + {{- partial "icon" "check_circle" -}} + {{- else -}} + {{- partial "icon" "cancel" -}} + {{- end -}} + {{- T .label -}} +
+ {{- end -}} {{- end -}}
From 6c91705897d5eecc9183df8f6d8a261c4d52b2d9 Mon Sep 17 00:00:00 2001 From: MoritzWeber0 Date: Mon, 8 Dec 2025 20:33:51 +0100 Subject: [PATCH 2/2] feat: Improve screen reader support --- i18n/de.yaml | 2 ++ i18n/en.yaml | 2 ++ i18n/fr.yaml | 2 ++ layouts/partials/booking.html | 27 +++++++++++++++------------ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/i18n/de.yaml b/i18n/de.yaml index 084ce82a..fbc0e4f9 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -4,12 +4,14 @@ anchorLink: copied: Link wurde in die Zwischenablage kopiert copy: Link zu diesem Abschnitt kopieren booking: + bookable: buchbar classes: first: 1. Klasse second: 2. Klasse fee: Buchungsgebühr fip-50: FIP 50 Fahrkarten fip-global-fare: FIP Globalpreis + not-bookable: nicht buchbar reservation: Reservierung reservation-costs: Reservierungskosten visit-additional-information-website: Weitere Informationen diff --git a/i18n/en.yaml b/i18n/en.yaml index 46bfa1ab..158f802b 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -3,12 +3,14 @@ anchorLink: copied: Link has been copied to the clipboard copy: Copy link to this section booking: + bookable: bookable classes: first: 1st Class second: 2nd Class fee: Booking Fee fip-50: FIP 50 Tickets fip-global-fare: FIP Global Fare + not-bookable: not bookable reservation: Reservation reservation-costs: Reservation Costs visit-additional-information-website: Additional Information diff --git a/i18n/fr.yaml b/i18n/fr.yaml index fba8e28a..dbefc3af 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -3,12 +3,14 @@ anchorLink: copied: Le lien a été copié dans le presse-papiers copy: Copier le lien vers cette section booking: + bookable: réservable classes: first: 1re classe second: 2nd classe fee: Frais de réservation fip-50: Billets FIP 50 fip-global-fare: Tarif Global FIP + not-bookable: non réservable reservation: Réservation reservation-costs: Frais de réservation visit-additional-information-website: Informations complémentaires diff --git a/layouts/partials/booking.html b/layouts/partials/booking.html index 1bc7cbc9..8876aba4 100644 --- a/layouts/partials/booking.html +++ b/layouts/partials/booking.html @@ -21,20 +21,23 @@ -}} {{- range $metaFields -}} {{- if ne .value "nil" -}} -
- {{- if .value -}} + {{- if .value -}} +
{{- partial "icon" "check_circle" -}} - {{- else -}} + +
+ {{- else -}} +
{{- partial "icon" "cancel" -}} - {{- end -}} - {{- T .label -}} -
+ +
+ {{- end -}} {{- end -}} {{- end -}}