mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-12-16 12:05:30 +00:00
Better Akteure Logik
This commit is contained in:
14
views/routes/akteure/anonym/body.gohtml
Normal file
14
views/routes/akteure/anonym/body.gohtml
Normal file
@@ -0,0 +1,14 @@
|
||||
<div class="max-w-7xl mx-auto px-8 py-8">
|
||||
<div class="mb-10">
|
||||
<!-- Alphabet Navigation -->
|
||||
{{ template "_alphabet_nav" .model }}
|
||||
</div>
|
||||
|
||||
<!-- Single Column Layout - No Scrollspy -->
|
||||
<div class="bg-white px-6 py-6 rounded">
|
||||
{{ range $_, $id := $.model.Sorted }}
|
||||
{{ $a := index $.model.Agents $id }}
|
||||
{{ template "_akteur" $a }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
3
views/routes/akteure/anonym/head.gohtml
Normal file
3
views/routes/akteure/anonym/head.gohtml
Normal file
@@ -0,0 +1,3 @@
|
||||
<title>
|
||||
KGPZ – Anonyme Werke
|
||||
</title>
|
||||
20
views/routes/akteure/autoren/body.gohtml
Normal file
20
views/routes/akteure/autoren/body.gohtml
Normal file
@@ -0,0 +1,20 @@
|
||||
<div class="max-w-7xl mx-auto px-8 py-8">
|
||||
<div class="mb-10 2xl:mb-0">
|
||||
{{ template "_header_with_toggle" .model }}
|
||||
</div>
|
||||
|
||||
<!-- Two Column Layout: Scrollspy + Content -->
|
||||
<div class="flex gap-8">
|
||||
{{ template "_scrollspy_layout" .model }}
|
||||
|
||||
<!-- 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>
|
||||
@@ -1,104 +0,0 @@
|
||||
{{ if ne (len .model.Search) 1 }}
|
||||
{{ $agent := index $.model.Agents .model.Search }}
|
||||
{{ if not $agent }}
|
||||
<div class="max-w-7xl 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-7xl mx-auto px-8 py-8">
|
||||
<div class="bg-white px-6 py-6 rounded">
|
||||
<div class="mb-6">
|
||||
{{ if eq $agent.ID "anonym" }}
|
||||
<a href="/akteure/a" class="inline-flex items-center text-black hover:text-gray-700 transition-colors text-xl no-underline font-bold">
|
||||
<i class="ri-arrow-left-line mr-3 text-xl font-bold"></i>
|
||||
A
|
||||
</a>
|
||||
{{ else }}
|
||||
{{ $letter := Upper (FirstLetter $agent.ID) }}
|
||||
<a href="/akteure/{{ $letter }}" class="inline-flex items-center text-black hover:text-gray-700 transition-colors text-xl no-underline font-bold">
|
||||
<i class="ri-arrow-left-line mr-3 text-xl font-bold"></i>
|
||||
{{ $letter }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ template "_akteur" $agent }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ else }}
|
||||
<div class="max-w-7xl mx-auto px-8 py-8">
|
||||
<div class="mb-10 2xl:mb-0">
|
||||
<!-- Main header - hidden on 2xl+ screens when scrollspy is visible -->
|
||||
<div class="bg-white px-6 py-4 rounded mb-6 2xl:hidden">
|
||||
{{ if eq .model.Search "autoren" }}
|
||||
<h1 class="text-4xl font-bold text-gray-900 mb-2">Autor:innen</h1>
|
||||
<p class="text-gray-700">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">Verzeichnis aller in der Zeitung erwähnten Personen und Institutionen</p>
|
||||
{{ end }}
|
||||
|
||||
<!-- Integrated checkbox into header -->
|
||||
<div class="flex items-center gap-4 mt-4">
|
||||
<label class="inline-flex items-center">
|
||||
<input type="checkbox"
|
||||
class="form-checkbox h-5 w-5 text-red-600 focus:ring-red-500 focus:border-red-500 checked:bg-red-600 checked:border-red-600 rounded"
|
||||
{{ if eq .model.Search "autoren" }}checked{{ end }}
|
||||
autocomplete="off"
|
||||
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-gray-700">Nur Autor:innen anzeigen</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Alphabet Navigation - styled like year selector -->
|
||||
{{ if ne .model.Search "autoren" }}
|
||||
<div class="mb-6 w-full">
|
||||
<div class="bg-white px-6 py-4 rounded">
|
||||
<div class="mx-auto flex flex-row flex-wrap gap-x-6 gap-y-3 w-fit items-end leading-none justify-center">
|
||||
{{ range $_, $l := .model.AvailableLetters }}
|
||||
{{ if eq $l (Upper $.model.Search) }}
|
||||
<!-- This is the active letter -->
|
||||
<span class="no-underline leading-none !m-0 !p-0 text-4xl font-bold text-red-600 pointer-events-none" aria-current="true">{{ $l }}</span>
|
||||
{{ else }}
|
||||
<!-- This is an inactive letter -->
|
||||
<a href="/akteure/{{ $l }}" class="no-underline leading-none !m-0 !p-0 text-2xl font-medium text-gray-700 hover:text-red-600 transition-colors">{{ $l }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- Separator and Anonym link -->
|
||||
<span class="text-gray-400 text-2xl">|</span>
|
||||
{{ if eq $.model.Search "anonym" }}
|
||||
<span class="no-underline leading-none !m-0 !p-0 text-4xl font-bold text-red-600 pointer-events-none" aria-current="true">anonym</span>
|
||||
{{ else }}
|
||||
<a href="/akteure/anonym" class="no-underline leading-none !m-0 !p-0 text-2xl font-medium text-gray-700 hover:text-red-600 transition-colors">anonym</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<!-- Two Column Layout: Scrollspy + Content -->
|
||||
<div class="flex gap-8">
|
||||
|
||||
{{ template "_scrollspy_layout" .model }}
|
||||
|
||||
<!-- 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>
|
||||
{{ end }}
|
||||
23
views/routes/akteure/components/_alphabet_nav.gohtml
Normal file
23
views/routes/akteure/components/_alphabet_nav.gohtml
Normal file
@@ -0,0 +1,23 @@
|
||||
{{- /* Shared alphabet navigation component - A-Z letters plus anonym link */ -}}
|
||||
<div class="mb-6 w-full">
|
||||
<div class="bg-white px-6 py-4 rounded">
|
||||
<div class="mx-auto flex flex-row flex-wrap gap-x-6 gap-y-3 w-fit items-end leading-none justify-center">
|
||||
{{ range $_, $l := .AvailableLetters }}
|
||||
{{ if eq $l (Upper $.Search) }}
|
||||
<!-- This is the active letter -->
|
||||
<span class="no-underline leading-none !m-0 !p-0 text-4xl font-bold text-red-600 pointer-events-none" aria-current="true">{{ $l }}</span>
|
||||
{{ else }}
|
||||
<!-- This is an inactive letter -->
|
||||
<a href="/akteure/{{ $l }}" class="no-underline leading-none !m-0 !p-0 text-2xl font-medium text-gray-700 hover:text-red-600 transition-colors">{{ $l }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- Separator and Anonym link -->
|
||||
<span class="text-gray-400 text-2xl">|</span>
|
||||
{{ if eq $.Search "anonym" }}
|
||||
<span class="no-underline leading-none !m-0 !p-0 text-4xl font-bold text-red-600 pointer-events-none" aria-current="true">anonym</span>
|
||||
{{ else }}
|
||||
<a href="/akteure/anonym" class="no-underline leading-none !m-0 !p-0 text-2xl font-medium text-gray-700 hover:text-red-600 transition-colors">anonym</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
15
views/routes/akteure/components/_back_navigation.gohtml
Normal file
15
views/routes/akteure/components/_back_navigation.gohtml
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- /* Shared back navigation for individual person pages */ -}}
|
||||
<div class="mb-6">
|
||||
{{ if eq .ID "anonym" }}
|
||||
<a href="/akteure/a" class="inline-flex items-center text-black hover:text-gray-700 transition-colors text-xl no-underline font-bold">
|
||||
<i class="ri-arrow-left-line mr-3 text-xl font-bold"></i>
|
||||
A
|
||||
</a>
|
||||
{{ else }}
|
||||
{{ $letter := Upper (FirstLetter .ID) }}
|
||||
<a href="/akteure/{{ $letter }}" class="inline-flex items-center text-black hover:text-gray-700 transition-colors text-xl no-underline font-bold">
|
||||
<i class="ri-arrow-left-line mr-3 text-xl font-bold"></i>
|
||||
{{ $letter }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
25
views/routes/akteure/components/_header_with_toggle.gohtml
Normal file
25
views/routes/akteure/components/_header_with_toggle.gohtml
Normal file
@@ -0,0 +1,25 @@
|
||||
{{- /* Shared header with author toggle checkbox */ -}}
|
||||
<!-- Main header - hidden on 2xl+ screens when scrollspy is visible -->
|
||||
<div class="bg-white px-6 py-4 rounded mb-6 2xl:hidden">
|
||||
{{ if eq .Search "autoren" }}
|
||||
<h1 class="text-4xl font-bold text-gray-900 mb-2">Autor:innen</h1>
|
||||
<p class="text-gray-700">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">Verzeichnis aller in der Zeitung erwähnten Personen und Institutionen</p>
|
||||
{{ end }}
|
||||
|
||||
<!-- Integrated checkbox into header -->
|
||||
<div class="flex items-center gap-4 mt-4">
|
||||
<label class="inline-flex items-center">
|
||||
<input type="checkbox"
|
||||
class="form-checkbox h-5 w-5 text-red-600 focus:ring-red-500 focus:border-red-500 checked:bg-red-600 checked:border-red-600 rounded"
|
||||
{{ if eq .Search "autoren" }}checked{{ end }}
|
||||
autocomplete="off"
|
||||
hx-get="{{ if eq .Search "autoren" }}/akteure/a{{ else }}/akteure/autoren{{ end }}"
|
||||
hx-target="body"
|
||||
hx-push-url="true">
|
||||
<span class="ml-2 text-gray-700">Nur Autor:innen anzeigen</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,16 +0,0 @@
|
||||
<title>
|
||||
KGPZ –
|
||||
{{ if eq .model.Search "autoren" }}
|
||||
Autoren
|
||||
{{ else if ne (len .model.Search) 1 }}
|
||||
{{ $agent := index .model.Agents .model.Search }}
|
||||
{{ if $agent }}
|
||||
{{ index $agent.Names 0 }}
|
||||
{{ else }}
|
||||
Person nicht gefunden
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
Personen & Körperschaften:
|
||||
{{ Upper .model.Search }}
|
||||
{{ end }}
|
||||
</title>
|
||||
23
views/routes/akteure/letter/body.gohtml
Normal file
23
views/routes/akteure/letter/body.gohtml
Normal file
@@ -0,0 +1,23 @@
|
||||
<div class="max-w-7xl mx-auto px-8 py-8">
|
||||
<div class="mb-10 2xl:mb-0">
|
||||
{{ template "_header_with_toggle" .model }}
|
||||
|
||||
<!-- Alphabet Navigation -->
|
||||
{{ template "_alphabet_nav" .model }}
|
||||
</div>
|
||||
|
||||
<!-- Two Column Layout: Scrollspy + Content -->
|
||||
<div class="flex gap-8">
|
||||
{{ template "_scrollspy_layout" .model }}
|
||||
|
||||
<!-- 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>
|
||||
3
views/routes/akteure/letter/head.gohtml
Normal file
3
views/routes/akteure/letter/head.gohtml
Normal file
@@ -0,0 +1,3 @@
|
||||
<title>
|
||||
KGPZ – Personen & Körperschaften: {{ Upper .model.Search }}
|
||||
</title>
|
||||
18
views/routes/akteure/person/body.gohtml
Normal file
18
views/routes/akteure/person/body.gohtml
Normal file
@@ -0,0 +1,18 @@
|
||||
{{ $agent := index $.model.Agents .model.Search }}
|
||||
{{ if not $agent }}
|
||||
<div class="max-w-7xl 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-7xl mx-auto px-8 py-8">
|
||||
<div class="bg-white px-6 py-6 rounded">
|
||||
{{ template "_back_navigation" $agent }}
|
||||
{{ template "_akteur" $agent }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
9
views/routes/akteure/person/head.gohtml
Normal file
9
views/routes/akteure/person/head.gohtml
Normal file
@@ -0,0 +1,9 @@
|
||||
{{ $agent := index .model.Agents .model.Search }}
|
||||
<title>
|
||||
KGPZ –
|
||||
{{ if $agent }}
|
||||
{{ index $agent.Names 0 }}
|
||||
{{ else }}
|
||||
Person nicht gefunden
|
||||
{{ end }}
|
||||
</title>
|
||||
@@ -1,39 +0,0 @@
|
||||
<div class="max-w-7xl mx-auto px-8 py-8">
|
||||
<div class="mb-10 2xl:mb-0">
|
||||
<!-- Main header - hidden on 2xl+ screens when scrollspy is visible -->
|
||||
<div class="bg-white px-6 py-4 rounded mb-6 2xl:hidden">
|
||||
<h1 class="text-4xl font-bold text-gray-900 mb-2">Autor:innen</h1>
|
||||
<p class="text-gray-700">Personen, die Beiträge in der Zeitung verfasst haben</p>
|
||||
|
||||
<!-- Integrated checkbox into header -->
|
||||
<div class="flex items-center gap-4 mt-4">
|
||||
<label class="inline-flex items-center">
|
||||
<input type="checkbox"
|
||||
class="form-checkbox h-5 w-5 text-red-600 focus:ring-red-500 focus:border-red-500 checked:bg-red-600 checked:border-red-600 rounded"
|
||||
checked
|
||||
autocomplete="off"
|
||||
hx-get="/akteure/a"
|
||||
hx-target="body"
|
||||
hx-push-url="true">
|
||||
<span class="ml-2 text-gray-700">Nur Autor:innen anzeigen</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Two Column Layout: Scrollspy + Content -->
|
||||
<div class="flex gap-8">
|
||||
|
||||
{{ template "_scrollspy_layout" .model }}
|
||||
|
||||
<!-- 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>
|
||||
Reference in New Issue
Block a user