2024-01-16 00:25:25 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
{{ define "title" -}}
|
|
|
|
{{( pgettext "Surroundings Page" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
2024-01-21 21:44:04 +00:00
|
|
|
{{ define "breadcrumb" -}}
|
|
|
|
{{- end }}
|
|
|
|
|
2024-01-16 00:25:25 +00:00
|
|
|
{{ define "content" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/surroundings.highlightIndex*/ -}}
|
|
|
|
<h2>{{( pgettext "Highlights" "title" )}}</h2>
|
|
|
|
<a href="/admin/surroundings/new">{{( pgettext "Add highlight" "action" )}}</a>
|
|
|
|
{{ if .Highlights -}}
|
|
|
|
<form id="highlight-index"
|
|
|
|
class="sortable"
|
|
|
|
data-hx-post="/admin/surroundings/order"
|
|
|
|
data-hx-trigger="end"
|
|
|
|
data-hx-select="#highlight-index"
|
|
|
|
data-hx-swap="outerHTML"
|
|
|
|
>
|
|
|
|
{{ CSRFInput }}
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">{{( pgettext "Image" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Name" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Actions" "header" )}}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ $confirm := ( gettext "Are you sure you wish to delete this highlight?" )}}
|
|
|
|
{{ range $highlight := .Highlights -}}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<span class="handle"></span>
|
|
|
|
<input type="hidden" name="highlight_id" value="{{ .ID }}">
|
|
|
|
<a href="{{ .URL }}"><img src="{{ .Media }}" alt=""></a>
|
|
|
|
</td>
|
|
|
|
<td><a href="{{ .URL }}">{{ .Name }}</a></td>
|
|
|
|
<td>
|
2024-01-16 17:32:02 +00:00
|
|
|
<button data-hx-delete="/admin/surroundings//{{ .ID }}"
|
|
|
|
data-hx-confirm="{{ $confirm }}"
|
|
|
|
data-hx-headers='{ {{ CSRFHeader }} }'>
|
|
|
|
{{( pgettext "Delete" "action" )}}
|
|
|
|
</button>
|
2024-01-16 00:25:25 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{- end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
{{ else -}}
|
|
|
|
<p>{{( gettext "No highlights added yet." )}}</p>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|