camper/web/templates/admin/campsite/index.gohtml

36 lines
1.2 KiB
Plaintext
Raw Normal View History

<!--
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
SPDX-License-Identifier: AGPL-3.0-only
-->
{{ define "title" -}}
{{( pgettext "Campsites" "title" )}}
{{- 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>
{{ 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/{{ .Slug }}">{{ .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 }}
{{- end }}