69 lines
3.0 KiB
HTML
69 lines
3.0 KiB
HTML
{{- /* responsible-gambling-block.html — locale-aware RG messaging.
|
|
Call with (dict "page" . "variant" "compact"|"full").
|
|
Server renders the DEFAULT locale; the locale switcher updates the
|
|
[data-age-value] / [data-rg-name] / [data-rg-link] elements client-side. */ -}}
|
|
{{- $page := .page -}}
|
|
{{- $variant := .variant | default "full" -}}
|
|
{{- $brand := $page.Site.Data.brand -}}
|
|
{{- $locales := $page.Site.Data.locales -}}
|
|
{{- $currentLocale := $brand.defaultLocale -}}
|
|
{{- range $brand.supportedLocales -}}
|
|
{{- if or (eq . $page.Language.LanguageCode) (hasPrefix . (printf "%s-" $page.Language.Lang)) -}}{{- $currentLocale = . -}}{{- end -}}
|
|
{{- end -}}
|
|
{{- $default := "" -}}
|
|
{{- with where $locales "locale" $currentLocale -}}{{- $default = index . 0 -}}{{- end -}}
|
|
{{- $age := $brand.ageRestrictionDefault -}}
|
|
{{- $orgName := "your national support service" -}}
|
|
{{- $orgUrl := "#" -}}
|
|
{{- $orgPhone := "" -}}
|
|
{{- with $default -}}
|
|
{{- $age = .ageRestriction -}}
|
|
{{- $orgName = .responsibleGamblingOrgName -}}
|
|
{{- $orgUrl = .responsibleGamblingUrl -}}
|
|
{{- $orgPhone = .responsibleGamblingPhone | default "" -}}
|
|
{{- end -}}
|
|
|
|
{{- if eq $variant "compact" -}}
|
|
<p>{{ printf (i18n "rgCompactIntro") $age }}</p>
|
|
<p class="mt-2">{{ i18n "rgNeedHelp" }} <a data-rg-link href="{{ $orgUrl }}" target="_blank" rel="noopener nofollow" class="font-semibold text-white underline"><span data-rg-name>{{ $orgName }}</span></a>.</p>
|
|
{{- with $orgPhone }}<p class="mt-2">Free helpline: <a href="tel:{{ replace . " " "" }}" class="font-semibold text-white underline">{{ . }}</a>.</p>{{ end -}}
|
|
{{- else -}}
|
|
<div class="prose-content">
|
|
<p>
|
|
{{ printf (i18n "rgFullIntro") $age }}
|
|
</p>
|
|
|
|
<h3>{{ i18n "rgControlTools" }}</h3>
|
|
<ul>
|
|
<li>{{ i18n "rgDepositLimits" | safeHTML }}</li>
|
|
<li>{{ i18n "rgLossLimits" | safeHTML }}</li>
|
|
<li>{{ i18n "rgRealityChecks" | safeHTML }}</li>
|
|
<li>{{ i18n "rgTimeouts" | safeHTML }}</li>
|
|
<li>{{ i18n "rgSelfExclusion" | safeHTML }}</li>
|
|
</ul>
|
|
|
|
<h3>{{ i18n "rgFindSupport" }}</h3>
|
|
<p>
|
|
{{ i18n "rgRegionRecommends" }}
|
|
<a data-rg-link href="{{ $orgUrl }}" target="_blank" rel="noopener nofollow"><span data-rg-name>{{ $orgName }}</span></a>.
|
|
{{ i18n "rgSupportIntro" }}
|
|
</p>
|
|
<div class="overflow-x-auto">
|
|
<table class="data-table">
|
|
<thead>
|
|
<tr><th scope="col">{{ i18n "region" }}</th><th scope="col">{{ i18n "minimumAge" }}</th><th scope="col">{{ i18n "supportOrganisation" }}</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{{- range $locales -}}
|
|
<tr>
|
|
<td>{{ .label | default .locale }}</td>
|
|
<td>{{ .ageRestriction }}+</td>
|
|
<td><a href="{{ .responsibleGamblingUrl }}" target="_blank" rel="noopener nofollow">{{ .responsibleGamblingOrgName }}</a>{{ with .responsibleGamblingPhone }}<br><a href="tel:{{ replace . " " "" }}">{{ . }}</a>{{ end }}</td>
|
|
</tr>
|
|
{{- end -}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|