2023-10-13 18:30:31 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
{{ define "title" -}}
|
2024-01-26 21:27:54 +00:00
|
|
|
{{( pgettext "Campsite Features" "title" )}}
|
2023-10-13 18:30:31 +00:00
|
|
|
{{- end }}
|
|
|
|
|
2024-01-21 21:44:04 +00:00
|
|
|
{{ define "breadcrumb" -}}
|
|
|
|
<li><a href="/admin/campsites">{{( pgettext "Campsites" "title" )}}</a></li>
|
|
|
|
{{- end }}
|
|
|
|
|
2023-10-13 18:30:31 +00:00
|
|
|
{{ define "content" -}}
|
2024-01-26 21:27:54 +00:00
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite.featureIndex*/ -}}
|
|
|
|
<a href="/admin/campsites/{{ .Label }}/features/new">{{( pgettext "Add Feature" "action" )}}</a>
|
|
|
|
<h2>{{ template "title" . }}</h2>
|
2023-10-13 18:30:31 +00:00
|
|
|
{{ if .Features -}}
|
2023-12-21 16:33:01 +00:00
|
|
|
<form id="feature-index"
|
|
|
|
class="sortable"
|
2024-01-26 21:27:54 +00:00
|
|
|
data-hx-post="/admin/campsites/{{ .Label }}/features/order"
|
2023-12-21 16:33:01 +00:00
|
|
|
data-hx-trigger="end"
|
|
|
|
data-hx-select="#feature-index"
|
|
|
|
data-hx-swap="outerHTML"
|
|
|
|
>
|
|
|
|
{{ CSRFInput }}
|
|
|
|
<table class="services">
|
|
|
|
<thead>
|
2023-10-13 18:30:31 +00:00
|
|
|
<tr>
|
2023-12-21 16:33:01 +00:00
|
|
|
<th scope="col" style="width: 1.5em"></th>
|
|
|
|
<th scope="col">{{( pgettext "Name" "header" )}}</th>
|
2024-01-26 21:27:54 +00:00
|
|
|
<th scope="col">{{( pgettext "Actions" "header" )}}</th>
|
2023-10-13 18:30:31 +00:00
|
|
|
</tr>
|
2023-12-21 16:33:01 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-01-26 21:54:19 +00:00
|
|
|
{{ $confirm := (gettext "Are you sure you wish to delete this feature?")}}
|
2023-12-21 16:33:01 +00:00
|
|
|
{{ 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>
|
2024-01-26 21:27:54 +00:00
|
|
|
<td>
|
|
|
|
<button data-hx-delete="{{ .URL }}"
|
|
|
|
data-hx-confirm="{{ $confirm }}"
|
|
|
|
data-hx-headers='{ {{ CSRFHeader }} }'>
|
|
|
|
{{( pgettext "Delete" "action" )}}
|
|
|
|
</button>
|
|
|
|
</td>
|
2023-12-21 16:33:01 +00:00
|
|
|
</tr>
|
|
|
|
{{- end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</form>
|
2023-10-13 18:30:31 +00:00
|
|
|
{{ else -}}
|
2024-01-26 21:27:54 +00:00
|
|
|
<p>{{( gettext "No campsite features added yet." )}}</p>
|
2023-10-13 18:30:31 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|