Skip to content

Commit 3cf7dd7

Browse files
committed
feat: List countries without FIP acceptance
1 parent 0f52d9e commit 3cf7dd7

11 files changed

Lines changed: 147 additions & 14 deletions

File tree

assets/js/interactiveMap.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ window.initializeInteractiveMap = function() {
5959
window.location.href = `/${window.currentLanguage}/country/${country.id}/`;
6060
});
6161
}
62+
63+
if (window.unavailableCountries && window.unavailableCountries.includes(country.id)) {
64+
country.classList.add('o-interactive-map__country--unavailable');
65+
}
6266
});
6367
}
6468
};

assets/sass/interactiveMap.scss

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@
3939
}
4040
}
4141

42+
.o-interactive-map__country--unavailable {
43+
path,
44+
circle {
45+
fill: var(--bg-neutral) !important;
46+
transition: all 0.2s ease;
47+
cursor: not-allowed;
48+
}
49+
}
50+
4251
.o-interactive-map--loading {
4352
padding: 1rem;
4453
}
@@ -60,4 +69,37 @@
6069
background-color: var(--link-hovered);
6170
}
6271
}
72+
73+
&__legend {
74+
display: flex;
75+
column-gap: 2rem;
76+
row-gap: 1rem;
77+
flex-wrap: wrap;
78+
margin-top: 1.5rem;
79+
}
80+
81+
&__legend-item {
82+
display: flex;
83+
align-items: center;
84+
gap: 1rem;
85+
}
86+
87+
&__legend-color {
88+
width: 1.5rem;
89+
height: 1.5rem;
90+
border-radius: var(--border-radius-s);
91+
border: var(--border);
92+
93+
&--available {
94+
background-color: var(--link-default);
95+
}
96+
97+
&--unavailable {
98+
background-color: var(--bg-neutral);
99+
}
100+
101+
&--pending {
102+
background-color: #c0c1c5;
103+
}
104+
}
63105
}

assets/sass/styles.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ img {
125125
display: grid;
126126
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
127127
gap: 1rem;
128+
list-style-position: inside;
129+
padding-left: 1rem;
130+
131+
> li {
132+
margin-left: 1rem;
133+
}
128134
}
129135

130136
.o-list__link {
@@ -143,6 +149,12 @@ img {
143149
}
144150
}
145151

152+
.o-list__countries-overview {
153+
display: flex;
154+
gap: 2rem;
155+
flex-direction: column;
156+
}
157+
146158
@mixin add-columns($columns) {
147159
&--columns-#{$columns} {
148160
columns: $columns;

content/country/_index.de.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: "Übersicht der Länder"
33
description: "Übersicht über die Länder, in denen FIP-Vergünstigungen genutzt werden können."
4+
params:
5+
countriesWithoutFip:
6+
- Estland
7+
- Island
8+
- Malta
9+
- Russland
10+
- Schweden
11+
- Türkei
412
---
513

614
Finde auf den nachfolgenden Seiten die FIP-Regelungen für Dein Reiseziel.

content/country/_index.en.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: "Overview of countries"
33
description: "Overview of the countries where FIP benefits are available."
4+
params:
5+
countriesWithoutFip:
6+
- Estonia
7+
- Iceland
8+
- Malta
9+
- Russia
10+
- Sweden
11+
- Turkey
412
---
513

614
Find the FIP regulations for your destination on the following pages.

content/country/_index.fr.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
title: "Liste des pays"
33
description: "Liste des pays où les facilités FIP sont acceptées."
4+
params:
5+
countriesWithoutFip:
6+
- Estonie
7+
- Islande
8+
- Malte
9+
- Russie
10+
- Suède
11+
- Turquie
412
---
513

614
Retrouvez les règles FIP pour votre destination sur les pages suivantes.

i18n/de.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ booking:
1717
countries:
1818
overview: Alle Länder
1919
selection: Länderauswahl
20+
without-fip: Länder ohne FIP Akzeptanz
2021
country:
2122
many: Länder
2223
one: Land
@@ -35,6 +36,10 @@ information-disclaimer-short: >-
3536
Diese Informationen sind inoffiziell und ohne Gewähr. Es besteht keine
3637
rechtliche Verbindung zu FIP oder Bahngesellschaften.
3738
interactiveMap:
39+
legend:
40+
available: FIP Guide verfügbar
41+
pending: Inhalt noch nicht verfügbar
42+
unavailable: Keine FIP-Akzeptanz
3843
loading: Lade interaktive Karte...
3944
resetZoom: Zoom zurücksetzen
4045
title: Interaktive Länderkarte

i18n/en.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ booking:
1616
countries:
1717
overview: All Countries
1818
selection: choose country
19+
without-fip: Countries without FIP acceptance
1920
country:
2021
many: countries
2122
one: country
@@ -34,6 +35,10 @@ information-disclaimer-short: >-
3435
The information provided is unofficial and without guarantee. There is no
3536
legal connection to FIP or railway companies.
3637
interactiveMap:
38+
legend:
39+
available: FIP Guide available
40+
pending: Content not available yet
41+
unavailable: No FIP acceptance
3742
loading: Loading interactive map...
3843
resetZoom: Reset Zoom
3944
title: Interactive Country Map

i18n/fr.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@ booking:
1212
reservation-costs: Frais de réservation
1313
visit-additional-information-website: Informations complémentaires
1414
visit-booking-website: Aller sur le site de réservation
15+
countries:
16+
overview: Tous les pays
17+
selection: choisir un pays
18+
without-fip: Pays sans acceptation FIP
1519
country:
1620
many: pays
1721
one: pays
1822
other: pays
1923
countryselection: Choisir un pays
2024
editPage: Modifier la page
2125
footer-love:
22-
aria-label: Fait avec amour en Europe
23-
text: Fait avec ♥️ en Europe
26+
aria-label: Fait avec amour à Aix-la-Chapelle, Francfort, Cologne et Paris
27+
text: Fait avec ♥️ à Aix-la-Chapelle, Francfort, Cologne et Paris
28+
general: général
2429
highlight:
2530
important: Informations importantes
2631
inofficial: Informations non officielles
@@ -30,6 +35,10 @@ information-disclaimer-short: >-
3035
Les informations fournies sont non officielles et sans garantie. Il n'existe
3136
aucun lien juridique avec le FIP ou les compagnies ferroviaires.
3237
interactiveMap:
38+
legend:
39+
available: FIP Guide disponible
40+
pending: Contenu non disponible
41+
unavailable: Pas d'acceptation FIP
3342
loading: Chargement de la carte interactive...
3443
resetZoom: Réinitialiser le zoom
3544
title: Carte interactive des pays

layouts/country/list.html

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,29 @@
33
<h1 data-pagefind-meta="title">{{ .Title }}</h1>
44
{{ .Content }}
55
<div class="o-list__countries">
6-
<div>
7-
<h2>{{ T "countries.overview" }}</h2>
8-
<div class="o-list__list">
9-
{{ range .Pages }}
10-
<a href="{{ .RelPermalink }}" class="o-list__link">
6+
<div class="o-list__countries-overview">
7+
<div>
8+
<h2>{{ T "countries.overview" }}</h2>
9+
<div class="o-list__list">
10+
{{ range .Pages }}
11+
<a href="{{ .RelPermalink }}" class="o-list__link">
1112
<div class="o-list__picture">
1213
{{ partial "flag" (dict "country" .File.ContentBaseName) }}
1314
</div>
1415
<div>
1516
{{ .Title }}
1617
</div>
17-
</a>
18-
{{ end }}
18+
</a>
19+
{{ end }}
20+
</div>
21+
</div>
22+
<div>
23+
<h3>{{ T "countries.without-fip" }}</h3>
24+
<ul class="o-list__list">
25+
{{ range .Params.countriesWithoutFip }}
26+
<li>{{ . }}</li>
27+
{{ end }}
28+
</ul>
1929
</div>
2030
</div>
2131
<div class="o-interactive-map">
@@ -36,18 +46,40 @@ <h2>{{ T "interactiveMap.title" }}</h2>
3646
</button>
3747
</div>
3848
</div>
49+
<div class="o-interactive-map__legend">
50+
{{ range (slice "available" "unavailable" "pending") }}
51+
<div class="o-interactive-map__legend-item">
52+
<div class="o-interactive-map__legend-color o-interactive-map__legend-color--{{ . }}"></div>
53+
<span>{{ T (printf "interactiveMap.legend.%s" .) }}</span>
54+
</div>
55+
{{ end }}
56+
</div>
3957
</div>
4058
</div>
4159
</article>
4260

43-
4461
<script>
4562
window.availableCountries = [
4663
{{- range .Pages -}}
4764
"{{ .File.ContentBaseName }}"{{ if not (eq . (index (last 1 $.Pages) 0)) }},{{ end }}
4865
{{- end -}}
4966
];
5067

68+
window.unavailableCountries = [
69+
"sweden",
70+
"malta",
71+
"russia",
72+
"turkey",
73+
"iceland",
74+
"greenland",
75+
"estonia",
76+
"ukraine",
77+
"vatican",
78+
"algeria",
79+
"tunisia",
80+
"morocco"
81+
];
82+
5183
window.currentLanguage = "{{ .Language.Lang }}";
5284

5385
fetch('/map_europe.svg')

0 commit comments

Comments
 (0)