Better Akteure Logik

This commit is contained in:
Simon Martens
2025-09-22 22:27:06 +02:00
parent 9268402ebf
commit b579539e66
18 changed files with 495 additions and 435 deletions

View 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>

View 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>

View 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>