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" -}}
|
2024-01-26 21:27:54 +00:00
|
|
|
{{( pgettext "Campsite Carousel" "title" )}}
|
2023-10-12 14:33:45 +00:00
|
|
|
{{- end }}
|
|
|
|
|
2024-01-21 21:44:04 +00:00
|
|
|
{{ define "breadcrumb" -}}
|
|
|
|
<li><a href="/admin/campsites">{{( pgettext "Campsites" "title" )}}</a></li>
|
2024-04-19 09:29:43 +00:00
|
|
|
<li><a href="/admin/campsites/{{ .Label }}">{{( pgettext "Edit Campsite" "title" )}}</a></li>
|
2024-01-21 21:44:04 +00:00
|
|
|
{{- end }}
|
|
|
|
|
2023-10-12 14:33:45 +00:00
|
|
|
{{ define "content" -}}
|
2024-01-26 21:27:54 +00:00
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite.carouselIndex*/ -}}
|
|
|
|
<h2>{{ template "title" . }}</h2>
|
|
|
|
<a href="/admin/campsites/{{ .Label }}/slides/new">{{( pgettext "Add slide" "action" )}}</a>
|
2023-10-12 14:33:45 +00:00
|
|
|
{{ if .Slides -}}
|
2023-12-20 18:52:14 +00:00
|
|
|
<form id="slide-index"
|
|
|
|
class="sortable"
|
2024-01-26 21:27:54 +00:00
|
|
|
data-hx-post="/admin/campsites/{{ .Label }}/slides/order"
|
2023-12-20 18:52:14 +00:00
|
|
|
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 }}">
|
2024-01-26 21:27:54 +00:00
|
|
|
<a href="/admin/campsites/{{ $.Label }}/slides/{{ .ID }}"><img src="{{ .Media }}"
|
2023-12-20 18:52:14 +00:00
|
|
|
alt=""></a>
|
|
|
|
</td>
|
2024-01-26 21:27:54 +00:00
|
|
|
<td><a href="/admin/campsites/{{ $.Label }}/slides/{{ .ID }}">{{ .Caption }}</a></td>
|
2023-12-20 18:52:14 +00:00
|
|
|
<td>
|
2024-01-26 21:27:54 +00:00
|
|
|
<button data-hx-delete="/admin/campsites/{{ $.Label }}/slides/{{ .ID }}"
|
2024-01-16 17:32:02 +00:00
|
|
|
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 }}
|