Files
kgpz_web/views/routes/akteure/body.gohtml
2025-09-21 13:58:56 +02:00

93 lines
3.5 KiB
Plaintext

{{ if ne (len .model.Search) 1 }}
{{ $agent := index $.model.Agents .model.Search }}
{{ if not $agent }}
<div class="max-w-6xl mx-auto px-8 py-8">
<div class="bg-red-50 border border-red-200 rounded-lg p-6">
<div class="flex items-center">
<i class="ri-error-warning-line text-red-600 text-2xl mr-3"></i>
<span class="text-red-800 text-lg">Person nicht gefunden: <strong>{{ .model.Search }}</strong></span>
</div>
</div>
</div>
{{ else }}
<div class="max-w-full mx-auto px-8 py-8">
<div class="mb-8">
{{ $letter := Upper (FirstLetter $agent.ID) }}
<a href="/akteure/{{ $letter }}" class="inline-flex items-center text-blue-600
hover:text-blue-800 transition-colors text-xl">
<i class="ri-arrow-left-line mr-3 text-xl"></i>
{{ $letter }}
</a>
</div>
<div>{{ template "_akteur" $agent }}</div>
</div>
{{ end }}
{{ else }}
<div class="max-w-full mx-auto px-8 py-8">
<div class="mb-10">
<div class="bg-slate-100 px-6 py-4 rounded-lg mb-6">
{{ if eq .model.Search "autoren" }}
<h1 class="text-4xl font-bold text-gray-900 mb-2">Autoren</h1>
<p class="text-gray-700 text-lg">Personen, die Beiträge in der Zeitung verfasst haben</p>
{{ else }}
<h1 class="text-4xl font-bold text-gray-900 mb-2">Personen & Körperschaften</h1>
<p class="text-gray-700 text-lg">Verzeichnis aller in der Zeitung erwähnten Personen und Institutionen</p>
{{ end }}
</div>
<div class="flex items-center gap-4 mb-6">
<label class="inline-flex items-center">
<input type="checkbox"
class="form-checkbox h-5 w-5 text-blue-600 rounded"
{{ if eq .model.Search "autoren" }}checked{{ end }}
hx-get="{{ if eq .model.Search "autoren" }}/akteure/a{{ else }}/akteure/autoren{{ end }}"
hx-target="body"
hx-push-url="true">
<span class="ml-2 text-lg text-gray-700">Nur Autoren anzeigen</span>
</label>
</div>
</div>
<!-- Alphabet Navigation -->
<div class="mb-10 p-6 bg-gray-50 rounded-lg">
<div class="flex flex-wrap gap-3">
{{ range $_, $l := .model.AvailableLetters }}
<a href="/akteure/{{ $l }}" class="inline-flex items-center justify-center w-10 h-10 bg-white border border-gray-300 rounded hover:bg-blue-50 hover:border-blue-300 font-medium text-gray-700 hover:text-blue-700 transition-colors text-lg">
{{ $l }}
</a>
{{ end }}
</div>
</div>
<!-- Two Column Layout: Scrollspy + Content -->
<div class="flex gap-8">
<!-- Scrollspy Navigation - Hidden on smaller screens, shown on 2xl+ -->
<div class="hidden 2xl:block w-96 flex-shrink-0">
<div class="sticky top-0 max-h-screen bg-white rounded py-4 h-full flex flex-col border-x-6 border-white">
<nav class="flex-1 overflow-y-auto overscroll-contain" id="scrollspy-nav">
{{ range $_, $id := .model.Sorted }}
{{ $a := index $.model.Agents $id }}
<a href="#author-{{ $id }}"
class="block px-2 py-0.5 text-lg text-gray-900 hover:bg-red-50 scrollspy-link
transition-colors no-underline box-content"
data-target="author-{{ $id }}">
{{ index $a.Names 0 }}
</a>
{{ end }}
</nav>
</div>
</div>
<!-- People List - Main Content -->
<div class="flex-1 space-y-6 bg-white">
{{ range $_, $id := .model.Sorted }}
{{ $a := index $.model.Agents $id }}
<div id="author-{{ $id }}" class="p-6 scroll-mt-8 author-section">
{{ template "_akteur" $a }}
</div>
{{ end }}
</div>
</div>
</div>
{{ end }}