From 01de2588ef866eff131cbeab5da6c2b8633a5d6e Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Tue, 9 Sep 2025 22:10:09 +0200 Subject: [PATCH 1/4] feat: List countries without FIP acceptance --- assets/js/interactiveMap.js | 4 +++ assets/sass/interactiveMap.scss | 42 +++++++++++++++++++++++++++++ assets/sass/styles.scss | 12 +++++++++ content/country/_index.de.md | 8 ++++++ content/country/_index.en.md | 8 ++++++ content/country/_index.fr.md | 8 ++++++ i18n/de.yaml | 5 ++++ i18n/en.yaml | 5 ++++ i18n/fr.yaml | 8 ++++++ layouts/country/list.html | 48 +++++++++++++++++++++++++++------ static/map_europe.svg | 8 +++--- 11 files changed, 144 insertions(+), 12 deletions(-) diff --git a/assets/js/interactiveMap.js b/assets/js/interactiveMap.js index aaf38951..7db7f4b9 100644 --- a/assets/js/interactiveMap.js +++ b/assets/js/interactiveMap.js @@ -59,6 +59,10 @@ window.initializeInteractiveMap = function() { window.location.href = `/${window.currentLanguage}/country/${country.id}/`; }); } + + if (window.unavailableCountries && window.unavailableCountries.includes(country.id)) { + country.classList.add('o-interactive-map__country--unavailable'); + } }); } }; diff --git a/assets/sass/interactiveMap.scss b/assets/sass/interactiveMap.scss index 25c1c0cc..e092f631 100644 --- a/assets/sass/interactiveMap.scss +++ b/assets/sass/interactiveMap.scss @@ -39,6 +39,15 @@ } } + .o-interactive-map__country--unavailable { + path, + circle { + fill: var(--bg-neutral) !important; + transition: all 0.2s ease; + cursor: not-allowed; + } + } + .o-interactive-map--loading { padding: 1rem; } @@ -60,4 +69,37 @@ background-color: var(--link-hovered); } } + + &__legend { + display: flex; + column-gap: 2rem; + row-gap: 1rem; + flex-wrap: wrap; + margin-top: 1.5rem; + } + + &__legend-item { + display: flex; + align-items: center; + gap: 1rem; + } + + &__legend-color { + width: 1.5rem; + height: 1.5rem; + border-radius: var(--border-radius-s); + border: var(--border); + + &--available { + background-color: var(--link-default); + } + + &--unavailable { + background-color: var(--bg-neutral); + } + + &--pending { + background-color: #c0c1c5; + } + } } diff --git a/assets/sass/styles.scss b/assets/sass/styles.scss index df272ff6..a6a5b07f 100644 --- a/assets/sass/styles.scss +++ b/assets/sass/styles.scss @@ -125,6 +125,12 @@ img { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; + list-style-position: inside; + padding-left: 1rem; + + > li { + margin-left: 1rem; + } } .o-list__link { @@ -143,6 +149,12 @@ img { } } +.o-list__countries-overview { + display: flex; + gap: 2rem; + flex-direction: column; +} + @mixin add-columns($columns) { &--columns-#{$columns} { columns: $columns; diff --git a/content/country/_index.de.md b/content/country/_index.de.md index 27276786..2335d0e2 100644 --- a/content/country/_index.de.md +++ b/content/country/_index.de.md @@ -1,6 +1,14 @@ --- title: "Übersicht der Länder" description: "Übersicht über die Länder, in denen FIP-Vergünstigungen genutzt werden können." +params: + countriesWithoutFip: + - Estland + - Island + - Malta + - Russland + - Schweden + - Türkei --- Finde auf den nachfolgenden Seiten die FIP-Regelungen für Dein Reiseziel. diff --git a/content/country/_index.en.md b/content/country/_index.en.md index 670d0215..61d4cc0a 100644 --- a/content/country/_index.en.md +++ b/content/country/_index.en.md @@ -1,6 +1,14 @@ --- title: "Overview of countries" description: "Overview of the countries where FIP benefits are available." +params: + countriesWithoutFip: + - Estonia + - Iceland + - Malta + - Russia + - Sweden + - Turkey --- Find the FIP regulations for your destination on the following pages. diff --git a/content/country/_index.fr.md b/content/country/_index.fr.md index d502cd59..70e36c24 100644 --- a/content/country/_index.fr.md +++ b/content/country/_index.fr.md @@ -1,6 +1,14 @@ --- title: "Liste des pays" description: "Liste des pays où les facilités FIP sont acceptées." +params: + countriesWithoutFip: + - Estonie + - Islande + - Malte + - Russie + - Suède + - Turquie --- Retrouvez les règles FIP pour votre destination sur les pages suivantes. diff --git a/i18n/de.yaml b/i18n/de.yaml index 62409a2c..a17d725e 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -17,6 +17,7 @@ booking: countries: overview: Alle Länder selection: Länderauswahl + without-fip: Länder ohne FIP Akzeptanz country: many: Länder one: Land @@ -35,6 +36,10 @@ information-disclaimer-short: >- Diese Informationen sind inoffiziell und ohne Gewähr. Es besteht keine rechtliche Verbindung zu FIP oder Bahngesellschaften. interactiveMap: + legend: + available: FIP Guide verfügbar + pending: Inhalt noch nicht verfügbar + unavailable: Keine FIP-Akzeptanz loading: Lade interaktive Karte... resetZoom: Zoom zurücksetzen title: Interaktive Länderkarte diff --git a/i18n/en.yaml b/i18n/en.yaml index 513a2609..7798ab2b 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -16,6 +16,7 @@ booking: countries: overview: All Countries selection: choose country + without-fip: Countries without FIP acceptance country: many: countries one: country @@ -34,6 +35,10 @@ information-disclaimer-short: >- The information provided is unofficial and without guarantee. There is no legal connection to FIP or railway companies. interactiveMap: + legend: + available: FIP Guide available + pending: Content not available yet + unavailable: No FIP acceptance loading: Loading interactive map... resetZoom: Reset Zoom title: Interactive Country Map diff --git a/i18n/fr.yaml b/i18n/fr.yaml index c330e90f..0402aa11 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -12,6 +12,10 @@ booking: reservation-costs: Frais de réservation visit-additional-information-website: Informations complémentaires visit-booking-website: Aller sur le site de réservation +countries: + overview: Tous les pays + selection: choisir un pays + without-fip: Pays sans acceptation FIP country: many: pays one: pays @@ -30,6 +34,10 @@ information-disclaimer-short: >- Les informations fournies sont non officielles et sans garantie. Il n'existe aucun lien juridique avec le FIP ou les compagnies ferroviaires. interactiveMap: + legend: + available: FIP Guide disponible + pending: Contenu non disponible + unavailable: Pas d'acceptation FIP loading: Chargement de la carte interactive... resetZoom: Réinitialiser le zoom title: Carte interactive des pays diff --git a/layouts/country/list.html b/layouts/country/list.html index 08975751..a7e448cc 100644 --- a/layouts/country/list.html +++ b/layouts/country/list.html @@ -3,19 +3,29 @@

{{ .Title }}

{{ .Content }}
-
-

{{ T "countries.overview" }}

-
- {{ range .Pages }} - +
+ +
+

{{ T "countries.without-fip" }}

+
    + {{ range .Params.countriesWithoutFip }} +
  • {{ . }}
  • + {{ end }} +
@@ -36,11 +46,18 @@

{{ T "interactiveMap.title" }}

+
+ {{ range (slice "available" "unavailable" "pending") }} +
+
+ {{ T (printf "interactiveMap.legend.%s" .) }} +
+ {{ end }} +
-