48 lines
1.5 KiB
Plaintext
48 lines
1.5 KiB
Plaintext
<!--
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
{{ define "title" -}}
|
|
{{( pgettext "Campsites" "title" )}}
|
|
{{- end }}
|
|
|
|
{{ define "breadcrumb" -}}
|
|
{{- end }}
|
|
|
|
{{ define "content" -}}
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite.campsiteIndex*/ -}}
|
|
<a href="/admin/campsites/new">{{( pgettext "Add Campsite" "action" )}}</a>
|
|
<h2>{{( pgettext "Campsites" "title" )}}</h2>
|
|
<div id="campground_map">
|
|
{{ template "campground_map.svg" }}
|
|
</div>
|
|
{{ if .Campsites -}}
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">{{( pgettext "Label" "header" )}}</th>
|
|
<th scope="col">{{( pgettext "Type" "header" )}}</th>
|
|
<th scope="col">{{( pgettext "Active" "campsite" )}}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{ range .Campsites -}}
|
|
<tr>
|
|
<td><a href="/admin/campsites/{{ .Label }}">{{ .Label }}</a></td>
|
|
<td>{{ .Type }}</td>
|
|
<td>{{ if .Active }}{{( gettext "Yes" )}}{{ else }}{{( gettext "No" )}}{{ end }}</td>
|
|
</tr>
|
|
{{- end }}
|
|
</tbody>
|
|
</table>
|
|
{{ else -}}
|
|
<p>{{( gettext "No campsites added yet." )}}</p>
|
|
{{- end }}
|
|
|
|
<script type="module">
|
|
import {setupCampgroundMap} from "/static/camper.js?v=";
|
|
|
|
setupCampgroundMap(document.getElementById('campground_map'));
|
|
</script>
|
|
{{- end }}
|