Skip to content

Commit 36bc717

Browse files
committed
feat: Improve train category tagging system
1 parent 7bdd5b2 commit 36bc717

File tree

10 files changed

+101
-103
lines changed

10 files changed

+101
-103
lines changed

assets/sass/_variables.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ html {
2727
--color-onLight: #{$color-onLight};
2828
--color-table-border: #{$color-table-border};
2929
--color-body: rgb(33, 37, 41);
30+
--tag-success-bg: #d4edda;
31+
--tag-success-color: #155724;
32+
--tag-success-border: #c3e6cb;
33+
--tag-warning-bg: #fff3cd;
34+
--tag-warning-color: #856404;
35+
--tag-warning-border: #ffeaa7;
36+
--tag-error-bg: #f8d7da;
37+
--tag-error-color: #721c24;
38+
--tag-error-border: #f5c6cb;
39+
--tag-info-bg: #cce7ff;
40+
--tag-info-color: #004085;
41+
--tag-info-border: #b3d9ff;
3042
--border-radius-s: 0.4rem;
3143
--border-radius-m: 0.8rem;
3244
--border-radius-l: 1.6rem;
@@ -37,6 +49,7 @@ html {
3749
--highlight-color-tip: #c4f2ff;
3850
--highlight-color-inofficial: #f0f3f5;
3951
--highlight-color-important: #ffe3d9;
52+
--highlight-color-confusion: #ffe6cc;
4053
--border: 0.1rem solid transparent;
4154
--pagefind-ui-font: roboto, Arial, Helvetica, sans-serif;
4255
--outline-focus-indicator: #257fa8;
@@ -54,16 +67,32 @@ html[data-theme="dark"] {
5467
--link-special: #ffffff;
5568
--bg-default: #151b23;
5669
--bg-neutral: #0d1117;
70+
--bg-accent: #86761a;
71+
--bg-accent2: #daba00;
72+
--bg-accent3: #fff284;
5773
--color-onLight: #ffffff;
5874
--color-table-border: #555;
5975
--color-body: #e0e0e0;
76+
--tag-success-bg: #1a4d2e;
77+
--tag-success-color: #a8d5ba;
78+
--tag-success-border: #2d6a4f;
79+
--tag-warning-bg: #4a3a1a;
80+
--tag-warning-color: #f0d98d;
81+
--tag-warning-border: #6b5520;
82+
--tag-error-bg: #4a1a1a;
83+
--tag-error-color: #f5a9ae;
84+
--tag-error-border: #6b2d2d;
85+
--tag-info-bg: #1a3a5c;
86+
--tag-info-color: #a8d5f5;
87+
--tag-info-border: #2d5a8b;
6088
--pagefind-ui-border: #555;
6189
--box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.5);
6290
--box-shadow-light: 0.4rem 0.4rem 0.4rem rgba(0, 0, 0, 0.3);
6391
--pagefind-ui-background: var(--bg-default);
6492
--highlight-color-tip: #1a4a5c;
6593
--highlight-color-inofficial: #2a2d30;
6694
--highlight-color-important: #4a2a1a;
95+
--highlight-color-confusion: #4a3a1a;
6796
--border: 0.1rem solid #3d444d;
6897
--outline-focus-indicator: #2e9acb;
6998
}

assets/sass/textHighlight.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,12 @@
5454
border: 0.2rem solid #ba3d12;
5555
}
5656
}
57+
58+
.m-text-highlight--confusion {
59+
background-color: var(--highlight-color-confusion);
60+
border-left: #ff9100e1 solid 1rem;
61+
62+
@media print {
63+
border: 0.2rem solid #ff9100e1;
64+
}
65+
}

assets/sass/trainCategory.scss

Lines changed: 15 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -41,57 +41,35 @@
4141
font-weight: 500;
4242
white-space: nowrap;
4343

44-
&--accepted {
45-
background: #d4edda;
46-
color: #155724;
47-
border: 0.1rem solid #c3e6cb;
44+
&--success {
45+
background: var(--tag-success-bg);
46+
color: var(--tag-success-color);
47+
border: 0.1rem solid var(--tag-success-border);
4848
}
4949

50-
&--rejected {
51-
background: #f8d7da;
52-
color: #721c24;
53-
border: 0.1rem solid #f5c6cb;
50+
&--warning {
51+
background: var(--tag-warning-bg);
52+
color: var(--tag-warning-color);
53+
border: 0.1rem solid var(--tag-warning-border);
5454
}
5555

56-
&--required {
57-
background: #fff3cd;
58-
color: #856404;
59-
border: 0.1rem solid #ffeaa7;
60-
}
61-
62-
&--possible {
63-
background: #cce7ff;
64-
color: #004085;
65-
border: 0.1rem solid #b3d9ff;
66-
}
67-
68-
&--none {
69-
background: #e2e3e5;
70-
color: #383d41;
71-
border: 0.1rem solid #d6d8db;
56+
&--error {
57+
background: var(--tag-error-bg);
58+
color: var(--tag-error-color);
59+
border: 0.1rem solid var(--tag-error-border);
7260
}
7361

7462
&--info {
75-
background: #e7f3ff;
76-
color: #0c5460;
77-
border: 0.1rem solid #bee5eb;
63+
background: var(--tag-info-bg);
64+
color: var(--tag-info-color);
65+
border: 0.1rem solid var(--tag-info-border);
7866
}
7967
}
8068

8169
.o-train-category__content {
8270
margin-top: 1rem;
8371
}
8472

85-
.o-train-category__info {
86-
padding: 0.8rem;
87-
margin-bottom: 1rem;
88-
background: #e7f3ff;
89-
border: 0.1rem solid #bee5eb;
90-
border-radius: var(--border-radius-s);
91-
color: #0c5460;
92-
font-style: italic;
93-
}
94-
9573
.o-expander__summary--train-category {
9674
&:hover,
9775
&:focus {
@@ -100,51 +78,3 @@
10078
}
10179
}
10280
}
103-
104-
html[data-theme="dark"] {
105-
.o-train-category {
106-
&__info {
107-
background: #0c3544;
108-
border-color: #17a2b8;
109-
color: #bee5eb;
110-
}
111-
112-
&__tag {
113-
&--accepted {
114-
background: #2d5a3d;
115-
color: #a3d5ab;
116-
border-color: #4a7c59;
117-
}
118-
119-
&--rejected {
120-
background: #5a2d32;
121-
color: #f5a3ab;
122-
border-color: #7c4a52;
123-
}
124-
125-
&--required {
126-
background: #5a4d2d;
127-
color: #f5e6a3;
128-
border-color: #7c6a4a;
129-
}
130-
131-
&--possible {
132-
background: #2d4a5a;
133-
color: #a3d5f5;
134-
border-color: #4a6a7c;
135-
}
136-
137-
&--none {
138-
background: #3d3d3d;
139-
color: #d0d0d0;
140-
border-color: #5a5a5a;
141-
}
142-
143-
&--info {
144-
background: #0c3544;
145-
color: #bee5eb;
146-
border-color: #17a2b8;
147-
}
148-
}
149-
}
150-
}

content/operator/sncf/index.en.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,29 @@ Reservations are mandatory on all `TGV`, almost all `IC` trains, and some region
4141
title="Train à grande vitesse inOui (TGV inOui)"
4242
fip_accepted=true
4343
reservation_required=true
44-
info_available=true
44+
risk_of_confusion=true
45+
important_info=true
46+
type="highspeed"
4547
%}}
4648
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.
4749

48-
{{% highlight inofficial %}}
50+
{{% highlight confusion %}}
4951
SNCF also operates low-cost `TGV` trains under the name OuiGo, which are not valid with FIP.
5052
{{% /highlight %}}
5153

5254
{{% highlight important %}}
5355
Special conditions apply for international connections, see International TGV inOui / ICE trains section below.
5456
{{% /highlight %}}
5557

56-
**Reservation cost:** \
57-
Prices differ between peak and off-peak trains. Off-peak: €1.70 (1st/2nd class); peak: €15 (1st class), €10 (2nd class). The classification is not publicly available.
58+
### Reservation
59+
60+
Prices differ between peak and off-peak trains. The classification is not publicly available.
61+
62+
| | 1st class | 2nd class |
63+
| -------- | --------- | --------- |
64+
| Off-peak | €1.70 | €1.70 |
65+
| Peak | €15 | €10 |
66+
5867
{{% /train-category %}}
5968

6069
{{% train-category

i18n/de.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ highlight:
3535
important: Wichtige Information
3636
inofficial: Inoffizielle Information
3737
tip: Persönlicher Tipp
38+
confusion: Verwechslungsgefahr
3839
home-page-text: FIP Guide Startseite
3940
information-disclaimer-short: >-
4041
Diese Informationen sind inoffiziell und ohne Gewähr. Es besteht keine

i18n/en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ highlight:
3434
important: Important Information
3535
inofficial: Unofficial Information
3636
tip: Personal Tip
37+
confusion: Risk of Confusion
3738
home-page-text: FIP Guide Home Page
3839
information-disclaimer-short: >-
3940
The information provided is unofficial and without guarantee. There is no

i18n/fr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ footer-love:
3131
aria-label: Fait avec amour en Europe
3232
text: Fait avec ♥️ en Europe
3333
highlight:
34+
confusion: Risque de confusion
3435
important: Informations importantes
3536
inofficial: Informations non officielles
3637
tip: Conseil personnel

layouts/partials/train-category.html

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,55 @@
99
</div>
1010
<div class="o-train-category__tags">
1111
{{- if eq .fip_accepted true -}}
12-
<span class="o-train-category__tag o-train-category__tag--accepted">
12+
<span class="o-train-category__tag o-train-category__tag--success">
1313
{{ partial "icon" "check_circle" }}
1414
FIP Accepted
1515
</span>
16+
{{- else if eq .fip_accepted "partially" -}}
17+
<span class="o-train-category__tag o-train-category__tag--warning">
18+
{{ partial "icon" "info" }}
19+
FIP Partially Accepted
20+
</span>
1621
{{- else -}}
17-
<span class="o-train-category__tag o-train-category__tag--rejected">
22+
<span class="o-train-category__tag o-train-category__tag--error">
1823
{{ partial "icon" "dangerous" }}
1924
FIP Not Accepted
2025
</span>
2126
{{- end -}}
2227

2328
{{- if eq .reservation_required true -}}
24-
<span class="o-train-category__tag o-train-category__tag--required">
25-
{{ partial "icon" "calendar_month" }}
29+
<span class="o-train-category__tag o-train-category__tag--error">
30+
{{ partial "icon" "calendar_add_on" }}
2631
Reservation Required
2732
</span>
33+
{{- else if eq .reservation_required true -}}
34+
<span class="o-train-category__tag o-train-category__tag--warning">
35+
{{ partial "icon" "calendar_add_on" }}
36+
Reservation Partially Required
37+
</span>
2838
{{- else if eq .reservation_possible true -}}
29-
<span class="o-train-category__tag o-train-category__tag--possible">
30-
{{ partial "icon" "free_cancellation" }}
39+
<span class="o-train-category__tag o-train-category__tag--info">
40+
{{ partial "icon" "calendar_check" }}
3141
Reservation Possible
3242
</span>
3343
{{- else -}}
34-
<span class="o-train-category__tag o-train-category__tag--none">
35-
{{ partial "icon" "close" }}
44+
<span class="o-train-category__tag o-train-category__tag--info">
45+
{{ partial "icon" "calendar_lock" }}
3646
No Reservation Possible
3747
</span>
3848
{{- end -}}
3949

40-
{{- if .info_available -}}
41-
<span class="o-train-category__tag o-train-category__tag--info">
42-
{{ partial "icon" "info" }}
43-
Information Available
50+
{{- if .risk_of_confusion -}}
51+
<span class="o-train-category__tag o-train-category__tag--warning">
52+
{{ partial "icon" "question_exchange" }}
53+
Risk of confusion
54+
</span>
55+
{{- end -}}
56+
57+
{{- if .important_info -}}
58+
<span class="o-train-category__tag o-train-category__tag--warning">
59+
{{ partial "icon" "campaign" }}
60+
Important information
4461
</span>
4562
{{- end -}}
4663
</div>

layouts/shortcodes/highlight.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- $param := .Get 0 -}}
2-
{{ $iconMapping := dict "important" "error" "inofficial" "warning" "tip" "lightbulb_2" }}
2+
{{ $iconMapping := dict "important" "error" "inofficial" "warning" "tip" "lightbulb_2" "confusion" "question_exchange" }}
33

44

55
<div class="m-text-highlight m-text-highlight--{{ $param }}">

layouts/shortcodes/train-category.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"fip_accepted" (default true (.Get "fip_accepted"))
44
"reservation_required" (default false (.Get "reservation_required"))
55
"reservation_possible" (default false (.Get "reservation_possible"))
6-
"info_available" (default false (.Get "info_available"))
6+
"risk_of_confusion" (default false (.Get "risk_of_confusion"))
7+
"important_info" (default false (.Get "important_info"))
78
"content" (.Inner | .Page.RenderString)
89
-}}
910

0 commit comments

Comments
 (0)