2023-10-12 14:33:45 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
{{ define "title" -}}
|
|
|
|
{{( pgettext "Campsite Type Carousel" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "content" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.carouselIndex*/ -}}
|
|
|
|
<h2>{{( pgettext "Campsite Type Carousel" "title" )}}</h2>
|
|
|
|
<a href="/admin/campsites/types/{{ .TypeSlug }}/slides/new">{{( pgettext "Add slide" "action" )}}</a>
|
|
|
|
{{ if .Slides -}}
|
2023-12-20 18:52:14 +00:00
|
|
|
<form id="slide-index"
|
|
|
|
class="sortable"
|
|
|
|
data-hx-post="/admin/campsites/types/{{ .TypeSlug }}/slides/order"
|
|
|
|
data-hx-trigger="end"
|
|
|
|
data-hx-select="#slide-index"
|
|
|
|
data-hx-swap="outerHTML"
|
|
|
|
>
|
|
|
|
{{ CSRFInput }}
|
|
|
|
<table>
|
|
|
|
<thead>
|
2023-10-12 14:33:45 +00:00
|
|
|
<tr>
|
2023-12-20 18:52:14 +00:00
|
|
|
<th scope="col">{{( pgettext "Image" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Caption" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Actions" "header" )}}</th>
|
2023-10-12 14:33:45 +00:00
|
|
|
</tr>
|
2023-12-20 18:52:14 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ $confirm := (gettext "Are you sure you wish to delete this slide?")}}
|
|
|
|
{{ range $slide := .Slides -}}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<span class="handle"></span>
|
|
|
|
<input type="hidden" name="media_id" value="{{ .ID }}">
|
|
|
|
<a href="/admin/campsites/types/{{ $.TypeSlug }}/slides/{{ .ID }}"><img src="{{ .Media }}"
|
|
|
|
alt=""></a>
|
|
|
|
</td>
|
|
|
|
<td><a href="/admin/campsites/types/{{ $.TypeSlug }}/slides/{{ .ID }}">{{ .Caption }}</a></td>
|
|
|
|
<td>
|
2024-01-16 17:32:02 +00:00
|
|
|
<button data-hx-delete="/admin/campsites/types/{{ $.TypeSlug }}/slides/{{ .ID }}"
|
|
|
|
data-hx-confirm="{{ $confirm }}"
|
|
|
|
data-hx-headers='{ {{ CSRFHeader }} }'>
|
|
|
|
{{( pgettext "Delete" "action" )}}
|
|
|
|
</button>
|
2023-12-20 18:52:14 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{- end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</form>
|
2023-10-12 14:33:45 +00:00
|
|
|
{{ else -}}
|
|
|
|
<p>{{( gettext "No slides added yet." )}}</p>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|