2023-10-06 11:26:01 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
{{ define "title" -}}
|
|
|
|
{{( pgettext "Campsite Type Options" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
2024-01-21 21:44:04 +00:00
|
|
|
{{ define "breadcrumb" -}}
|
|
|
|
<li><a href="/admin/campsites">{{( pgettext "Campsites" "title" )}}</a></li>
|
|
|
|
<li><a href="/admin/campsites/types">{{( pgettext "Campsite Types" "title" )}}</a></li>
|
|
|
|
{{- end }}
|
|
|
|
|
2023-10-06 11:26:01 +00:00
|
|
|
{{ define "content" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.optionIndex*/ -}}
|
|
|
|
<a href="/admin/campsites/types/{{ .TypeSlug }}/options/new">{{( pgettext "Add Option" "action" )}}</a>
|
|
|
|
<h2>{{( pgettext "Campsite Type Options" "title" )}}</h2>
|
|
|
|
{{ if .Options -}}
|
2023-12-20 18:52:14 +00:00
|
|
|
<form id="option-index"
|
|
|
|
class="sortable"
|
|
|
|
data-hx-post="/admin/campsites/types/{{ .TypeSlug }}/options/order"
|
|
|
|
data-hx-trigger="end"
|
|
|
|
data-hx-select="#option-index"
|
|
|
|
data-hx-swap="outerHTML"
|
|
|
|
>
|
|
|
|
{{ CSRFInput }}
|
|
|
|
<table>
|
|
|
|
<thead>
|
2023-10-06 11:26:01 +00:00
|
|
|
<tr>
|
2023-12-20 18:52:14 +00:00
|
|
|
<th scope="col">{{( pgettext "Name" "header" )}}</th>
|
2024-01-22 19:54:03 +00:00
|
|
|
<th scope="col">{{( pgettext "Actions" "header" )}}</th>
|
2023-10-06 11:26:01 +00:00
|
|
|
</tr>
|
2023-12-20 18:52:14 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-01-22 19:54:03 +00:00
|
|
|
{{ $confirm := (gettext "Are you sure you wish to delete this option?")}}
|
2023-12-20 18:52:14 +00:00
|
|
|
{{ range .Options -}}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<span class="handle"></span>
|
|
|
|
<input type="hidden" name="option_id" value="{{ .ID }}">
|
|
|
|
<a href="{{ .URL }}">{{ .Name }}</a>
|
|
|
|
</td>
|
2024-01-22 19:54:03 +00:00
|
|
|
<td>
|
|
|
|
<button data-hx-delete="{{ .URL }}"
|
|
|
|
data-hx-confirm="{{ $confirm }}"
|
|
|
|
data-hx-headers='{ {{ CSRFHeader }} }'>
|
|
|
|
{{( pgettext "Delete" "action" )}}
|
|
|
|
</button>
|
|
|
|
</td>
|
2023-12-20 18:52:14 +00:00
|
|
|
</tr>
|
|
|
|
{{- end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</form>
|
2023-10-06 11:26:01 +00:00
|
|
|
{{ else -}}
|
|
|
|
<p>{{( gettext "No campsite type options added yet." )}}</p>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|