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

46 lines
1.7 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 "Campsite Type Features" "title" )}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.featureIndex*/ -}}
<a href="/admin/campsites/types/{{ .TypeSlug }}/features/new">{{( pgettext "Add Feature" "action" )}}</a>
<h2>{{( pgettext "Campsite Type Features" "title" )}}</h2>
{{ if .Features -}}
2023-12-21 16:33:01 +00:00
<form id="feature-index"
class="sortable"
data-hx-post="/admin/campsites/types/{{ .TypeSlug }}/features/order"
data-hx-trigger="end"
data-hx-select="#feature-index"
data-hx-swap="outerHTML"
>
{{ CSRFInput }}
<table class="services">
<thead>
<tr>
2023-12-21 16:33:01 +00:00
<th scope="col" style="width: 1.5em"></th>
<th scope="col">{{( pgettext "Name" "header" )}}</th>
</tr>
2023-12-21 16:33:01 +00:00
</thead>
<tbody>
{{ range .Features -}}
<tr>
<td>
<span class="handle"></span>
<input type="hidden" name="feature_id" value="{{ .ID }}">
</td>
<td class="icon_{{ .Icon }}"><a href="{{ .URL }}">{{ .Name }}</a></td>
</tr>
{{- end }}
</tbody>
</table>
</form>
{{ else -}}
<p>{{( gettext "No campsite type features added yet." )}}</p>
{{- end }}
{{- end }}