Customer does not want a contact page, but a page where they can write the direction on how to reach the campground, with a Google map embed instead of using Leaflet, because Google Maps shows the reviews right in the map. That means i had to replace the GPS locations with XML fields for the customer to write. In all four languages. This time i tried a translation approach inspired by PrestaShop: instead of opening a new page for each language, i have all languages in the same page and use AlpineJS to show just a single language. It is far easier to write the translations, even though you do not have the source text visible, specially in this section that there is no place for me to put the language links.
64 lines
2.9 KiB
Plaintext
64 lines
2.9 KiB
Plaintext
<!--
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
{{ define "title" -}}
|
|
{{( pgettext "Location Settings" "title" )}}
|
|
{{- end }}
|
|
|
|
{{ define "content" -}}
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/location.locationForm*/ -}}
|
|
<form data-hx-put="/admin/location">
|
|
<h2>{{( pgettext "Location Settings" "title" )}}</h2>
|
|
{{ CSRFInput }}
|
|
<fieldset x-data="{ lang: 'ca' }">
|
|
{{ with .Directions -}}
|
|
<fieldset>
|
|
<legend>{{( pgettext "Directions" "input" )}}</legend>
|
|
<div class="lang-selector" role="toolbar">
|
|
{{ range $lang, $input := . -}}
|
|
<button :aria-pressed="lang === '{{ $lang }}'"
|
|
@click.prevent="lang = '{{ $lang }}'">{{ $lang }}</button>
|
|
{{- end }}
|
|
</div>
|
|
{{ range $lang, $input := . -}}
|
|
<label x-cloak x-show="lang === '{{ $lang }}'"><span>{{ $lang }}</span><br>
|
|
<textarea class="html"
|
|
name="{{ $input.Name }}" {{ template "error-attrs" . }}>{{ $input.Val }}</textarea><br>
|
|
</label>
|
|
{{- end }}
|
|
{{ template "error-message" . }}
|
|
</fieldset>
|
|
{{- end }}
|
|
{{ with .OpeningDates -}}
|
|
<fieldset>
|
|
<legend>{{( pgettext "Opening Dates" "input" )}}</legend>
|
|
<div class="lang-selector" role="toolbar">
|
|
{{ range $lang, $input := . -}}
|
|
<button :aria-pressed="lang === '{{ $lang }}'"
|
|
@click.prevent="lang = '{{ $lang }}'">{{ $lang }}</button>
|
|
{{- end }}
|
|
</div>
|
|
{{ range $lang, $input := . -}}
|
|
<label x-cloak x-show="lang === '{{ $lang }}'"><span>{{ $lang }}</span><br>
|
|
<textarea class="html"
|
|
name="{{ $input.Name }}" {{ template "error-attrs" . }}>{{ $input.Val }}</textarea><br>
|
|
</label>
|
|
{{- end }}
|
|
{{ template "error-message" . }}
|
|
</fieldset>
|
|
{{- end }}
|
|
{{ with .MapEmbed -}}
|
|
<label>
|
|
{{( pgettext "Map Embed" "input")}}<br>
|
|
<textarea name="{{ .Name }}" {{ template "error-attrs" . }}>{{ .Val }}</textarea><br>
|
|
{{ template "error-message" . }}
|
|
</label>
|
|
{{- end }}
|
|
</fieldset>
|
|
<footer>
|
|
<button type="submit">{{( pgettext "Save changes" "action" )}}</button>
|
|
</footer>
|
|
</form>
|
|
{{- end }}
|