|
| 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 | + |
| 20 | + |
| 21 | +<div class="o-fip-validity"> |
| 22 | + <div class="o-fip-validity__tags"> |
| 23 | + {{- if isset $page.Params "fip_coupon" -}} |
| 24 | + {{- $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")) -}} |
| 30 | + {{- end -}} |
| 31 | + {{- partial "tag" ( |
| 32 | + dict |
| 33 | + "Icon" (cond $accepted "check_circle" "cancel") |
| 34 | + "Text" "fipValidity.fip-coupon" |
| 35 | + "Type" (cond $accepted "success" "error") |
| 36 | + "Footnote" $footnoteNum |
| 37 | + ) |
| 38 | + }} |
| 39 | + {{- end -}} |
| 40 | + |
| 41 | + {{- if isset $page.Params "fip_coupon_relatives" -}} |
| 42 | + {{- $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")) -}} |
| 48 | + {{- end -}} |
| 49 | + {{- partial "tag" ( |
| 50 | + dict |
| 51 | + "Icon" (cond $accepted "check_circle" "cancel") |
| 52 | + "Text" "fipValidity.fip-coupon-relatives" |
| 53 | + "Type" (cond $accepted "success" "error") |
| 54 | + "Footnote" $footnoteNum |
| 55 | + ) |
| 56 | + }} |
| 57 | + {{- end -}} |
| 58 | + |
| 59 | + {{- if isset $page.Params "fip_50_ticket" -}} |
| 60 | + {{- $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")) -}} |
| 66 | + {{- end -}} |
| 67 | + {{- partial "tag" ( |
| 68 | + dict |
| 69 | + "Icon" (cond $accepted "check_circle" "cancel") |
| 70 | + "Text" "fipValidity.fip-50-ticket" |
| 71 | + "Type" (cond $accepted "success" "error") |
| 72 | + "Footnote" $footnoteNum |
| 73 | + ) |
| 74 | + }} |
| 75 | + {{- end -}} |
| 76 | + |
| 77 | + {{- if isset $page.Params "fip_global_fare" -}} |
| 78 | + {{- $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")) -}} |
| 84 | + {{- end -}} |
| 85 | + {{- partial "tag" ( |
| 86 | + dict |
| 87 | + "Icon" (cond $accepted "check_circle" "cancel") |
| 88 | + "Text" "fipValidity.fip-global-fare" |
| 89 | + "Type" (cond $accepted "success" "error") |
| 90 | + "Footnote" $footnoteNum |
| 91 | + ) |
| 92 | + }} |
| 93 | + {{- end -}} |
| 94 | + </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 | +</div> |
0 commit comments