-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathbooking.html
More file actions
93 lines (92 loc) · 3.93 KB
/
booking.html
File metadata and controls
93 lines (92 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{{- $iconMapping := dict "website" "computer" "phone" "call" "onsite" "person" "email" "mail" "machine" "confirmation_number" -}}
<summary class="o-expander__summary o-expander__summary--booking">
<div class="o-booking__header">
<div class="o-booking__header-content">
<div class="o-booking__title-wrapper">
<div class="o-booking__title">
{{- partial "icon" (index $iconMapping .page.Params.type) -}}
<span class="o-booking__title-text">{{- .page.Title -}}</span>
</div>
{{- if .subtitle }}
<div class="o-booking__subtitle">
{{- .subtitle -}}
</div>
{{- end }}
</div>
<div class="o-booking__meta">
{{- $metaFields := slice
(dict "key" "reservations" "value" .reservations "label" "booking.reservation")
(dict "key" "fip_50" "value" .fip_50 "label" "booking.fip-50")
(dict "key" "fip_global_fare" "value" .fip_global_fare "label" "booking.fip-global-fare")
-}}
{{- range $metaFields -}}
{{- if ne .value "nil" -}}
{{- if .value -}}
<div
class="o-booking__meta-item o-booking__meta-item--success"
aria-label="{{ T .label }} {{ T "booking.bookable" }}"
>
{{- partial "icon" "check_circle" -}}
<span aria-hidden="true">{{- T .label -}}</span>
</div>
{{- else -}}
<div
class="o-booking__meta-item o-booking__meta-item--error"
aria-label="{{ T .label }} {{ T "booking.not-bookable" }}"
>
{{- partial "icon" "cancel" -}}
<span aria-hidden="true">{{- T .label -}}</span>
</div>
{{- end -}}
{{- end -}}
{{- end -}}
</div>
{{- if or (and (ne .reservations "nil") (ne .reservations false) .classes) (ne .fee "nil") -}}
<div class="o-booking__classes">
{{- if and (ne .reservations "nil") (ne .reservations false) .classes -}}
<span class="o-booking__classes-title"
>{{ T "booking.reservation-costs" }}</span
>
{{- range $k, $v := .classes -}}
<div>
<strong>{{- T (print "booking.classes." $k) -}}:</strong>
{{ $v -}}
</div>
{{- end -}}
{{- end -}}
{{- if ne .fee "nil" -}}
<span class="o-booking__classes-title">{{ T "booking.fee" }}</span>
<div>{{ .fee }}</div>
{{- end -}}
</div>
{{- end -}}
</div>
</div>
{{- partial "icon" "keyboard_arrow_down" -}}
</summary>
<hr aria-hidden="true" />
<div class="o-expander__content">
{{- if .info -}}
<div class="o-booking__info">
{{- .info | .original_page.RenderString -}}
</div>
{{- end -}}
{{- $contentClasses := slice "o-single__content" "o-booking__section" -}}
{{- if or (eq .fip_50 false) (eq .fip_50 "nil") }}
{{- $contentClasses = $contentClasses | append "o-booking__section-fip_50--hidden" -}}
{{- end -}}
{{- if or (eq .fip_global_fare false) (eq .fip_global_fare "nil") }}
{{- $contentClasses = $contentClasses | append "o-booking__section-fip_global_fare--hidden" -}}
{{- end -}}
{{- if or (eq .reservations false) (eq .reservations "nil") }}
{{- $contentClasses = $contentClasses | append "o-booking__section-reservations--hidden" -}}
{{- end -}}
<div class="{{ delimit $contentClasses " " }}">
{{- $content := partial "increase-headings" (dict "content" .page.Content "offset" 2) -}}
{{- $content := partial "prefix-footnotes" (dict "content" $content "prefix" .page.File.ContentBaseName) -}}
{{- $content := partial "prefix-heading-ids" (dict "content" $content "prefix" .page.File.ContentBaseName) -}}
{{- $content := partial "remove-newlines" $content -}}
{{- $content | safeHTML -}}
</div>
{{ partial "booking-links" .page }}
</div>