|
3 | 3 | <div class="a-fip-validity-item__content"> |
4 | 4 | <span class="a-fip-validity-item__text"> |
5 | 5 | {{ i18n .Text }} |
| 6 | + {{- if .ShowCouponFieldsInfo -}} |
| 7 | + <button |
| 8 | + class="a-fip-validity-item__info-button" |
| 9 | + aria-label="{{ i18n "fipValidity.show-coupon-fields-info" }}" |
| 10 | + data-modal-trigger="fip-coupon-fields-modal" |
| 11 | + > |
| 12 | + {{ partial "icon" "info" }} |
| 13 | + </button> |
| 14 | + {{- end -}} |
| 15 | + {{- if .Show50TicketDiscountInfo -}} |
| 16 | + <button |
| 17 | + class="a-fip-validity-item__info-button" |
| 18 | + aria-label="{{ i18n "fipValidity.show-50-ticket-discount-info" }}" |
| 19 | + data-modal-trigger="fip-50-ticket-discount-modal" |
| 20 | + > |
| 21 | + {{ partial "icon" "info" }} |
| 22 | + </button> |
| 23 | + {{- end -}} |
6 | 24 | {{- if .ShowRelativesInfo -}} |
7 | 25 | <button |
8 | 26 | class="a-fip-validity-item__info-button" |
|
19 | 37 | </div> |
20 | 38 | </div> |
21 | 39 |
|
| 40 | +{{- if .ShowCouponFieldsInfo -}} |
| 41 | + <div class="o-modal" id="fip-coupon-fields-modal" aria-hidden="true"> |
| 42 | + <div class="o-modal__overlay" data-modal-close></div> |
| 43 | + <div class="o-modal__container" role="dialog" aria-modal="true"> |
| 44 | + <div class="o-modal__header"> |
| 45 | + <h2 class="o-modal__title"> |
| 46 | + {{ i18n "fipValidity.fip-coupon-fields-modal-title" }} |
| 47 | + </h2> |
| 48 | + <button |
| 49 | + class="o-modal__close" |
| 50 | + data-modal-close |
| 51 | + aria-label="{{ i18n "fipValidity.close-modal" }}" |
| 52 | + > |
| 53 | + {{ partial "icon" "close" }} |
| 54 | + </button> |
| 55 | + </div> |
| 56 | + <div class="o-modal__content"> |
| 57 | + <p class="o-modal__description"> |
| 58 | + {{ i18n "fipValidity.fip-coupon-fields-modal-description" }} |
| 59 | + </p> |
| 60 | + <table class="o-modal__table"> |
| 61 | + <thead> |
| 62 | + <tr> |
| 63 | + <th>{{ i18n "fipValidity.issuer" }}</th> |
| 64 | + <th>{{ i18n "fipValidity.fields" }}</th> |
| 65 | + </tr> |
| 66 | + </thead> |
| 67 | + </table> |
| 68 | + <div class="o-modal__table-wrapper"> |
| 69 | + <table class="o-modal__table o-modal__table--body"> |
| 70 | + <colgroup> |
| 71 | + <col style="width: 50%" /> |
| 72 | + <col style="width: 50%" /> |
| 73 | + </colgroup> |
| 74 | + <tbody> |
| 75 | + {{- $currentPage := .Page -}} |
| 76 | + {{- $currentOperatorDir := $currentPage.File.Dir -}} |
| 77 | + {{- $seenOperators := slice -}} |
| 78 | + |
| 79 | + {{- $currentFieldsParam := $currentPage.Params.fip_coupon_fields -}} |
| 80 | + {{- $fieldsMap := dict -}} |
| 81 | + |
| 82 | + {{- if reflect.IsMap $currentFieldsParam -}} |
| 83 | + {{- $fieldsMap = $currentFieldsParam -}} |
| 84 | + {{- end -}} |
| 85 | + |
| 86 | + {{- range where .Page.Site.Pages "Section" "operator" -}} |
| 87 | + {{- if and (eq .Lang $currentPage.Lang) (ne .File.LogicalName "_index.de.md") (ne .File.LogicalName "_index.en.md") (ne .File.LogicalName "_index.fr.md") -}} |
| 88 | + {{- $operatorId := .File.Dir -}} |
| 89 | + {{- if and (not (in $seenOperators $operatorId)) (ne $operatorId $currentOperatorDir) -}} |
| 90 | + {{- $seenOperators = $seenOperators | append $operatorId -}} |
| 91 | + {{- $operatorIdClean := trim $operatorId "/" -}} |
| 92 | + {{- $operatorName := path.Base $operatorIdClean -}} |
| 93 | + |
| 94 | + {{- $fields := "" -}} |
| 95 | + {{- $hasValue := false -}} |
| 96 | + {{- $status := "unknown" -}} |
| 97 | + {{- $icon := "help" -}} |
| 98 | + |
| 99 | + {{- range $key, $value := $fieldsMap -}} |
| 100 | + {{- if eq $key $operatorName -}} |
| 101 | + {{- $fields = $value -}} |
| 102 | + {{- $hasValue = true -}} |
| 103 | + {{- $status = "yes" -}} |
| 104 | + {{- $icon = "check_circle" -}} |
| 105 | + {{- end -}} |
| 106 | + {{- end -}} |
| 107 | + |
| 108 | + |
| 109 | + <tr> |
| 110 | + <td><a href="{{ .RelPermalink }}">{{ .Title }}</a></td> |
| 111 | + <td |
| 112 | + class="o-modal__status o-modal__status--{{ $status }}" |
| 113 | + > |
| 114 | + {{ partial "icon" $icon }} |
| 115 | + <span> |
| 116 | + {{- if $hasValue -}} |
| 117 | + {{ printf (i18n "fipValidity.fip-coupon-fields-value") $fields }} |
| 118 | + {{- else -}} |
| 119 | + {{ i18n "fipValidity.status-unknown" }} |
| 120 | + {{- end -}} |
| 121 | + </span> |
| 122 | + </td> |
| 123 | + </tr> |
| 124 | + {{- end -}} |
| 125 | + {{- end -}} |
| 126 | + {{- end -}} |
| 127 | + </tbody> |
| 128 | + </table> |
| 129 | + </div> |
| 130 | + </div> |
| 131 | + </div> |
| 132 | + </div> |
| 133 | +{{- end -}} |
| 134 | + |
| 135 | +{{- if .Show50TicketDiscountInfo -}} |
| 136 | + <div class="o-modal" id="fip-50-ticket-discount-modal" aria-hidden="true"> |
| 137 | + <div class="o-modal__overlay" data-modal-close></div> |
| 138 | + <div class="o-modal__container" role="dialog" aria-modal="true"> |
| 139 | + <div class="o-modal__header"> |
| 140 | + <h2 class="o-modal__title"> |
| 141 | + {{ i18n "fipValidity.fip-50-ticket-discount-modal-title" }} |
| 142 | + </h2> |
| 143 | + <button |
| 144 | + class="o-modal__close" |
| 145 | + data-modal-close |
| 146 | + aria-label="{{ i18n "fipValidity.close-modal" }}" |
| 147 | + > |
| 148 | + {{ partial "icon" "close" }} |
| 149 | + </button> |
| 150 | + </div> |
| 151 | + <div class="o-modal__content"> |
| 152 | + <p class="o-modal__description"> |
| 153 | + {{ i18n "fipValidity.fip-50-ticket-discount-modal-description" }} |
| 154 | + </p> |
| 155 | + <table class="o-modal__table"> |
| 156 | + <thead> |
| 157 | + <tr> |
| 158 | + <th>{{ i18n "fipValidity.issuer" }}</th> |
| 159 | + <th>{{ i18n "fipValidity.discount" }}</th> |
| 160 | + </tr> |
| 161 | + </thead> |
| 162 | + </table> |
| 163 | + <div class="o-modal__table-wrapper"> |
| 164 | + <table class="o-modal__table o-modal__table--body"> |
| 165 | + <colgroup> |
| 166 | + <col style="width: 50%" /> |
| 167 | + <col style="width: 50%" /> |
| 168 | + </colgroup> |
| 169 | + <tbody> |
| 170 | + {{- $currentPage := .Page -}} |
| 171 | + {{- $currentOperatorDir := $currentPage.File.Dir -}} |
| 172 | + {{- $seenOperators := slice -}} |
| 173 | + |
| 174 | + {{- $currentDiscountParam := $currentPage.Params.fip_50_ticket_discount -}} |
| 175 | + {{- $discountMap := dict -}} |
| 176 | + |
| 177 | + {{- if reflect.IsMap $currentDiscountParam -}} |
| 178 | + {{- $discountMap = $currentDiscountParam -}} |
| 179 | + {{- end -}} |
| 180 | + |
| 181 | + {{- range where .Page.Site.Pages "Section" "operator" -}} |
| 182 | + {{- if and (eq .Lang $currentPage.Lang) (ne .File.LogicalName "_index.de.md") (ne .File.LogicalName "_index.en.md") (ne .File.LogicalName "_index.fr.md") -}} |
| 183 | + {{- $operatorId := .File.Dir -}} |
| 184 | + {{- if and (not (in $seenOperators $operatorId)) (ne $operatorId $currentOperatorDir) -}} |
| 185 | + {{- $seenOperators = $seenOperators | append $operatorId -}} |
| 186 | + {{- $operatorIdClean := trim $operatorId "/" -}} |
| 187 | + {{- $operatorName := path.Base $operatorIdClean -}} |
| 188 | + |
| 189 | + {{- $discount := 50 -}} |
| 190 | + {{- $hasValue := false -}} |
| 191 | + {{- $status := "yes" -}} |
| 192 | + {{- $icon := "check_circle" -}} |
| 193 | + |
| 194 | + {{- range $key, $value := $discountMap -}} |
| 195 | + {{- if eq $key $operatorName -}} |
| 196 | + {{- $discount = $value -}} |
| 197 | + {{- $hasValue = true -}} |
| 198 | + {{- end -}} |
| 199 | + {{- end -}} |
| 200 | + |
| 201 | + |
| 202 | + <tr> |
| 203 | + <td><a href="{{ .RelPermalink }}">{{ .Title }}</a></td> |
| 204 | + <td |
| 205 | + class="o-modal__status o-modal__status--{{ $status }}" |
| 206 | + > |
| 207 | + {{ partial "icon" $icon }} |
| 208 | + <span>{{ $discount }}%</span> |
| 209 | + </td> |
| 210 | + </tr> |
| 211 | + {{- end -}} |
| 212 | + {{- end -}} |
| 213 | + {{- end -}} |
| 214 | + </tbody> |
| 215 | + </table> |
| 216 | + </div> |
| 217 | + </div> |
| 218 | + </div> |
| 219 | + </div> |
| 220 | +{{- end -}} |
| 221 | + |
22 | 222 | {{- if .ShowRelativesInfo -}} |
23 | 223 | <div class="o-modal" id="fip-relatives-modal" aria-hidden="true"> |
24 | 224 | <div class="o-modal__overlay" data-modal-close></div> |
|
0 commit comments