Files
igaming-template/layouts/partials/payment-table.html
T

52 lines
2.4 KiB
HTML

{{- /* payment-table.html — renders data/payment_methods.yaml.
Call with (dict "page" . "locale" "<optional locale>").
- If "locale" is given, methods are filtered server-side to that market.
- Otherwise ALL methods render, and each row carries data-locales so the
locale switcher can show/hide rows for the visitor's selected region. */ -}}
{{- $page := .page -}}
{{- $brand := $page.Site.Data.brand -}}
{{- $methods := $page.Site.Data.payment_methods -}}
{{- $locale := .locale | default $page.Language.LanguageCode -}}
{{- if $locale -}}
{{- $f := slice -}}
{{- range $methods -}}{{ if in .availableLocales $locale }}{{ $f = $f | append . }}{{ end }}{{- end -}}
{{- $methods = $f -}}
{{- end -}}
{{- $curr := "£" -}}
{{- with where $page.Site.Data.locales "locale" $locale -}}{{- $curr = (index . 0).currencySymbol -}}{{- end -}}
{{- $isWithdrawal := eq $page.Slug "withdrawal" -}}
<div class="overflow-x-auto">
<table class="data-table">
<thead>
<tr>
<th scope="col">{{ i18n "paymentMethod" }}</th>
<th scope="col">{{ i18n "paymentType" }}</th>
{{ if not $isWithdrawal }}<th scope="col">{{ i18n "minimumDeposit" }}</th>{{ end }}
{{ if not $isWithdrawal }}<th scope="col">{{ i18n "maximumDeposit" }}</th>{{ end }}
<th scope="col">{{ i18n "processingTime" }}</th>
<th scope="col">{{ i18n "fees" }}</th>
</tr>
</thead>
<tbody>
{{- range $methods -}}
<tr data-payment-row data-locales="{{ delimit .availableLocales "," }}">
<th scope="row" class="font-medium">
<span class="flex items-center gap-2">
<img src="{{ .logoPath | relURL }}" alt="{{ .name }} logo" width="40" height="24" loading="lazy" class="h-6 w-auto rounded-sm border border-secondary/10">
{{ .name }}
</span>
</th>
<td><span class="badge-muted capitalize">{{ .type }}</span></td>
{{ if not $isWithdrawal }}<td><span data-locale-currency>{{ $curr }}</span>{{ .minDeposit }}</td>{{ end }}
{{ if not $isWithdrawal }}<td><span data-locale-currency>{{ $curr }}</span>{{ .maxDeposit }}</td>{{ end }}
<td>{{ .processingTime }}</td>
<td>{{ .fees }}</td>
</tr>
{{- end -}}
</tbody>
</table>
</div>
<p class="mt-2 text-xs text-secondary/70">{{ i18n "paymentAvailabilityNote" }}</p>