Skip to content

Commit ce6d895

Browse files
committed
feat: Also change booking expanders to tags
1 parent 631eda6 commit ce6d895

File tree

10 files changed

+154
-70
lines changed

10 files changed

+154
-70
lines changed

assets/sass/booking.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
flex-direction: column;
7474
align-items: center;
7575
justify-content: center;
76+
gap: 0.6rem;
77+
font-size: 1.1em;
7678

7779
@media (max-width: #{$breakpoint-md}) {
7880
align-items: flex-start;

assets/sass/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
@import "interactiveMap.scss";
1919
@import "dropdown.scss";
2020
@import "trainCategory.scss";
21+
@import "tag.scss";

assets/sass/tag.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.a-tag {
2+
display: flex;
3+
align-items: center;
4+
gap: 0.4rem;
5+
padding: 0.4rem 0.8rem;
6+
border-radius: var(--border-radius-s);
7+
font-size: 0.7em;
8+
font-weight: 500;
9+
white-space: nowrap;
10+
11+
@each $name, $color in $tag-colors {
12+
&--#{$name} {
13+
background: var(--tag-#{$name}-bg);
14+
color: var(--tag-#{$name}-color);
15+
border: 0.1rem solid var(--tag-#{$name}-border);
16+
}
17+
}
18+
}

assets/sass/trainCategory.scss

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,6 @@
1818
gap: 0.6rem;
1919
}
2020

21-
.o-train-category__tag {
22-
display: flex;
23-
align-items: center;
24-
gap: 0.4rem;
25-
padding: 0.4rem 0.8rem;
26-
border-radius: var(--border-radius-s);
27-
font-size: 1.2rem;
28-
font-weight: 500;
29-
white-space: nowrap;
30-
31-
@each $name, $color in $tag-colors {
32-
&--#{$name} {
33-
background: var(--tag-#{$name}-bg);
34-
color: var(--tag-#{$name}-color);
35-
border: 0.1rem solid var(--tag-#{$name}-border);
36-
}
37-
}
38-
}
39-
4021
.o-expander__summary--train-category {
4122
&:hover,
4223
&:focus {

i18n/de.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ booking:
99
second: 2. Klasse
1010
fee: Buchungsgebühr
1111
fip-50: FIP 50 Fahrkarten
12+
fip-50-bookable: FIP 50 Fahrkarten buchbar
13+
fip-50-not-bookable: FIP 50 Fahrkarten nicht buchbar
1214
fip-global-fare: FIP Globalpreis
15+
fip-global-fare-bookable: FIP Globalpreis buchbar
16+
fip-global-fare-not-bookable: FIP Globalpreis nicht buchbar
1317
reservation: Reservierung
18+
reservation-bookable: Reservierung buchbar
1419
reservation-costs: Reservierungskosten
20+
reservation-not-bookable: Reservierung nicht buchbar
1521
visit-additional-information-website: Weitere Informationen
1622
visit-booking-website: Zur Buchungsseite
1723
contentNavigation:

i18n/en.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ booking:
88
second: 2nd Class
99
fee: Booking Fee
1010
fip-50: FIP 50 Tickets
11+
fip-50-bookable: FIP 50 Tickets bookable
12+
fip-50-not-bookable: FIP 50 Tickets not bookable
1113
fip-global-fare: FIP Global Fare
14+
fip-global-fare-bookable: FIP Global Fare bookable
15+
fip-global-fare-not-bookable: FIP Global Fare not bookable
1216
reservation: Reservation
17+
reservation-bookable: Reservation bookable
1318
reservation-costs: Reservation Costs
19+
reservation-not-bookable: Reservation not bookable
1420
visit-additional-information-website: Additional Information
1521
visit-booking-website: To Booking Website
1622
contentNavigation:

i18n/fr.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ booking:
88
second: 2nd classe
99
fee: Frais de réservation
1010
fip-50: Billets FIP 50
11+
fip-50-bookable: Billets FIP 50 réservables
12+
fip-50-not-bookable: Billets FIP 50 non réservables
1113
fip-global-fare: Tarif Global FIP
14+
fip-global-fare-bookable: Tarif Global FIP réservable
15+
fip-global-fare-not-bookable: Tarif Global FIP non réservable
1216
reservation: Réservation
17+
reservation-bookable: Réservation réservable
1318
reservation-costs: Frais de réservation
19+
reservation-not-bookable: Réservation non réservable
1420
visit-additional-information-website: Informations complémentaires
1521
visit-booking-website: Aller sur le site de réservation
1622
contentNavigation:

layouts/partials/booking.html

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,56 @@
1414
{{- end }}
1515
</div>
1616
<div class="o-booking__meta">
17-
{{- if ne .reservations "nil" -}}
18-
<div>
19-
{{- T "booking.reservation" }}
20-
{{ if .reservations -}}✅{{- else -}}⛔{{- end -}}
21-
</div>
17+
{{- if eq .reservations true -}}
18+
{{- partial "tag" (
19+
dict
20+
"Icon" "confirmation_number"
21+
"Text" "booking.reservation-bookable"
22+
"Type" "success"
23+
)
24+
-}}
25+
{{ else if eq .reservations false -}}
26+
{{- partial "tag" (
27+
dict
28+
"Icon" "credit_card_off"
29+
"Text" "booking.reservation-not-bookable"
30+
"Type" "error"
31+
)
32+
-}}
2233
{{- end -}}
23-
{{- if ne .fip_50 "nil" -}}
24-
<div>
25-
{{- T "booking.fip-50" }}
26-
{{ if .fip_50 -}}✅{{- else -}}⛔{{- end -}}
27-
</div>
34+
{{- if eq .fip_50 true -}}
35+
{{- partial "tag" (
36+
dict
37+
"Icon" "confirmation_number"
38+
"Text" "booking.fip-50-bookable"
39+
"Type" "success"
40+
)
41+
-}}
42+
{{ else if eq .fip_50 false -}}
43+
{{- partial "tag" (
44+
dict
45+
"Icon" "credit_card_off"
46+
"Text" "booking.fip-50-not-bookable"
47+
"Type" "error"
48+
)
49+
-}}
2850
{{- end -}}
29-
{{- if ne .fip_global_fare "nil" -}}
30-
<div>
31-
{{- T "booking.fip-global-fare" }}
32-
{{ if .fip_global_fare -}}✅{{- else -}}⛔{{- end -}}
33-
</div>
51+
{{- if eq .fip_global_fare true -}}
52+
{{- partial "tag" (
53+
dict
54+
"Icon" "confirmation_number"
55+
"Text" "booking.fip-global-fare-bookable"
56+
"Type" "success"
57+
)
58+
-}}
59+
{{ else if eq .fip_global_fare false -}}
60+
{{- partial "tag" (
61+
dict
62+
"Icon" "credit_card_off"
63+
"Text" "booking.fip-global-fare-not-bookable"
64+
"Type" "error"
65+
)
66+
-}}
3467
{{- end -}}
3568
</div>
3669
<div class="o-booking__classes">

layouts/partials/tag.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<span class="a-tag a-tag--{{ .Type }}">
2+
{{ partial "icon" .Icon }}
3+
{{ i18n .Text }}
4+
</span>

layouts/partials/train-category.html

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,83 @@
1515
</div>
1616
<div class="o-train-category__tags">
1717
{{- if eq .fip_accepted true -}}
18-
<span class="o-train-category__tag o-train-category__tag--success">
19-
{{ partial "icon" "check_circle" }}
20-
{{ i18n "trainCategory.acceptance.accepted" }}
21-
</span>
18+
{{ partial "tag" (
19+
dict
20+
"Icon" "check_circle"
21+
"Text" "trainCategory.acceptance.accepted"
22+
"Type" "success"
23+
)
24+
}}
2225
{{- else if eq .fip_accepted "partially" -}}
23-
<span class="o-train-category__tag o-train-category__tag--warning">
24-
{{ partial "icon" "info" }}
25-
{{ i18n "trainCategory.acceptance.partiallyAccepted" }}
26-
</span>
26+
{{ partial "tag" (
27+
dict
28+
"Icon" "info"
29+
"Text" "trainCategory.acceptance.partiallyAccepted"
30+
"Type" "warning"
31+
)
32+
}}
2733
{{- else -}}
28-
<span class="o-train-category__tag o-train-category__tag--error">
29-
{{ partial "icon" "dangerous" }}
30-
{{ i18n "trainCategory.acceptance.notAccepted" }}
31-
</span>
34+
{{ partial "tag" (
35+
dict
36+
"Icon" "dangerous"
37+
"Text" "trainCategory.acceptance.notAccepted"
38+
"Type" "error"
39+
)
40+
}}
3241
{{- end -}}
3342

3443
{{- if eq .reservation_required true -}}
35-
<span class="o-train-category__tag o-train-category__tag--error">
36-
{{ partial "icon" "calendar_add_on" }}
37-
{{ i18n "trainCategory.reservation.required" }}
38-
</span>
44+
{{ partial "tag" (
45+
dict
46+
"Icon" "calendar_add_on"
47+
"Text" "trainCategory.reservation.required"
48+
"Type" "error"
49+
)
50+
}}
3951
{{- else if eq .reservation_required "partially" -}}
40-
<span class="o-train-category__tag o-train-category__tag--warning">
41-
{{ partial "icon" "calendar_add_on" }}
42-
{{ i18n "trainCategory.reservation.partiallyRequired" }}
43-
</span>
52+
{{ partial "tag" (
53+
dict
54+
"Icon" "calendar_add_on"
55+
"Text" "trainCategory.reservation.partiallyRequired"
56+
"Type" "warning"
57+
)
58+
}}
4459
{{- else if eq .reservation_possible true -}}
45-
<span class="o-train-category__tag o-train-category__tag--info">
46-
{{ partial "icon" "calendar_check" }}
47-
{{ i18n "trainCategory.reservation.possible" }}
48-
</span>
60+
{{ partial "tag" (
61+
dict
62+
"Icon" "calendar_check"
63+
"Text" "trainCategory.reservation.possible"
64+
"Type" "info"
65+
)
66+
}}
4967
{{- else if eq .reservation_possible false -}}
50-
<span class="o-train-category__tag o-train-category__tag--info">
51-
{{ partial "icon" "calendar_lock" }}
52-
{{ i18n "trainCategory.reservation.notPossible" }}
53-
</span>
68+
{{ partial "tag" (
69+
dict
70+
"Icon" "calendar_lock"
71+
"Text" "trainCategory.reservation.notPossible"
72+
"Type" "info"
73+
)
74+
}}
5475
{{- end -}}
5576

5677
{{- if .risk_of_confusion -}}
57-
<span class="o-train-category__tag o-train-category__tag--warning">
58-
{{ partial "icon" "question_exchange" }}
59-
{{ i18n "trainCategory.riskOfConfusion" }}
60-
</span>
78+
{{ partial "tag" (
79+
dict
80+
"Icon" "question_exchange"
81+
"Text" "trainCategory.riskOfConfusion"
82+
"Type" "warning"
83+
)
84+
}}
6185
{{- end -}}
6286

6387
{{- if .important_info -}}
64-
<span class="o-train-category__tag o-train-category__tag--warning">
65-
{{ partial "icon" "campaign" }}
66-
{{ i18n "trainCategory.importantInformation" }}
67-
</span>
88+
{{ partial "tag" (
89+
dict
90+
"Icon" "campaign"
91+
"Text" "trainCategory.importantInformation"
92+
"Type" "warning"
93+
)
94+
}}
6895
{{- end -}}
6996
</div>
7097
</div>

0 commit comments

Comments
 (0)