FIX: pages load with indexed map[string]any, page edit page

This commit is contained in:
Simon Martens
2026-01-14 17:56:28 +01:00
parent 941ecbecaf
commit 3732b128db
12 changed files with 564 additions and 3 deletions

View File

@@ -0,0 +1,43 @@
{{ $model := . }}
<div class="flex container-normal bg-slate-100 mx-auto px-8">
<div class="flex flex-row w-full justify-between">
<div class="flex flex-col justify-end-safe flex-2/5">
<div class="mb-1">
<i class="ri-pages-line"></i> Seiten
</div>
<h1 class="text-2xl w-full font-bold text-slate-900 mb-1">
Seiteneditor
</h1>
</div>
<div class="flex flex-col justify-end gap-y-4 pr-4">
<div class="inputwrapper !mb-0">
<div class="inputlabelrow">
<label for="page-editor-select" class="inputlabel">Seite auswählen</label>
</div>
<select
id="page-editor-select"
name="key"
class="inputinput"
hx-get="/redaktion/seiten/form/"
hx-trigger="change"
hx-target="#page-editor-form"
hx-swap="outerHTML"
hx-indicator="body">
{{- if $model.pages -}}
{{- range $page := $model.pages -}}
<option value="{{ $page.Key }}" {{ if eq $page.Key $model.selected_key }}selected{{ end }}>{{ $page.Title }}</option>
{{- end -}}
{{- else -}}
<option value="">Keine Seiten gefunden</option>
{{- end -}}
</select>
</div>
</div>
</div>
</div>
<div class="container-normal mx-auto mt-4 !px-0">
{{ template "_page_form" $model }}
</div>