<!--
 SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
 SPDX-License-Identifier: AGPL-3.0-only
-->
{{ define "title" -}}
    {{( pgettext "Location Settings" "title" )}}
{{- end }}

{{ define "breadcrumb" -}}
{{- 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  {{ template "init-lang" . }}>
            {{ with .Directions -}}
                <fieldset>
                    <legend>{{( pgettext "Directions" "input" )}}</legend>
                    {{ template "lang-selector" . }}
                    {{ 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>
                    {{ template "lang-selector" . }}
                    {{ 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 }}
