|
1 | 1 | {{- $page := .Page -}} |
2 | | -{{- $footnotes := dict -}} |
3 | | - |
4 | | -{{- with .Get "fip_coupon_footnote" -}} |
5 | | - {{- $footnotes = merge $footnotes (dict "fip_coupon" .) -}} |
6 | | -{{- end -}} |
7 | | -{{- with .Get "fip_coupon_relatives_footnote" -}} |
8 | | - {{- $footnotes = merge $footnotes (dict "fip_coupon_relatives" .) -}} |
9 | | -{{- end -}} |
10 | | -{{- with .Get "fip_50_ticket_footnote" -}} |
11 | | - {{- $footnotes = merge $footnotes (dict "fip_50_ticket" .) -}} |
12 | | -{{- end -}} |
13 | | -{{- with .Get "fip_global_fare_footnote" -}} |
14 | | - {{- $footnotes = merge $footnotes (dict "fip_global_fare" .) -}} |
15 | | -{{- end -}} |
16 | | - |
17 | | -{{- $footnoteCounter := 0 -}} |
18 | | -{{- $footnoteMap := dict -}} |
19 | 2 |
|
20 | 3 |
|
21 | 4 | <div class="o-fip-validity"> |
22 | 5 | <div class="o-fip-validity__tags"> |
23 | 6 | {{- if isset $page.Params "fip_coupon" -}} |
24 | 7 | {{- $accepted := $page.Params.fip_coupon -}} |
25 | | - {{- $footnoteNum := "" -}} |
26 | | - {{- if isset $footnotes "fip_coupon" -}} |
27 | | - {{- $footnoteCounter = add $footnoteCounter 1 -}} |
28 | | - {{- $footnoteNum = printf "%d)" $footnoteCounter -}} |
29 | | - {{- $footnoteMap = merge $footnoteMap (dict (string $footnoteCounter) (index $footnotes "fip_coupon")) -}} |
| 8 | + {{- $note := "" -}} |
| 9 | + {{- with .Get "fip_coupon_footnote" -}} |
| 10 | + {{- $note = $page.RenderString . -}} |
30 | 11 | {{- end -}} |
31 | | - {{- partial "tag" ( |
| 12 | + {{- partial "fip-validity-item" ( |
32 | 13 | dict |
33 | 14 | "Icon" (cond $accepted "check_circle" "cancel") |
34 | 15 | "Text" "fipValidity.fip-coupon" |
35 | 16 | "Type" (cond $accepted "success" "error") |
36 | | - "Footnote" $footnoteNum |
| 17 | + "Note" $note |
37 | 18 | ) |
38 | 19 | }} |
39 | 20 | {{- end -}} |
40 | 21 |
|
41 | 22 | {{- if isset $page.Params "fip_coupon_relatives" -}} |
42 | 23 | {{- $accepted := $page.Params.fip_coupon_relatives -}} |
43 | | - {{- $footnoteNum := "" -}} |
44 | | - {{- if isset $footnotes "fip_coupon_relatives" -}} |
45 | | - {{- $footnoteCounter = add $footnoteCounter 1 -}} |
46 | | - {{- $footnoteNum = printf "%d)" $footnoteCounter -}} |
47 | | - {{- $footnoteMap = merge $footnoteMap (dict (string $footnoteCounter) (index $footnotes "fip_coupon_relatives")) -}} |
| 24 | + {{- $note := "" -}} |
| 25 | + {{- with .Get "fip_coupon_relatives_footnote" -}} |
| 26 | + {{- $note = $page.RenderString . -}} |
48 | 27 | {{- end -}} |
49 | | - {{- partial "tag" ( |
| 28 | + {{- partial "fip-validity-item" ( |
50 | 29 | dict |
51 | 30 | "Icon" (cond $accepted "check_circle" "cancel") |
52 | 31 | "Text" "fipValidity.fip-coupon-relatives" |
53 | 32 | "Type" (cond $accepted "success" "error") |
54 | | - "Footnote" $footnoteNum |
| 33 | + "Note" $note |
55 | 34 | ) |
56 | 35 | }} |
57 | 36 | {{- end -}} |
58 | 37 |
|
59 | 38 | {{- if isset $page.Params "fip_50_ticket" -}} |
60 | 39 | {{- $accepted := $page.Params.fip_50_ticket -}} |
61 | | - {{- $footnoteNum := "" -}} |
62 | | - {{- if isset $footnotes "fip_50_ticket" -}} |
63 | | - {{- $footnoteCounter = add $footnoteCounter 1 -}} |
64 | | - {{- $footnoteNum = printf "%d)" $footnoteCounter -}} |
65 | | - {{- $footnoteMap = merge $footnoteMap (dict (string $footnoteCounter) (index $footnotes "fip_50_ticket")) -}} |
| 40 | + {{- $note := "" -}} |
| 41 | + {{- with .Get "fip_50_ticket_footnote" -}} |
| 42 | + {{- $note = $page.RenderString . -}} |
66 | 43 | {{- end -}} |
67 | | - {{- partial "tag" ( |
| 44 | + {{- partial "fip-validity-item" ( |
68 | 45 | dict |
69 | 46 | "Icon" (cond $accepted "check_circle" "cancel") |
70 | 47 | "Text" "fipValidity.fip-50-ticket" |
71 | 48 | "Type" (cond $accepted "success" "error") |
72 | | - "Footnote" $footnoteNum |
| 49 | + "Note" $note |
73 | 50 | ) |
74 | 51 | }} |
75 | 52 | {{- end -}} |
76 | 53 |
|
77 | 54 | {{- if isset $page.Params "fip_global_fare" -}} |
78 | 55 | {{- $accepted := $page.Params.fip_global_fare -}} |
79 | | - {{- $footnoteNum := "" -}} |
80 | | - {{- if isset $footnotes "fip_global_fare" -}} |
81 | | - {{- $footnoteCounter = add $footnoteCounter 1 -}} |
82 | | - {{- $footnoteNum = printf "%d)" $footnoteCounter -}} |
83 | | - {{- $footnoteMap = merge $footnoteMap (dict (string $footnoteCounter) (index $footnotes "fip_global_fare")) -}} |
| 56 | + {{- $note := "" -}} |
| 57 | + {{- with .Get "fip_global_fare_footnote" -}} |
| 58 | + {{- $note = $page.RenderString . -}} |
84 | 59 | {{- end -}} |
85 | | - {{- partial "tag" ( |
| 60 | + {{- partial "fip-validity-item" ( |
86 | 61 | dict |
87 | 62 | "Icon" (cond $accepted "check_circle" "cancel") |
88 | 63 | "Text" "fipValidity.fip-global-fare" |
89 | 64 | "Type" (cond $accepted "success" "error") |
90 | | - "Footnote" $footnoteNum |
| 65 | + "Note" $note |
91 | 66 | ) |
92 | 67 | }} |
93 | 68 | {{- end -}} |
94 | 69 | </div> |
95 | | - |
96 | | - {{- if gt (len $footnoteMap) 0 -}} |
97 | | - <div class="o-fip-validity__footnotes"> |
98 | | - {{- range $index, $text := $footnoteMap -}} |
99 | | - <div class="o-fip-validity__footnote"> |
100 | | - <span class="o-fip-validity__footnote-number">{{ $index }})</span> |
101 | | - <span class="o-fip-validity__footnote-text" |
102 | | - >{{ $text | $page.RenderString }}</span |
103 | | - > |
104 | | - </div> |
105 | | - {{- end -}} |
106 | | - </div> |
107 | | - {{- end -}} |
108 | 70 | </div> |
0 commit comments