Page target navigation

This commit is contained in:
Simon Martens
2025-09-19 16:41:00 +02:00
parent 04d62d9e67
commit 2574124588
22 changed files with 1582 additions and 203 deletions

View File

@@ -28,10 +28,11 @@
{{ end }}</span
>
<a
href="#page-{{ $page }}"
class="page-number-inhalts font-bold text-slate-700 bg-slate-100 px-2 py-1 rounded text-sm transition-colors duration-200 hover:bg-slate-200 no-underline"
href="/{{ $model.Year }}/{{ $model.Number.No }}/{{ $page }}"
class="page-number-inhalts font-bold text-slate-700 bg-slate-100 px-2 py-1 rounded text-sm transition-colors duration-200 hover:bg-slate-200 no-underline relative"
data-page-number="{{ $page }}">
<span class="page-label">{{ $page }}</span>
{{ template "_page_link_indicator" (dict "pageNumber" $page "targetPage" $.targetPage) }}
</a>
</div>
<button
@@ -73,21 +74,38 @@
{{ end }}">
<span class="text-black text-xs font-bold">{{ add $index 1 }}</span>
<span class="w-px h-3 bg-slate-300 mx-1"></span>
<span class="{{- if and (eq $issue.Nr $model.Number.No) (eq $issue.When.Year $model.Datum.When.Year) -}}
text-red-700 pointer-events-none
{{ end }}"
{{- if and (eq $issue.Nr $model.Number.No) (eq $issue.When.Year
$model.Datum.When.Year)
-}}
aria-current="page"
{{ end }}>
<span
class="{{- if and (eq $issue.Nr $model.Number.No) (eq $issue.When.Year $model.Datum.When.Year) -}}
text-red-700 pointer-events-none
{{ end }}"
{{- if and (eq $issue.Nr $model.Number.No) (eq $issue.When.Year
$model.Datum.When.Year)
-}}
aria-current="page"
{{ end }}>
{{ template "_citation" $issue }}
</span>
</div>
{{ end }}
<!-- Link zum gesamten Beitrag anzeigen -->
{{ if and (not $individualPiece.PieceByIssue.IsContinuation) (gt (len $individualPiece.IssueRefs) 1) }}
<div
class="inline-flex items-center gap-1 px-2 py-1 bg-blue-50
hover:bg-blue-100 text-blue-700 hover:text-blue-800 border border-blue-200
hover:border-blue-300 rounded text-xs font-medium transition-colors
duration-200">
<i class="ri-file-copy-2-line text-xs"></i>
<a
href="{{ GetPieceURL $individualPiece.PieceByIssue.Reference.When.Year $individualPiece.PieceByIssue.Reference.Nr $individualPiece.PieceByIssue.Reference.Von }}"
class="">
Alle
</a>
</div>
{{ end }}
</div>
</div>
{{ end }}
</div>
{{ end }}
{{ else }}
@@ -191,21 +209,38 @@
{{ end }}">
<span class="text-black text-xs font-bold">{{ add $index 1 }}</span>
<span class="w-px h-3 bg-slate-300 mx-1"></span>
<span class="{{- if and (eq $issue.Nr $model.Number.No) (eq $issue.When.Year $model.Datum.When.Year) -}}
text-red-700 pointer-events-none
{{ end }}"
{{- if and (eq $issue.Nr $model.Number.No) (eq $issue.When.Year
$model.Datum.When.Year)
-}}
aria-current="page"
{{ end }}>
<span
class="{{- if and (eq $issue.Nr $model.Number.No) (eq $issue.When.Year $model.Datum.When.Year) -}}
text-red-700 pointer-events-none
{{ end }}"
{{- if and (eq $issue.Nr $model.Number.No) (eq $issue.When.Year
$model.Datum.When.Year)
-}}
aria-current="page"
{{ end }}>
{{ template "_citation" $issue }}
</span>
</div>
{{ end }}
<!-- Link zum gesamten Beitrag anzeigen -->
{{ if and (not $individualPiece.PieceByIssue.IsContinuation) (gt (len $individualPiece.IssueRefs) 1) }}
<div
class="inline-flex items-center gap-1 px-2 py-1 bg-blue-50
hover:bg-blue-100 text-blue-700 hover:text-blue-800 border border-blue-200
hover:border-blue-300 rounded text-xs font-medium transition-colors
duration-200">
<i class="ri-file-copy-2-line text-xs"></i>
<a
href="{{ GetPieceURL $individualPiece.PieceByIssue.Reference.When.Year $individualPiece.PieceByIssue.Reference.Nr $individualPiece.PieceByIssue.Reference.Von }}"
class="">
Alle
</a>
</div>
{{ end }}
</div>
</div>
{{ end }}
</div>
{{ end }}
{{ else }}

View File

@@ -1,508 +0,0 @@
{{- $piece := . -}}
{{- $fortsPrefix := "" -}}
{{- if $piece.IsContinuation -}}
{{- $fortsPrefix = "<span class=\"italic text-gray-600\">(Forts.) </span>" -}}
{{- end -}}
<div class="entry-description leading-snug mb-1">
{{- $hasRezension := false -}}
{{- $hasWeltnachrichten := false -}}
{{- $hasEinkommendeFremde := false -}}
{{- $hasWechselkurse := false -}}
{{- $hasBuecher := false -}}
{{- $hasLokalanzeigen := false -}}
{{- $hasLokalnachrichten := false -}}
{{- $hasLotterie := false -}}
{{- $hasGedicht := false -}}
{{- $hasVorladung := false -}}
{{- $hasAuszug := false -}}
{{- $hasAufsatz := false -}}
{{- $hasGelehrteNachrichten := false -}}
{{- $hasTheaterkritik := false -}}
{{- $hasUebersetzung := false -}}
{{- $hasKommentar := false -}}
{{- $hasNachruf := false -}}
{{- $hasReplik := false -}}
{{- $hasProklamation := false -}}
{{- $hasIneigenersache := false -}}
{{- $hasBrief := false -}}
{{- $hasAnzeige := false -}}
{{- $hasDesertionsliste := false -}}
{{- $hasNotenblatt := false -}}
{{- $hasVorlesungsverzeichnis := false -}}
{{- $hasErzaehlung := false -}}
{{- $hasNachtrag := false -}}
{{- $hasPanegyrik := false -}}
{{- $hasKriminalanzeige := false -}}
{{- $hasAbbildung := false -}}
{{- $hasRezepte := false -}}
{{- $hasKorrektur := false -}}
{{- range $catref := $piece.CategoryRefs -}}
{{- if eq $catref.Ref "rezension" -}}{{- $hasRezension = true -}}{{- end -}}
{{- if eq $catref.Ref "weltnachrichten" -}}{{- $hasWeltnachrichten = true -}}{{- end -}}
{{- if eq $catref.Ref "einkommende-fremde" -}}{{- $hasEinkommendeFremde = true -}}{{- end -}}
{{- if eq $catref.Ref "wechselkurse" -}}{{- $hasWechselkurse = true -}}{{- end -}}
{{- if eq $catref.Ref "buecher" -}}{{- $hasBuecher = true -}}{{- end -}}
{{- if eq $catref.Ref "lokalanzeigen" -}}{{- $hasLokalanzeigen = true -}}{{- end -}}
{{- if eq $catref.Ref "lokalnachrichten" -}}{{- $hasLokalnachrichten = true -}}{{- end -}}
{{- if eq $catref.Ref "lotterie" -}}{{- $hasLotterie = true -}}{{- end -}}
{{- if eq $catref.Ref "gedicht" -}}{{- $hasGedicht = true -}}{{- end -}}
{{- if eq $catref.Ref "vorladung" -}}{{- $hasVorladung = true -}}{{- end -}}
{{- if eq $catref.Ref "auszug" -}}{{- $hasAuszug = true -}}{{- end -}}
{{- if eq $catref.Ref "aufsatz" -}}{{- $hasAufsatz = true -}}{{- end -}}
{{- if eq $catref.Ref "gelehrte-nachrichten" -}}
{{- $hasGelehrteNachrichten = true -}}
{{- end -}}
{{- if eq $catref.Ref "theaterkritik" -}}{{- $hasTheaterkritik = true -}}{{- end -}}
{{- if eq $catref.Ref "uebersetzung" -}}{{- $hasUebersetzung = true -}}{{- end -}}
{{- if eq $catref.Ref "kommentar" -}}{{- $hasKommentar = true -}}{{- end -}}
{{- if eq $catref.Ref "nachruf" -}}{{- $hasNachruf = true -}}{{- end -}}
{{- if eq $catref.Ref "replik" -}}{{- $hasReplik = true -}}{{- end -}}
{{- if eq $catref.Ref "proklamation" -}}{{- $hasProklamation = true -}}{{- end -}}
{{- if eq $catref.Ref "ineigenersache" -}}{{- $hasIneigenersache = true -}}{{- end -}}
{{- if eq $catref.Ref "brief" -}}{{- $hasBrief = true -}}{{- end -}}
{{- if eq $catref.Ref "anzeige" -}}{{- $hasAnzeige = true -}}{{- end -}}
{{- if eq $catref.Ref "desertionsliste" -}}{{- $hasDesertionsliste = true -}}{{- end -}}
{{- if eq $catref.Ref "notenblatt" -}}{{- $hasNotenblatt = true -}}{{- end -}}
{{- if eq $catref.Ref "vorlesungsverzeichnis" -}}
{{- $hasVorlesungsverzeichnis = true -}}
{{- end -}}
{{- if eq $catref.Ref "erzaehlung" -}}{{- $hasErzaehlung = true -}}{{- end -}}
{{- if eq $catref.Ref "nachtrag" -}}{{- $hasNachtrag = true -}}{{- end -}}
{{- if eq $catref.Ref "panegyrik" -}}{{- $hasPanegyrik = true -}}{{- end -}}
{{- if eq $catref.Ref "kriminalanzeige" -}}{{- $hasKriminalanzeige = true -}}{{- end -}}
{{- if eq $catref.Ref "abbildung" -}}{{- $hasAbbildung = true -}}{{- end -}}
{{- if eq $catref.Ref "rezepte" -}}{{- $hasRezepte = true -}}{{- end -}}
{{- if eq $catref.Ref "korrektur" -}}{{- $hasKorrektur = true -}}{{- end -}}
{{- end -}}
{{- range $workref := $piece.WorkRefs -}}
{{- $kat := $workref.Category -}}
{{- if not $kat -}}{{- $kat = "rezension" -}}{{- end -}}
{{- if eq $kat "rezension" -}}{{- $hasRezension = true -}}{{- end -}}
{{- if eq $kat "auszug" -}}{{- $hasAuszug = true -}}{{- end -}}
{{- if eq $kat "theaterkritik" -}}{{- $hasTheaterkritik = true -}}{{- end -}}
{{- if eq $kat "uebersetzung" -}}{{- $hasUebersetzung = true -}}{{- end -}}
{{- if eq $kat "kommentar" -}}{{- $hasKommentar = true -}}{{- end -}}
{{- if eq $kat "anzeige" -}}{{- $hasAnzeige = true -}}{{- end -}}
{{- if eq $kat "replik" -}}{{- $hasReplik = true -}}{{- end -}}
{{- end -}}
{{- $place := "" -}}
{{- if $piece.PlaceRefs -}}
{{- $placeObj := GetPlace (index $piece.PlaceRefs 0).Ref -}}
{{- if gt (len $placeObj.Names) 0 -}}
{{- $place = index $placeObj.Names 0 -}}
{{- end -}}
{{- end -}}
{{- $title := "" -}}
{{- if $piece.Title -}}
{{- $title = index $piece.Title 0 -}}
{{- else if $piece.Incipit -}}
{{- $title = index $piece.Incipit 0 -}}
{{- end -}}
{{- $workTitle := "" -}}
{{- $workTitleFull := "" -}}
{{- $workAuthorName := "" -}}
{{- $workAuthorID := "" -}}
{{- if $piece.WorkRefs -}}
{{- $work := GetWork (index $piece.WorkRefs 0).Ref -}}
{{- /* Determine short title (PreferredTitle) and full title (Citation.Title) */ -}}
{{- if $work.PreferredTitle -}}
{{- $workTitle = $work.PreferredTitle -}}
{{- else if $work.Citation.Title -}}
{{- $workTitle = $work.Citation.Title -}}
{{- else if $work.Citation.Chardata -}}
{{- $workTitle = $work.Citation.Chardata -}}
{{- end -}}
{{- /* Always get full title for highlighted state */ -}}
{{- if $work.Citation.Title -}}
{{- $workTitleFull = $work.Citation.Title -}}
{{- else if $work.Citation.Chardata -}}
{{- $workTitleFull = $work.Citation.Chardata -}}
{{- else if $work.PreferredTitle -}}
{{- $workTitleFull = $work.PreferredTitle -}}
{{- end -}}
{{- /* Get work author */ -}}
{{- if $work.AgentRefs -}}
{{- range $workAgentRef := $work.AgentRefs -}}
{{- if (or (eq $workAgentRef.Category "") (eq $workAgentRef.Category "autor")) -}}
{{- $workAgent := GetAgent $workAgentRef.Ref -}}
{{- if and $workAgent (gt (len $workAgent.Names) 0) -}}
{{- $workAuthorName = index $workAgent.Names 0 -}}
{{- $workAuthorID = $workAgentRef.Ref -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- /* Generate natural text descriptions */ -}}
{{- if $hasRezension -}}
{{- $authorFound := false -}}
{{- range $agentref := $piece.AgentRefs -}}
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
{{- $agent := GetAgent $agentref.Ref -}}
{{- if and $agent (gt (len $agent.Names) 0) -}}
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600"
>{{ index $agent.Names 0 }}</a
>,
<span class="review-format"
>Rezension von:
{{ if $workAuthorName }}
{{- if $workAuthorID -}}
<a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>
{{- else -}}
{{ $workAuthorName }}
{{- end -}},
{{ end }}
{{ if $workTitle }}
<em
class="work-title"
data-short-title="{{ $workTitle }}"
{{ if $workTitleFull }}data-full-title="{{ $workTitleFull }}"{{ end }}
>{{ $workTitle }}</em
>
{{ else if $title }}
<em>{{ $title }}</em>
{{ else }}
[Werk unbekannt]
{{ end }}</span
>{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- $authorFound = true -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if not $authorFound -}}
{{ Safe $fortsPrefix }}<span class="review-format"
>Rezension von:
{{ if $workAuthorName }}
{{- if $workAuthorID -}}
<a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>
{{- else -}}
{{ $workAuthorName }}
{{- end -}},
{{ end }}
{{ if $workTitle }}
<em
class="work-title"
data-short-title="{{ $workTitle }}"
{{ if $workTitleFull }}data-full-title="{{ $workTitleFull }}"{{ end }}
>{{ $workTitle }}</em
>
{{ else if $title }}
<em>{{ $title }}</em>
{{ else }}
[Werk unbekannt]
{{ end }}</span
>{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- end -}}
{{- else if $hasWeltnachrichten -}}
{{ Safe $fortsPrefix }}Politische Nachrichten aus aller Welt
{{- else if $hasEinkommendeFremde -}}
{{- if $hasLokalnachrichten -}}
Lokale Meldungen über einreisende Fremde
{{- else if $hasNachruf -}}
Nachruf und Einreiseliste
{{- else -}}
Einreiseliste
{{- end -}}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasWechselkurse -}}
Wechselkurse{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasBuecher -}}
Bücheranzeigen{{ if $title }}: <em>{{ $title }}</em>{{ end }}
{{- else if $hasLokalanzeigen -}}
{{ if $hasNachruf }}
Todesanzeige
{{ else }}
Lokalanzeige
{{ end }}{{ if $title }}: <em>{{ $title }}</em>{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasLokalnachrichten -}}
{{ if $hasLotterie }}
Lotterienachrichten
{{ else if $hasNachruf }}
Nachrufe
{{ else if $hasTheaterkritik }}
Theaternachrichten
{{ else if $hasPanegyrik }}
Festlichkeiten
{{ else }}
Lokalnachrichten
{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasGedicht -}}
{{- $authorFound := false -}}
{{- range $agentref := $piece.AgentRefs -}}
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
{{- $agent := GetAgent $agentref.Ref -}}
{{- if and $agent (gt (len $agent.Names) 0) -}}
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a>,
{{ if $hasKommentar }}
Gedicht mit Kommentar
{{ else if $hasUebersetzung }}
Gedichtübersetzung
{{ else if $hasGelehrteNachrichten }}
Gedicht zu gelehrten Angelegenheiten
{{ else }}
Gedicht
{{ end }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
{{- $authorFound = true -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if not $authorFound -}}
{{ Safe $fortsPrefix }}{{ if $hasKommentar }}
Gedicht mit Kommentar
{{ else if $hasUebersetzung }}
Gedichtübersetzung
{{ else if $hasGelehrteNachrichten }}
Gedicht zu gelehrten Angelegenheiten
{{ else }}
Gedicht
{{ end }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
{{- end -}}
{{- else if $hasVorladung -}}
Gerichtliche Vorladung{{ if $title }}: <em>{{ $title }}</em>{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasAufsatz -}}
{{- $authorFound := false -}}
{{- range $agentref := $piece.AgentRefs -}}
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
{{- $agent := GetAgent $agentref.Ref -}}
{{- if and $agent (gt (len $agent.Names) 0) -}}
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600"
>{{ index $agent.Names 0 }}</a
>,
{{ if $hasReplik }}
Erwiderung
{{ else if $hasUebersetzung }}
Übersetzung
{{ else if $hasNachruf }}
Nachruf
{{ else if $hasKommentar }}
Kommentar
{{ else if $hasRezepte }}
Rezepte und Anleitungen
{{ else }}
Aufsatz
{{ end }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
{{- $authorFound = true -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if not $authorFound -}}
{{ Safe $fortsPrefix }}{{ if $hasReplik }}
Erwiderung
{{ else if $hasUebersetzung }}
Übersetzung
{{ else if $hasNachruf }}
Nachruf
{{ else if $hasKommentar }}
Kommentar
{{ else if $hasRezepte }}
Rezepte und Anleitungen
{{ else }}
Aufsatz
{{ end }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
{{- end -}}
{{- else if $hasGelehrteNachrichten -}}
{{ Safe $fortsPrefix }}{{ if $hasTheaterkritik }}
Theaterkritik
{{ else if $hasKommentar }}
Gelehrter Kommentar
{{ else }}
Gelehrte Nachrichten
{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasTheaterkritik -}}
{{- $authorFound := false -}}
{{- range $agentref := $piece.AgentRefs -}}
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
{{- $agent := GetAgent $agentref.Ref -}}
{{- if and $agent (gt (len $agent.Names) 0) -}}
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600"
>{{ index $agent.Names 0 }}</a
>,
Theaterkritik{{ if $workTitle }}
zu <em>{{ $workTitle }}</em>{{ if $workAuthorName }}
von
<a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>
{{ end }}
{{ else if $title }}
zu <em>{{ $title }}</em>
{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- $authorFound = true -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if not $authorFound -}}
{{ Safe $fortsPrefix }}Theaterkritik{{ if $workTitle }}
zu <em>{{ $workTitle }}</em>{{ if $workAuthorName }}
von <a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>
{{ end }}
{{ else if $title }}
zu <em>{{ $title }}</em>
{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- end -}}
{{- else if $hasProklamation -}}
{{ Safe $fortsPrefix }}Amtliche
Proklamation{{ if $title }}: <em>{{ $title }}</em>{{ end }}
{{- else if $hasIneigenersache -}}
{{ Safe $fortsPrefix }}{{ if $hasKommentar }}
{{ if $hasNachtrag }}Ergänzender Kommentar{{ else }}Redaktioneller Kommentar{{ end }}
{{ else if $hasReplik }}
Redaktionelle Stellungnahme
{{ else }}
Anmerkung der Redaktion
{{ end }}
{{ if $title }}: <em>{{ $title }}</em>{{ end }}
{{- else if $hasBrief -}}
{{ Safe $fortsPrefix }}{{ if $hasNachruf }}
Kondolenzbrief
{{ else }}
Leserbrief
{{ end }}
{{- $authorFound := false -}}{{- range $agentref := $piece.AgentRefs -}}
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
{{- $agent := GetAgent $agentref.Ref -}}{{- if and $agent (gt (len $agent.Names) 0) -}}
von
<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a
>{{- $authorFound = true -}}{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasDesertionsliste -}}
{{ Safe $fortsPrefix }}Desertionsliste{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasNotenblatt -}}
{{ Safe $fortsPrefix }}{{ if $hasNachtrag }}Ergänztes{{ end }}Notenblatt{{ if $title }}
: <em>{{ $title }}</em>
{{ end }}
{{- else if $hasVorlesungsverzeichnis -}}
{{ Safe $fortsPrefix }}Vorlesungsverzeichnis{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasErzaehlung -}}
{{- $authorFound := false -}}
{{- range $agentref := $piece.AgentRefs -}}
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
{{- $agent := GetAgent $agentref.Ref -}}
{{- if and $agent (gt (len $agent.Names) 0) -}}
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600"
>{{ index $agent.Names 0 }}</a
>,
{{ if $hasUebersetzung }}
Übersetzung einer Erzählung
{{ else }}
Erzählung
{{ end }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
{{- $authorFound = true -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if not $authorFound -}}
{{ Safe $fortsPrefix }}{{ if $hasUebersetzung }}
Übersetzung einer Erzählung
{{ else }}
Erzählung
{{ end }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
{{- end -}}
{{- else if $hasAbbildung -}}
{{ Safe $fortsPrefix }}{{ if $hasAufsatz }}
Illustrierter Aufsatz
{{ else }}
Abbildung
{{ end }}
{{ if $title }}: <em>{{ $title }}</em>{{ end }}
{{- else if $hasKriminalanzeige -}}
{{ Safe $fortsPrefix }}Kriminalanzeige{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
{{- else if $hasKorrektur -}}
{{ Safe $fortsPrefix }}Korrektur{{ if $title }}: <em>{{ $title }}</em>{{ end }}
{{- else if $hasAnzeige -}}
{{ Safe $fortsPrefix }}{{ if $hasAuszug }}
{{ if $hasGedicht }}Gedichtauszug{{ else }}Textauszug{{ end }}
{{ else }}
Anzeige
{{ end }}
{{ if $title }}: <em>{{ $title }}</em>{{ end }}
{{- else if $hasAuszug -}}
{{ Safe $fortsPrefix }}{{ if $title }}<em>{{ $title }}</em>, {{ end }}{{ if $hasUebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ if $workAuthorName }}
<a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>, {{ end }}{{ if $workTitle }}<em
class="work-title"
data-short-title="{{ $workTitle }}"
{{ if $workTitleFull }}data-full-title="{{ $workTitleFull }}"{{ end }}
>{{ $workTitle }}</em>{{ else if $title }}<em>{{ $title }}</em>{{ else }}[Werk unbekannt]{{ end }}
{{- else -}}
{{- $authorFound := false -}}
{{- range $agentref := $piece.AgentRefs -}}
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
{{- $agent := GetAgent $agentref.Ref -}}
{{- if and $agent (gt (len $agent.Names) 0) -}}
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600"
>{{ index $agent.Names 0 }}</a
>{{ if $title }}: <em>{{ $title }}</em>{{ end }}{{ if $workTitle }}
{{ if $title }}, {{ if $hasUebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
<a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>, {{ end }}<em
class="work-title"
data-short-title="{{ $workTitle }}"
{{ if $workTitleFull }}data-full-title="{{ $workTitleFull }}"{{ end }}
>{{ $workTitle }}</em>
{{ end }}
{{- $authorFound = true -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if not $authorFound -}}
{{ Safe $fortsPrefix }}{{ if $title }}<em>{{ $title }}</em>{{ end }}{{ if $workTitle }}
{{ if $title }}, {{ if $hasUebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
<a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>, {{ end }}<em
class="work-title"
data-short-title="{{ $workTitle }}"
{{ if $workTitleFull }}data-full-title="{{ $workTitleFull }}"{{ end }}
>{{ $workTitle }}</em>
{{ else if not $title }}
Beitrag ohne Titel
{{ end }}
{{- end -}}
{{- end -}}
</div>
{{- if not $piece.IsContinuation -}}
{{- range $annotation := $piece.AnnotationNote.Annotations -}}
<div class="italic text-sm mt-0.5 text-slate-600">
{{ $annotation.Inner.InnerXML }}
</div>
{{- end -}}
{{- end -}}

View File

@@ -9,7 +9,7 @@
<!-- Historical printing layout grid -->
<div class="grid grid-cols-2 gap-4">
{{ template "_historical_layout" (dict "pages" $pages "pageCount" $pageCount "isBeilage" false) }}
{{ template "_historical_layout" (dict "pages" $pages "pageCount" $pageCount "isBeilage" false "targetPage" $.targetPage) }}
</div>
{{ end }}
@@ -27,7 +27,7 @@
<!-- Historical printing layout grid for Beilage -->
<div class="grid grid-cols-2 gap-4">
{{ template "_historical_layout" (dict "pages" $beilagePages "pageCount" $pageCount "isBeilage" true) }}
{{ template "_historical_layout" (dict "pages" $beilagePages "pageCount" $pageCount "isBeilage" true "targetPage" $.targetPage) }}
</div>
</div>
{{ end }}
@@ -56,50 +56,51 @@
{{ $pages := .pages }}
{{ $pageCount := .pageCount }}
{{ $isBeilage := .isBeilage }}
{{ $targetPage := .targetPage }}
{{ if eq $pageCount 2 }}
<!-- 2 pages: [1] [2] -->
{{ template "_render_page" (dict "page" (index $pages 0) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 1) "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 0) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 1) "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ else if eq $pageCount 4 }}
<!-- 4 pages: [1] [_] \n [2] [3] \n [_] [4] -->
{{ template "_render_page" (dict "page" (index $pages 0) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 0) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_empty" "" }}
{{ template "_render_page" (dict "page" (index $pages 1) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 2) "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 1) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 2) "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_empty" "" }}
{{ template "_render_page" (dict "page" (index $pages 3) "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 3) "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ else if eq $pageCount 6 }}
<!-- 6 pages: [1] [_] \n [2] [3] \n [_] [4] \n [5] [6] -->
{{ template "_render_page" (dict "page" (index $pages 0) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 0) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_empty" "" }}
{{ template "_render_page" (dict "page" (index $pages 1) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 2) "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 1) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 2) "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_empty" "" }}
{{ template "_render_page" (dict "page" (index $pages 3) "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 4) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 5) "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 3) "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 4) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 5) "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ else if eq $pageCount 8 }}
<!-- 8 pages: [1] [_] \n [2] [3] \n [4] [5] \n [6] [_] \n [_] [7] \n [8] [_] -->
{{ template "_render_page" (dict "page" (index $pages 0) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 0) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_empty" "" }}
{{ template "_render_page" (dict "page" (index $pages 1) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 2) "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 3) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 4) "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 5) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 1) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 2) "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 3) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 4) "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 5) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_empty" "" }}
{{ template "_render_empty" "" }}
{{ template "_render_page" (dict "page" (index $pages 6) "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 7) "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" (index $pages 6) "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_page" (dict "page" (index $pages 7) "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ template "_render_empty" "" }}
{{ else }}
<!-- Fallback: side by side layout for other page counts -->
{{ range $index, $page := $pages }}
{{ if eq (mod $index 2) 0 }}
{{ template "_render_page" (dict "page" $page "position" "left" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" $page "position" "left" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ else }}
{{ template "_render_page" (dict "page" $page "position" "right" "isBeilage" $isBeilage) }}
{{ template "_render_page" (dict "page" $page "position" "right" "isBeilage" $isBeilage "targetPage" $targetPage) }}
{{ end }}
{{ end }}
{{ end }}
@@ -110,21 +111,18 @@
{{ $page := .page }}
{{ $position := .position }}
{{ $isBeilage := .isBeilage }}
{{ $targetPage := .targetPage }}
{{ $isLeft := eq $position "left" }}
{{ $borderColor := "border-slate-200" }}
{{ $hoverColor := "hover:border-slate-300" }}
{{ $bgColor := "bg-blue-50" }}
{{ $idPrefix := "page" }}
{{ $linkPrefix := "" }}
{{ if $isBeilage }}
{{ $borderColor = "border-amber-200" }}
{{ $hoverColor = "hover:border-amber-300" }}
{{ $bgColor = "bg-amber-50" }}
{{ $idPrefix = "beilage-1-page" }}
{{ $linkPrefix = "#beilage-1-page-" }}
{{ else }}
{{ $linkPrefix = "#page-" }}
{{ end }}
<div class="newspaper-page-container" id="{{ $idPrefix }}-{{ $page.PageNumber }}" data-page-container="{{ $page.PageNumber }}"{{ if $isBeilage }} data-beilage="true"{{ end }}>
@@ -141,15 +139,17 @@
<button onclick="enlargePage(document.querySelector('#{{ $idPrefix }}-{{ $page.PageNumber }} .newspaper-page-image'), {{ $page.PageNumber }}, false)" class="w-6 h-6 bg-purple-100 hover:bg-purple-200 text-purple-700 border border-purple-300 rounded flex items-center justify-center transition-colors duration-200 cursor-pointer" title="Seite {{ $page.PageNumber }} vergrößern">
<i class="ri-zoom-in-line text-xs"></i>
</button>
<span class="page-indicator text-sm font-bold text-slate-600 {{ $bgColor }} px-2 py-1 rounded transition-all duration-300 shadow-sm flex items-center gap-1" data-page="{{ $page.PageNumber }}">
<span class="page-indicator text-sm font-bold text-slate-600 {{ $bgColor }} px-2 py-1 rounded transition-all duration-300 shadow-sm flex items-center gap-1 relative" data-page="{{ $page.PageNumber }}">
{{ $page.PageNumber }}
<i class="ri-file-text-line {{ if $isBeilage }}text-amber-600{{ else }}text-black{{ end }} text-sm scale-x-[-1]"></i>
{{ template "_page_link_indicator" (dict "pageNumber" $page.PageNumber "targetPage" $targetPage) }}
</span>
{{ else }}
<!-- Right page: page number then buttons -->
<span class="page-indicator text-sm font-bold text-slate-600 {{ $bgColor }} px-2 py-1 rounded transition-all duration-300 shadow-sm flex items-center gap-1" data-page="{{ $page.PageNumber }}">
<span class="page-indicator text-sm font-bold text-slate-600 {{ $bgColor }} px-2 py-1 rounded transition-all duration-300 shadow-sm flex items-center gap-1 relative" data-page="{{ $page.PageNumber }}">
<i class="ri-file-text-line {{ if $isBeilage }}text-amber-600{{ else }}text-black{{ end }} text-sm"></i>
{{ $page.PageNumber }}
{{ template "_page_link_indicator" (dict "pageNumber" $page.PageNumber "targetPage" $targetPage) }}
</span>
<button onclick="copyPagePermalink('{{ $page.PageNumber }}', this{{ if $isBeilage }}, true{{ end }})" class="w-6 h-6 bg-blue-100 hover:bg-blue-200 text-blue-700 border border-blue-300 rounded flex items-center justify-center transition-colors duration-200 cursor-pointer" title="Link zu Seite {{ $page.PageNumber }} kopieren">
<i class="ri-share-line text-xs"></i>