Files
igaming-template/layouts/partials/responsible-gambling-block.html
T

63 lines
2.5 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 := $page.Language.LanguageCode | default $brand.defaultLocale -}}
{{- $default := "" -}}
{{- with where $locales "locale" $currentLocale -}}{{- $default = index . 0 -}}{{- end -}}
{{- $age := $brand.ageRestrictionDefault -}}
{{- $orgName := "your national support service" -}}
{{- $orgUrl := "#" -}}
{{- with $default -}}
{{- $age = .ageRestriction -}}
{{- $orgName = .responsibleGamblingOrgName -}}
{{- $orgUrl = .responsibleGamblingUrl -}}
{{- 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>
{{- 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></td>
</tr>
{{- end -}}
</tbody>
</table>
</div>
</div>
{{- end -}}