Skip to content

Commit 6809101

Browse files
committed
feat: Use different icons for booking expander meta
1 parent 923d5d7 commit 6809101

File tree

3 files changed

+40
-19
lines changed

3 files changed

+40
-19
lines changed

assets/sass/_variables.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ html {
2727
--color-onLight: #{$color-onLight};
2828
--color-table-border: #{$color-table-border};
2929
--color-body: rgb(33, 37, 41);
30+
--color-success: #0a8754;
31+
--color-error: #c41e3a;
3032
--border-radius-s: 0.4rem;
3133
--border-radius-m: 0.8rem;
3234
--border-radius-l: 1.6rem;
@@ -57,6 +59,8 @@ html[data-theme="dark"] {
5759
--color-onLight: #ffffff;
5860
--color-table-border: #555;
5961
--color-body: #e0e0e0;
62+
--color-success: #2ea44f;
63+
--color-error: #f85149;
6064
--pagefind-ui-border: #555;
6165
--box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.5);
6266
--box-shadow-light: 0.4rem 0.4rem 0.4rem rgba(0, 0, 0, 0.3);

assets/sass/booking.scss

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@
6868
}
6969

7070
.o-booking__meta {
71-
text-align: center;
7271
display: flex;
7372
flex-direction: column;
74-
align-items: center;
7573
justify-content: center;
7674

7775
@media (max-width: #{$breakpoint-md}) {
@@ -81,6 +79,20 @@
8179
display: none;
8280
}
8381
}
82+
83+
&-item {
84+
display: flex;
85+
align-items: center;
86+
gap: 0.4rem;
87+
88+
&--success {
89+
color: var(--color-success);
90+
}
91+
92+
&--error {
93+
color: var(--color-error);
94+
}
95+
}
8496
}
8597

8698
.o-booking__links {

layouts/partials/booking.html

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,28 @@
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>
22-
{{- end -}}
23-
{{- if ne .fip_50 "nil" -}}
24-
<div>
25-
{{- T "booking.fip-50" }}
26-
{{ if .fip_50 -}}✅{{- else -}}⛔{{- end -}}
27-
</div>
28-
{{- 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>
17+
{{- $metaFields := slice
18+
(dict "key" "reservations" "value" .reservations "label" "booking.reservation")
19+
(dict "key" "fip_50" "value" .fip_50 "label" "booking.fip-50")
20+
(dict "key" "fip_global_fare" "value" .fip_global_fare "label" "booking.fip-global-fare")
21+
-}}
22+
{{- range $metaFields -}}
23+
{{- if ne .value "nil" -}}
24+
<div
25+
class="o-booking__meta-item {{ if .value }}
26+
o-booking__meta-item--success
27+
{{ else }}
28+
o-booking__meta-item--error
29+
{{ end }}"
30+
>
31+
{{- if .value -}}
32+
{{- partial "icon" "check_circle" -}}
33+
{{- else -}}
34+
{{- partial "icon" "cancel" -}}
35+
{{- end -}}
36+
<span>{{- T .label -}}</span>
37+
</div>
38+
{{- end -}}
3439
{{- end -}}
3540
</div>
3641
<div class="o-booking__classes">

0 commit comments

Comments
 (0)