Let's try separating content and alm info

This commit is contained in:
Simon Martens
2026-01-24 13:37:49 +01:00
parent 13a1f4fc3a
commit e7e547327b
7 changed files with 2091 additions and 1936 deletions

View File

@@ -60,6 +60,16 @@
{{ template "entrydata" $model }}
{{- if $model.result.Contents | len -}}
{{ template "contents" $model }}
{{- if $model.result.HasContents -}}
<div
id="almanachcontents"
hx-get="/almanach/{{ $model.result.Entry.MusenalmID }}/contents/{{- if $model.request.query -}}?{{- $model.request.query -}}{{- end -}}"
hx-trigger="load"
hx-target="this"
hx-swap="outerHTML"
hx-indicator="body">
<div class="container-oversize mt-8 pt-0">
<div class="flex justify-center text-sm text-stone-600">Inhalt lädt…</div>
</div>
</div>
{{- end -}}

View File

@@ -35,7 +35,7 @@
<div class="flex flex-row items-center justify-center ml-2.5">
<div class="block bg-stone-200 text-sm px-3 py-0.5 rounded mt-1">
<i class="ri-arrow-left-long-line"></i>
<a href="./" hx-target="#almanachcontents" hx-select="#almanachcontents" hx-swap="outerHTML show:none" hx-indicator="body"> Alle Beiträge anzeigen </a>
<a href="/almanach/{{ $model.result.Entry.MusenalmID }}/contents/" hx-target="#almanachcontents" hx-select="#almanachcontents" hx-swap="outerHTML show:none" hx-indicator="body"> Alle Beiträge anzeigen </a>
</div>
</div>
{{- end -}}

View File

@@ -16,7 +16,7 @@
{{ $isFra := false }}
{{ $isEng := false }}
{{- $hasContents := len $model.result.Contents -}}
{{- $hasContents := $model.result.HasContents -}}
<div class="container-oversize mt-12 pb-0 mb-0">

View File

@@ -0,0 +1,7 @@
{{ $model := . }}
{{- if $model.result.Contents | len -}}
{{ template "_contents" $model }}
{{- else -}}
<div id="almanachcontents"></div>
{{- end -}}