Skip to content

Commit fdf63ca

Browse files
committed
feat: Add buttons for route overview and additional info
1 parent e387a13 commit fdf63ca

File tree

6 files changed

+97
-77
lines changed

6 files changed

+97
-77
lines changed

content/operator/sncf/index.en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ Reservations are mandatory on all `TGV`, almost all `IC` trains, and some region
4343
reservation_required=true
4444
risk_of_confusion=true
4545
important_info=true
46+
route_overview_url="https://www.sncf-connect.com/assets/media/2021-05/2014_axes-tgv_0.pdf"
4647
type="highspeed"
4748
%}}
48-
The `TGV` inOui is SNCF's high-speed train, connecting many cities in France and international destinations (e.g. Munich, Frankfurt am Main, Barcelona, Luxembourg, Brussels, Zurich, Milan). [Route overview](https://www.sncf-connect.com/assets/media/2021-05/2014_axes-tgv_0.pdf). Each seat number exists twice in the carriage; the reserved seat is the one with the illuminated number.
49+
The `TGV` inOui is SNCF's high-speed train, connecting many cities in France and international destinations (e.g. Munich, Frankfurt am Main, Barcelona, Luxembourg, Brussels, Zurich, Milan). Each seat number exists twice in the carriage; the reserved seat is the one with the illuminated number.
4950

5051
{{% highlight confusion %}}
5152
SNCF also operates low-cost `TGV` trains under the name OuiGo, which are not valid with FIP.

i18n/de.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,15 @@ trainCategory:
107107
accepted: FIP akzeptiert
108108
notAccepted: FIP nicht akzeptiert
109109
partiallyAccepted: FIP teilweise akzeptiert
110+
additionalInformation: Zusätzliche Informationen
110111
importantInformation: Wichtige Informationen
111112
reservation:
112113
notPossible: Keine Reservierung möglich
113114
partiallyRequired: Reservierung teilweise erforderlich
114115
possible: Reservierung möglich
115116
required: Reservierung erforderlich
116117
riskOfConfusion: Verwechslungsgefahr
118+
routeOverview: Streckenübersicht
117119
updateDate:
118120
aria-label: Öffne die Commit-Verlauf der Seite
119121
label: Zuletzt aktualisiert

i18n/en.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ trainCategory:
103103
accepted: FIP accepted
104104
notAccepted: FIP not accepted
105105
partiallyAccepted: FIP partially accepted
106+
additionalInformation: Additional information
106107
importantInformation: Important information
107108
reservation:
108109
notPossible: No reservation possible
109110
partiallyRequired: Reservation partially required
110111
possible: Reservation possible
111112
required: Reservation required
112113
riskOfConfusion: Risk of confusion
114+
routeOverview: Route overview
113115
updateDate:
114116
aria-label: Open the commit history of the page
115117
label: Last updated

i18n/fr.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ trainCategory:
103103
accepted: FIP accepté
104104
notAccepted: FIP non accepté
105105
partiallyAccepted: FIP partiellement accepté
106+
additionalInformation: Informations complémentaires
106107
importantInformation: Informations importantes
107108
reservation:
108109
notPossible: Aucune réservation possible
109110
partiallyRequired: Réservation partiellement requise
110111
possible: Réservation possible
111112
required: Réservation requise
112113
riskOfConfusion: Risque de confusion
114+
routeOverview: Aperçu de l'itinéraire
113115
updateDate:
114116
aria-label: Ouvrir l'historique des commits de la page
115117
label: Dernière mise à jour
Lines changed: 86 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,91 @@
1-
<summary class="o-expander__summary o-expander__summary--train-category">
2-
<div class="o-train-category__header">
3-
<div class="o-train-category__title">
4-
{{ $iconMapping := dict
5-
"highspeed" "train"
6-
"regional" "directions_subway"
7-
"funicular" "funicular"
8-
"bus" "directions_bus"
9-
}}
10-
{{- partial "icon" (index $iconMapping .type) -}}
11-
<span class="o-train-category__title-text">{{- .title -}}</span>
12-
</div>
13-
<div class="o-train-category__tags">
14-
{{- if eq .fip_accepted true -}}
15-
<span class="o-train-category__tag o-train-category__tag--success">
16-
{{ partial "icon" "check_circle" }}
17-
{{ i18n "trainCategory.acceptance.accepted" }}
18-
</span>
19-
{{- else if eq .fip_accepted "partially" -}}
20-
<span class="o-train-category__tag o-train-category__tag--warning">
21-
{{ partial "icon" "info" }}
22-
{{ i18n "trainCategory.acceptance.partiallyAccepted" }}
23-
</span>
24-
{{- else -}}
25-
<span class="o-train-category__tag o-train-category__tag--error">
26-
{{ partial "icon" "dangerous" }}
27-
{{ i18n "trainCategory.acceptance.notAccepted" }}
28-
</span>
29-
{{- end -}}
1+
<details class="o-expander o-expander--booking">
2+
<summary class="o-expander__summary o-expander__summary--train-category">
3+
<div class="o-train-category__header">
4+
<div class="o-train-category__title">
5+
{{ $iconMapping := dict
6+
"highspeed" "train"
7+
"regional" "directions_subway"
8+
"funicular" "funicular"
9+
"bus" "directions_bus"
10+
}}
11+
{{- partial "icon" (index $iconMapping .type) -}}
12+
<span class="o-train-category__title-text">{{- .title -}}</span>
13+
</div>
14+
<div class="o-train-category__tags">
15+
{{- if eq .fip_accepted true -}}
16+
<span class="o-train-category__tag o-train-category__tag--success">
17+
{{ partial "icon" "check_circle" }}
18+
{{ i18n "trainCategory.acceptance.accepted" }}
19+
</span>
20+
{{- else if eq .fip_accepted "partially" -}}
21+
<span class="o-train-category__tag o-train-category__tag--warning">
22+
{{ partial "icon" "info" }}
23+
{{ i18n "trainCategory.acceptance.partiallyAccepted" }}
24+
</span>
25+
{{- else -}}
26+
<span class="o-train-category__tag o-train-category__tag--error">
27+
{{ partial "icon" "dangerous" }}
28+
{{ i18n "trainCategory.acceptance.notAccepted" }}
29+
</span>
30+
{{- end -}}
3031

31-
{{- if eq .reservation_required true -}}
32-
<span class="o-train-category__tag o-train-category__tag--error">
33-
{{ partial "icon" "calendar_add_on" }}
34-
{{ i18n "trainCategory.reservation.required" }}
35-
</span>
36-
{{- else if eq .reservation_required true -}}
37-
<span class="o-train-category__tag o-train-category__tag--warning">
38-
{{ partial "icon" "calendar_add_on" }}
39-
{{ i18n "trainCategory.reservation.partiallyRequired" }}
40-
</span>
41-
{{- else if eq .reservation_possible true -}}
42-
<span class="o-train-category__tag o-train-category__tag--info">
43-
{{ partial "icon" "calendar_check" }}
44-
{{ i18n "trainCategory.reservation.possible" }}
45-
</span>
46-
{{- else -}}
47-
<span class="o-train-category__tag o-train-category__tag--info">
48-
{{ partial "icon" "calendar_lock" }}
49-
{{ i18n "trainCategory.reservation.notPossible" }}
50-
</span>
51-
{{- end -}}
32+
{{- if eq .reservation_required true -}}
33+
<span class="o-train-category__tag o-train-category__tag--error">
34+
{{ partial "icon" "calendar_add_on" }}
35+
{{ i18n "trainCategory.reservation.required" }}
36+
</span>
37+
{{- else if eq .reservation_required true -}}
38+
<span class="o-train-category__tag o-train-category__tag--warning">
39+
{{ partial "icon" "calendar_add_on" }}
40+
{{ i18n "trainCategory.reservation.partiallyRequired" }}
41+
</span>
42+
{{- else if eq .reservation_possible true -}}
43+
<span class="o-train-category__tag o-train-category__tag--info">
44+
{{ partial "icon" "calendar_check" }}
45+
{{ i18n "trainCategory.reservation.possible" }}
46+
</span>
47+
{{- else -}}
48+
<span class="o-train-category__tag o-train-category__tag--info">
49+
{{ partial "icon" "calendar_lock" }}
50+
{{ i18n "trainCategory.reservation.notPossible" }}
51+
</span>
52+
{{- end -}}
5253

53-
{{- if .risk_of_confusion -}}
54-
<span class="o-train-category__tag o-train-category__tag--warning">
55-
{{ partial "icon" "question_exchange" }}
56-
{{ i18n "trainCategory.riskOfConfusion" }}
57-
</span>
58-
{{- end -}}
54+
{{- if .risk_of_confusion -}}
55+
<span class="o-train-category__tag o-train-category__tag--warning">
56+
{{ partial "icon" "question_exchange" }}
57+
{{ i18n "trainCategory.riskOfConfusion" }}
58+
</span>
59+
{{- end -}}
5960

60-
{{- if .important_info -}}
61-
<span class="o-train-category__tag o-train-category__tag--warning">
62-
{{ partial "icon" "campaign" }}
63-
{{ i18n "trainCategory.importantInformation" }}
64-
</span>
65-
{{- end -}}
61+
{{- if .important_info -}}
62+
<span class="o-train-category__tag o-train-category__tag--warning">
63+
{{ partial "icon" "campaign" }}
64+
{{ i18n "trainCategory.importantInformation" }}
65+
</span>
66+
{{- end -}}
67+
</div>
6668
</div>
69+
{{- partial "icon" "keyboard_arrow_down" -}}
70+
</summary>
71+
<hr aria-hidden="true" />
72+
<div class="o-expander__content">
73+
{{- .content -}}
74+
{{- if .route_overview_url -}}
75+
{{- partial "button"
76+
(dict
77+
"Destination" .route_overview_url
78+
"Text" (T "trainCategory.routeOverview")
79+
)
80+
-}}
81+
{{- end -}}
82+
{{- if .additional_information_url -}}
83+
{{- partial "button"
84+
(dict
85+
"Destination" .additional_information_url
86+
"Text" (T "trainCategory.additionalInformation")
87+
)
88+
-}}
89+
{{- end -}}
6790
</div>
68-
{{- partial "icon" "keyboard_arrow_down" -}}
69-
</summary>
70-
<hr aria-hidden="true" />
71-
<div class="o-expander__content">
72-
{{- .content -}}
73-
</div>
91+
</details>

layouts/shortcodes/train-category.html

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@
66
"reservation_possible" (default false (.Get "reservation_possible"))
77
"risk_of_confusion" (default false (.Get "risk_of_confusion"))
88
"important_info" (default false (.Get "important_info"))
9+
"route_overview_url" (.Get "route_overview_url")
10+
"additional_information_url" (.Get "additional_information_url")
911
"content" (.Inner | .Page.RenderString)
1012
-}}
1113

12-
13-
<details class="details-screen o-expander o-expander--booking">
14-
{{- partial "train-category" $data -}}
15-
</details>
16-
17-
<details open class="details-print o-expander o-expander--booking">
18-
{{- partial "train-category" $data -}}
19-
</details>
14+
{{- partial "train-category" $data -}}

0 commit comments

Comments
 (0)