- {{- /* Extract categories and authors from group key */ -}}
+ {{- /* Extract categories, authors, translators, and editors from group key */ -}}
{{- $keyParts := split $groupKey "|" -}}
{{- $categoryName := index $keyParts 0 -}}
{{- $authorPart := index $keyParts 1 -}}
+ {{- $translatorPart := "" -}}
+ {{- if gt (len $keyParts) 2 -}}
+ {{- $translatorPart = index $keyParts 2 -}}
+ {{- end -}}
+ {{- $editorPart := "" -}}
+ {{- if gt (len $keyParts) 3 -}}
+ {{- $editorPart = index $keyParts 3 -}}
+ {{- end -}}
{{- /* Use plural if multiple pieces grouped together */ -}}
{{- $displayCategory := $categoryName -}}
@@ -130,7 +158,39 @@
{{- $displayCategory = "Beiträge" -}}
{{- end -}}
{{- end -}}
- {{ $displayCategory }}{{- if ne $authorPart "" }} von {{ range $i, $authorID := (split $authorPart " und ") }}{{- if gt $i 0 }} und {{ end }}{{- $agent := GetAgent $authorID -}}{{- if and $agent (gt (len $agent.Names) 0) -}}
{{ index $agent.Names 0 }}{{- end -}}{{ end }}{{- end }}:
+ {{ $displayCategory }}{{- if or (ne $authorPart "") (ne $translatorPart "") (ne $editorPart "") }} von {{ end }}
+ {{- /* Display authors */ -}}
+ {{- if ne $authorPart "" -}}
+ {{- range $i, $authorID := (split $authorPart " und ") -}}
+ {{- if gt $i 0 }} und {{ end }}
+ {{- $agent := GetAgent $authorID -}}
+ {{- if and $agent (gt (len $agent.Names) 0) -}}
+
{{ index $agent.Names 0 }}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- /* Display translators with (Übers.) suffix */ -}}
+ {{- if ne $translatorPart "" -}}
+ {{- if ne $authorPart "" }}, {{ end }}
+ {{- range $i, $translatorID := (split $translatorPart " und ") -}}
+ {{- if gt $i 0 }}, {{ end }}
+ {{- $agent := GetAgent $translatorID -}}
+ {{- if and $agent (gt (len $agent.Names) 0) -}}
+
{{ index $agent.Names 0 }} (Übers.)
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- /* Display editors with (Hrsg.) suffix */ -}}
+ {{- if ne $editorPart "" -}}
+ {{- if or (ne $authorPart "") (ne $translatorPart "") }}, {{ end }}
+ {{- range $i, $editorID := (split $editorPart " und ") -}}
+ {{- if gt $i 0 }}, {{ end }}
+ {{- $agent := GetAgent $editorID -}}
+ {{- if and $agent (gt (len $agent.Names) 0) -}}
+
{{ index $agent.Names 0 }} (Hrsg.)
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}:
{{- /* Show citations separated by commas */ -}}
{{ " " }}{{- range $pieceIndex, $p := $groupPieces -}}
{{- range $issueIndex, $issue := $p.Item.IssueRefs -}}
diff --git a/views/routes/components/_inhaltsverzeichnis_eintrag.gohtml b/views/routes/components/_inhaltsverzeichnis_eintrag.gohtml
deleted file mode 100644
index 36a28f6..0000000
--- a/views/routes/components/_inhaltsverzeichnis_eintrag.gohtml
+++ /dev/null
@@ -1,426 +0,0 @@
-{{- $piece := . -}}
-{{- $fortsPrefix := "" -}}
-{{- if $piece.IsContinuation -}}
- {{- $fortsPrefix = "
(Forts.) " -}}
-{{- end -}}
-
-
-
- {{- $categoryFlags := GetCategoryFlags $piece.Piece -}}
-
- {{- $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 $categoryFlags.Rezension -}}
- {{- $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 }}
{{ index $agent.Names 0 }},
-
Rezension von:
- {{ if $workAuthorName }}
- {{- if $workAuthorID -}}
- {{ $workAuthorName }}
- {{- else -}}
- {{ $workAuthorName }}
- {{- end -}},
- {{ end }}
- {{ if $workTitle }}
- {{ $workTitle }}
- {{ else if $title }}
- {{ $title }}
- {{ else }}
- [Werk unbekannt]
- {{ end }}{{ if $place }}
{{ $place }}{{ end }}
- {{- $authorFound = true -}}
- {{- break -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- if not $authorFound -}}
- {{ Safe $fortsPrefix }}
Rezension von:
- {{ if $workAuthorName }}
- {{- if $workAuthorID -}}
- {{ $workAuthorName }}
- {{- else -}}
- {{ $workAuthorName }}
- {{- end -}},
- {{ end }}
- {{ if $workTitle }}
- {{ $workTitle }}
- {{ else if $title }}
- {{ $title }}
- {{ else }}
- [Werk unbekannt]
- {{ end }}{{ if $place }}
{{ $place }}{{ end }}
- {{- end -}}
-
- {{- else if $categoryFlags.Weltnachrichten -}}
- {{ Safe $fortsPrefix }}Politische Nachrichten aus aller Welt
- {{- else if $categoryFlags.EinkommendeFremde -}}
- {{- if $categoryFlags.Lokalnachrichten -}}
- Lokale Meldungen über einreisende Fremde
- {{- else if $categoryFlags.Nachruf -}}
- Nachruf und Einreiseliste
- {{- else -}}
- Einreiseliste
- {{- end -}}{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Wechselkurse -}}
- Wechselkurse{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Buecher -}}
- Bücheranzeigen{{ if $title }}:
{{ $title }}{{ end }}
-
- {{- else if $categoryFlags.Lokalanzeigen -}}
- {{ if $categoryFlags.Nachruf }}
- Todesanzeige
- {{ else }}
- Lokalanzeige
- {{ end }}{{ if $title }}:
{{ $title }}{{ end }}{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Lokalnachrichten -}}
- {{ if $categoryFlags.Lotterie }}
- Lotterienachrichten
- {{ else if $categoryFlags.Nachruf }}
- Nachrufe
- {{ else if $categoryFlags.Theaterkritik }}
- Theaternachrichten
- {{ else if $categoryFlags.Panegyrik }}
- Festlichkeiten
- {{ else }}
- Lokalnachrichten
- {{ end }}{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Gedicht -}}
- {{- $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 }}
{{ index $agent.Names 0 }},
- {{ if $categoryFlags.Kommentar }}
- Gedicht mit Kommentar
- {{ else if $categoryFlags.Uebersetzung }}
- Gedichtübersetzung
- {{ else if $categoryFlags.GelehrteNachrichten }}
- Gedicht zu gelehrten Angelegenheiten
- {{ else }}
- Gedicht
- {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}
- {{- $authorFound = true -}}
- {{- break -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- if not $authorFound -}}
- {{ Safe $fortsPrefix }}{{ if $categoryFlags.Kommentar }}
- Gedicht mit Kommentar
- {{ else if $categoryFlags.Uebersetzung }}
- Gedichtübersetzung
- {{ else if $categoryFlags.GelehrteNachrichten }}
- Gedicht zu gelehrten Angelegenheiten
- {{ else }}
- Gedicht
- {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}
- {{- end -}}
-
- {{- else if $categoryFlags.Vorladung -}}
- Gerichtliche Vorladung{{ if $title }}:
{{ $title }}{{ end }}{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Aufsatz -}}
- {{- $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 }}
{{ index $agent.Names 0 }},
- {{ if $categoryFlags.Replik }}
- Erwiderung
- {{ else if $categoryFlags.Uebersetzung }}
- Übersetzung
- {{ else if $categoryFlags.Nachruf }}
- Nachruf
- {{ else if $categoryFlags.Kommentar }}
- Kommentar
- {{ else if $categoryFlags.Rezepte }}
- Rezepte und Anleitungen
- {{ else }}
- Aufsatz
- {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}
- {{- $authorFound = true -}}
- {{- break -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- if not $authorFound -}}
- {{ Safe $fortsPrefix }}{{ if $categoryFlags.Replik }}
- Erwiderung
- {{ else if $categoryFlags.Uebersetzung }}
- Übersetzung
- {{ else if $categoryFlags.Nachruf }}
- Nachruf
- {{ else if $categoryFlags.Kommentar }}
- Kommentar
- {{ else if $categoryFlags.Rezepte }}
- Rezepte und Anleitungen
- {{ else }}
- Aufsatz
- {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}
- {{- end -}}
-
- {{- else if $categoryFlags.GelehrteNachrichten -}}
- {{ Safe $fortsPrefix }}{{ if $categoryFlags.Theaterkritik }}
- Theaterkritik
- {{ else if $categoryFlags.Kommentar }}
- Gelehrter Kommentar
- {{ else }}
- Gelehrte Nachrichten
- {{ end }}{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Theaterkritik -}}
- {{- $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 }}
{{ index $agent.Names 0 }},
- Theaterkritik{{ if $workTitle }}
- zu
{{ $workTitle }}{{ if $workAuthorName }}
- von
-
{{ $workAuthorName }}
- {{ end }}
- {{ else if $title }}
- zu
{{ $title }}
- {{ end }}{{ if $place }}
{{ $place }}{{ end }}
- {{- $authorFound = true -}}
- {{- break -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- if not $authorFound -}}
- {{ Safe $fortsPrefix }}Theaterkritik{{ if $workTitle }}
- zu
{{ $workTitle }}{{ if $workAuthorName }}
- von
{{ $workAuthorName }}
- {{ end }}
- {{ else if $title }}
- zu
{{ $title }}
- {{ end }}{{ if $place }}
{{ $place }}{{ end }}
- {{- end -}}
-
- {{- else if $categoryFlags.Proklamation -}}
- {{ Safe $fortsPrefix }}Amtliche
- Proklamation{{ if $title }}:
{{ $title }}{{ end }}
-
- {{- else if $categoryFlags.Ineigenersache -}}
- {{ Safe $fortsPrefix }}{{ if $categoryFlags.Kommentar }}
- {{ if $categoryFlags.Nachtrag }}Ergänzender Kommentar{{ else }}Redaktioneller Kommentar{{ end }}
- {{ else if $categoryFlags.Replik }}
- Redaktionelle Stellungnahme
- {{ else }}
- Anmerkung der Redaktion
- {{ end }}
- {{ if $title }}:
{{ $title }}{{ end }}
-
- {{- else if $categoryFlags.Brief -}}
- {{ Safe $fortsPrefix }}{{ if $categoryFlags.Nachruf }}
- 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
-
{{ index $agent.Names 0 }}{{- $authorFound = true -}}{{- break -}}
- {{- end -}}
-
- {{- end -}}
-
- {{- end -}}{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Desertionsliste -}}
- {{ Safe $fortsPrefix }}Desertionsliste{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Notenblatt -}}
- {{ Safe $fortsPrefix }}{{ if $categoryFlags.Nachtrag }}Ergänztes{{ end }}Notenblatt{{ if $title }}
- :
{{ $title }}
- {{ end }}
-
- {{- else if $categoryFlags.Vorlesungsverzeichnis -}}
- {{ Safe $fortsPrefix }}Vorlesungsverzeichnis{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Erzaehlung -}}
- {{- $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 }}
{{ index $agent.Names 0 }},
- {{ if $categoryFlags.Uebersetzung }}
- Übersetzung einer Erzählung
- {{ else }}
- Erzählung
- {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}
- {{- $authorFound = true -}}
- {{- break -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- if not $authorFound -}}
- {{ Safe $fortsPrefix }}{{ if $categoryFlags.Uebersetzung }}
- Übersetzung einer Erzählung
- {{ else }}
- Erzählung
- {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}
- {{- end -}}
-
- {{- else if $categoryFlags.Abbildung -}}
- {{ Safe $fortsPrefix }}{{ if $categoryFlags.Aufsatz }}
- Illustrierter Aufsatz
- {{ else }}
- Abbildung
- {{ end }}
- {{ if $title }}:
{{ $title }}{{ end }}
-
- {{- else if $categoryFlags.Kriminalanzeige -}}
- {{ Safe $fortsPrefix }}Kriminalanzeige{{ if $place }}
{{ $place }}{{ end }}
-
- {{- else if $categoryFlags.Korrektur -}}
- {{ Safe $fortsPrefix }}Korrektur{{ if $title }}:
{{ $title }}{{ end }}
-
- {{- else if $categoryFlags.Anzeige -}}
- {{ Safe $fortsPrefix }}{{ if $categoryFlags.Auszug }}
- {{ if $categoryFlags.Gedicht }}Gedichtauszug{{ else }}Textauszug{{ end }}
- {{ else }}
- Anzeige
- {{ end }}
- {{ if $title }}:
{{ $title }}{{ end }}
-
- {{- else if $categoryFlags.Auszug -}}
- {{ Safe $fortsPrefix }}{{ if $title }}
{{ $title }}, {{ end }}{{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ if $workAuthorName }}
-
{{ $workAuthorName }}, {{ end }}{{ if $workTitle }}
{{ $workTitle }}{{ else if $title }}
{{ $title }}{{ 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 }}
{{ index $agent.Names 0 }}{{ if $title }}:
{{ $title }}{{ end }}{{ if $workTitle }}
- {{ if $title }}, {{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
-
{{ $workAuthorName }}, {{ end }}
{{ $workTitle }}
- {{ end }}
- {{- $authorFound = true -}}
- {{- break -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- if not $authorFound -}}
- {{ Safe $fortsPrefix }}{{ if $title }}
{{ $title }}{{ end }}{{ if $workTitle }}
- {{ if $title }}, {{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
-
{{ $workAuthorName }}, {{ end }}
{{ $workTitle }}
- {{ else if not $title }}
- Beitrag ohne Titel
- {{ end }}
- {{- end -}}
-
- {{- end -}}
-
-
-{{- if not $piece.IsContinuation -}}
- {{- range $annotation := $piece.AnnotationNote.Annotations -}}
-
- {{ Safe $annotation.HTML }}
-
- {{- end -}}
-{{- end -}}
diff --git a/views/routes/components/_piece_summary.gohtml b/views/routes/components/_piece_summary.gohtml
deleted file mode 100644
index 5c7a616..0000000
--- a/views/routes/components/_piece_summary.gohtml
+++ /dev/null
@@ -1,204 +0,0 @@
-{{- $piece := .Piece -}}
-{{- $currentActorID := .CurrentActorID -}}
-
- {{- $categoryFlags := GetCategoryFlags $piece -}}
-
- {{- $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 := "" -}}
- {{- $workAuthorName := "" -}}
- {{- $workAuthorID := "" -}}
- {{- if $piece.WorkRefs -}}
- {{- $work := GetWork (index $piece.WorkRefs 0).Ref -}}
- {{- if $work.PreferredTitle -}}
- {{- $workTitle = $work.PreferredTitle -}}
- {{- else if $work.Citation.Title -}}
- {{- $workTitle = $work.Citation.Title -}}
- {{- end -}}
- {{- 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 -}}
-
- {{- /* Build category list */ -}}
- {{- $categories := slice -}}
- {{- if $categoryFlags.Rezension -}}
- {{- $categories = append $categories "Rezension" -}}
- {{- end -}}
- {{- if $categoryFlags.Gedicht -}}
- {{- $categories = append $categories "Gedicht" -}}
- {{- end -}}
- {{- if $categoryFlags.Aufsatz -}}
- {{- $categories = append $categories "Aufsatz" -}}
- {{- end -}}
- {{- if $categoryFlags.Theaterkritik -}}
- {{- $categories = append $categories "Theaterkritik" -}}
- {{- end -}}
- {{- if $categoryFlags.Brief -}}
- {{- $categories = append $categories "Brief" -}}
- {{- end -}}
- {{- if $categoryFlags.Erzaehlung -}}
- {{- $categories = append $categories "Erzählung" -}}
- {{- end -}}
- {{- if $categoryFlags.Kommentar -}}
- {{- $categories = append $categories "Kommentar" -}}
- {{- end -}}
- {{- if $categoryFlags.Uebersetzung -}}
- {{- $categories = append $categories "Übersetzung" -}}
- {{- end -}}
- {{- if $categoryFlags.Auszug -}}
- {{- $categories = append $categories "Auszug" -}}
- {{- end -}}
- {{- if $categoryFlags.Replik -}}
- {{- $categories = append $categories "Replik" -}}
- {{- end -}}
- {{- if $categoryFlags.Lokalnachrichten -}}
- {{- $categories = append $categories "Lokalnachrichten" -}}
- {{- end -}}
- {{- if $categoryFlags.Lotterie -}}
- {{- $categories = append $categories "Lotterie" -}}
- {{- end -}}
- {{- if $categoryFlags.Nachruf -}}
- {{- $categories = append $categories "Nachruf" -}}
- {{- end -}}
- {{- if $categoryFlags.Weltnachrichten -}}
- {{- $categories = append $categories "Weltnachrichten" -}}
- {{- end -}}
- {{- if $categoryFlags.EinkommendeFremde -}}
- {{- $categories = append $categories "Einkommende Fremde" -}}
- {{- end -}}
- {{- if $categoryFlags.Wechselkurse -}}
- {{- $categories = append $categories "Wechselkurse" -}}
- {{- end -}}
- {{- if $categoryFlags.Buecher -}}
- {{- $categories = append $categories "Bücher" -}}
- {{- end -}}
- {{- if $categoryFlags.Lokalanzeigen -}}
- {{- $categories = append $categories "Lokalanzeigen" -}}
- {{- end -}}
- {{- if $categoryFlags.Vorladung -}}
- {{- $categories = append $categories "Vorladung" -}}
- {{- end -}}
- {{- if $categoryFlags.GelehrteNachrichten -}}
- {{- $categories = append $categories "Gelehrte Nachrichten" -}}
- {{- end -}}
- {{- if $categoryFlags.Anzeige -}}
- {{- $categories = append $categories "Anzeige" -}}
- {{- end -}}
- {{- if $categoryFlags.Proklamation -}}
- {{- $categories = append $categories "Proklamation" -}}
- {{- end -}}
- {{- if $categoryFlags.Desertionsliste -}}
- {{- $categories = append $categories "Desertionsliste" -}}
- {{- end -}}
- {{- if $categoryFlags.Notenblatt -}}
- {{- $categories = append $categories "Notenblatt" -}}
- {{- end -}}
- {{- if $categoryFlags.Vorlesungsverzeichnis -}}
- {{- $categories = append $categories "Vorlesungsverzeichnis" -}}
- {{- end -}}
- {{- if $categoryFlags.Abbildung -}}
- {{- $categories = append $categories "Abbildung" -}}
- {{- end -}}
- {{- if $categoryFlags.Ineigenersache -}}
- {{- $categories = append $categories "In eigener Sache" -}}
- {{- end -}}
- {{- if $categoryFlags.Provinienz -}}
- {{- $categories = append $categories "Provinienz" -}}
- {{- end -}}
-
- {{- /* Display category combination */ -}}
- {{- $categoryName := "" -}}
- {{- if eq (len $categories) 0 -}}
- {{- $categoryName = "Beitrag" -}}
- {{- else -}}
- {{- $sortedCategories := sortStrings $categories -}}
- {{- $categoryName = joinWithUnd $sortedCategories -}}
- {{- end -}}
-
- {{- /* Generate piece descriptions */ -}}
- {{- if has $categories "Rezension" -}}
- {{- /* Collect all additional authors (not current actor) */ -}}
- {{- $additionalAuthors := slice -}}
- {{- $currentAuthorFound := 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) -}}
- {{- if ne $agentref.Ref $currentActorID -}}
- {{- $additionalAuthors = append $additionalAuthors $agent -}}
- {{- else -}}
- {{- $currentAuthorFound = true -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
-
- {{- /* Display review with proper author attribution */ -}}
- {{- if $additionalAuthors -}}
- mit {{ range $i, $author := $additionalAuthors }}{{- if gt $i 0 }} und {{ end }}
{{ index $author.Names 0 }}{{ end }}, {{ $categoryName }} von:
- {{- else if $currentAuthorFound -}}
- {{ $categoryName }} von:
- {{- else -}}
- {{ $categoryName }} von:
- {{- end -}}
- {{ if $workAuthorName }}
-
{{ $workAuthorName }},
- {{ end }}
- {{ if $workTitle }}
-
{{ $workTitle }}
- {{ else if $title }}
-
{{ $title }}
- {{ else }}
- [Werk unbekannt]
- {{ end }}
-
- {{- else -}}
- {{- /* Collect all additional authors (not current actor) */ -}}
- {{- $additionalAuthors := slice -}}
- {{- $currentAuthorFound := 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) -}}
- {{- if ne $agentref.Ref $currentActorID -}}
- {{- $additionalAuthors = append $additionalAuthors $agent -}}
- {{- else -}}
- {{- $currentAuthorFound = true -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
-
- {{- /* Display with proper author attribution */ -}}
- {{- if $additionalAuthors -}}
- mit {{ range $i, $author := $additionalAuthors }}{{- if gt $i 0 }} und {{ end }}
{{ index $author.Names 0 }}{{ end }}, {{ $categoryName }}{{ if $title }}:
{{ $title }}{{ end }}
- {{- else if $currentAuthorFound -}}
- {{ $categoryName }}{{ if $title }}:
{{ $title }}{{ end }}
- {{- else -}}
- {{ $categoryName }}{{ if $title }}:
{{ $title }}{{ else if eq $categoryName "Beitrag" }} ohne Titel{{ end }}
- {{- end -}}
- {{- end -}}
-
diff --git a/views/routes/components/_piece_summary_for_place.gohtml b/views/routes/components/_piece_summary_for_place.gohtml
deleted file mode 100644
index 85b8bd6..0000000
--- a/views/routes/components/_piece_summary_for_place.gohtml
+++ /dev/null
@@ -1,203 +0,0 @@
-{{- $piece := .Piece -}}
-{{- $currentActorID := .CurrentActorID -}}
-
- {{- $categoryFlags := GetCategoryFlags $piece -}}
-
- {{- $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 := "" -}}
- {{- $workAuthorName := "" -}}
- {{- $workAuthorID := "" -}}
- {{- if $piece.WorkRefs -}}
- {{- $work := GetWork (index $piece.WorkRefs 0).Ref -}}
- {{- if $work.PreferredTitle -}}
- {{- $workTitle = $work.PreferredTitle -}}
- {{- else if $work.Citation.Title -}}
- {{- $workTitle = $work.Citation.Title -}}
- {{- end -}}
- {{- 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 -}}
-
- {{- /* Build category list */ -}}
- {{- $categories := slice -}}
- {{- if $categoryFlags.Rezension -}}
- {{- $categories = append $categories "Rezension" -}}
- {{- end -}}
- {{- if $categoryFlags.Gedicht -}}
- {{- $categories = append $categories "Gedicht" -}}
- {{- end -}}
- {{- if $categoryFlags.Aufsatz -}}
- {{- $categories = append $categories "Aufsatz" -}}
- {{- end -}}
- {{- if $categoryFlags.Theaterkritik -}}
- {{- $categories = append $categories "Theaterkritik" -}}
- {{- end -}}
- {{- if $categoryFlags.Brief -}}
- {{- $categories = append $categories "Brief" -}}
- {{- end -}}
- {{- if $categoryFlags.Erzaehlung -}}
- {{- $categories = append $categories "Erzählung" -}}
- {{- end -}}
- {{- if $categoryFlags.Kommentar -}}
- {{- $categories = append $categories "Kommentar" -}}
- {{- end -}}
- {{- if $categoryFlags.Uebersetzung -}}
- {{- $categories = append $categories "Übersetzung" -}}
- {{- end -}}
- {{- if $categoryFlags.Auszug -}}
- {{- $categories = append $categories "Auszug" -}}
- {{- end -}}
- {{- if $categoryFlags.Replik -}}
- {{- $categories = append $categories "Replik" -}}
- {{- end -}}
- {{- if $categoryFlags.Lokalnachrichten -}}
- {{- $categories = append $categories "Lokalnachrichten" -}}
- {{- end -}}
- {{- if $categoryFlags.Lotterie -}}
- {{- $categories = append $categories "Lotterie" -}}
- {{- end -}}
- {{- if $categoryFlags.Nachruf -}}
- {{- $categories = append $categories "Nachruf" -}}
- {{- end -}}
- {{- if $categoryFlags.Weltnachrichten -}}
- {{- $categories = append $categories "Weltnachrichten" -}}
- {{- end -}}
- {{- if $categoryFlags.EinkommendeFremde -}}
- {{- $categories = append $categories "Einkommende Fremde" -}}
- {{- end -}}
- {{- if $categoryFlags.Wechselkurse -}}
- {{- $categories = append $categories "Wechselkurse" -}}
- {{- end -}}
- {{- if $categoryFlags.Buecher -}}
- {{- $categories = append $categories "Bücher" -}}
- {{- end -}}
- {{- if $categoryFlags.Lokalanzeigen -}}
- {{- $categories = append $categories "Lokalanzeigen" -}}
- {{- end -}}
- {{- if $categoryFlags.Vorladung -}}
- {{- $categories = append $categories "Vorladung" -}}
- {{- end -}}
- {{- if $categoryFlags.GelehrteNachrichten -}}
- {{- $categories = append $categories "Gelehrte Nachrichten" -}}
- {{- end -}}
- {{- if $categoryFlags.Anzeige -}}
- {{- $categories = append $categories "Anzeige" -}}
- {{- end -}}
- {{- if $categoryFlags.Proklamation -}}
- {{- $categories = append $categories "Proklamation" -}}
- {{- end -}}
- {{- if $categoryFlags.Desertionsliste -}}
- {{- $categories = append $categories "Desertionsliste" -}}
- {{- end -}}
- {{- if $categoryFlags.Notenblatt -}}
- {{- $categories = append $categories "Notenblatt" -}}
- {{- end -}}
- {{- if $categoryFlags.Vorlesungsverzeichnis -}}
- {{- $categories = append $categories "Vorlesungsverzeichnis" -}}
- {{- end -}}
- {{- if $categoryFlags.Abbildung -}}
- {{- $categories = append $categories "Abbildung" -}}
- {{- end -}}
- {{- if $categoryFlags.Ineigenersache -}}
- {{- $categories = append $categories "In eigener Sache" -}}
- {{- end -}}
- {{- if $categoryFlags.Provinienz -}}
- {{- $categories = append $categories "Provinienz" -}}
- {{- end -}}
-
- {{- /* Display category combination */ -}}
- {{- $categoryName := "" -}}
- {{- if eq (len $categories) 0 -}}
- {{- $categoryName = "Beitrag" -}}
- {{- else -}}
- {{- $sortedCategories := sortStrings $categories -}}
- {{- $categoryName = joinWithUnd $sortedCategories -}}
- {{- end -}}
-
- {{- /* Generate piece descriptions */ -}}
- {{- if has $categories "Rezension" -}}
- {{- /* Collect all additional authors (not current actor) */ -}}
- {{- $additionalAuthors := slice -}}
- {{- $currentAuthorFound := 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) -}}
- {{- if ne $agentref.Ref $currentActorID -}}
- {{- $additionalAuthors = append $additionalAuthors $agent -}}
- {{- else -}}
- {{- $currentAuthorFound = true -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
-
- {{- /* Display review with colon instead of "mit" for place view */ -}}
- {{- if $additionalAuthors -}}
- {{ range $i, $author := $additionalAuthors }}{{- if gt $i 0 }} und {{ end }}
{{ index $author.Names 0 }}{{ end }}: {{ $categoryName }} von:
- {{- else if $currentAuthorFound -}}
- {{ $categoryName }} von:
- {{- else -}}
- {{ $categoryName }} von:
- {{- end -}}
- {{ if $workAuthorName }}
-
{{ $workAuthorName }},
- {{ end }}
- {{ if $workTitle }}
-
{{ $workTitle }}
- {{ else if $title }}
-
{{ $title }}
- {{ else }}
- [Werk unbekannt]
- {{ end }}
-
- {{- else -}}
- {{- /* Collect all additional authors (not current actor) */ -}}
- {{- $additionalAuthors := slice -}}
- {{- $currentAuthorFound := 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) -}}
- {{- if ne $agentref.Ref $currentActorID -}}
- {{- $additionalAuthors = append $additionalAuthors $agent -}}
- {{- else -}}
- {{- $currentAuthorFound = true -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
-
- {{- /* Display with colon instead of "mit" for place view */ -}}
- {{- if $additionalAuthors -}}
- {{ range $i, $author := $additionalAuthors }}{{- if gt $i 0 }} und {{ end }}
{{ index $author.Names 0 }}{{ end }}: {{ $categoryName }}{{ if $title }}:
{{ $title }}{{ end }}
- {{- else if $currentAuthorFound -}}
- {{ $categoryName }}{{ if $title }}:
{{ $title }}{{ end }}
- {{- else -}}
- {{ $categoryName }}{{ if $title }}:
{{ $title }}{{ else if eq $categoryName "Beitrag" }} ohne Titel{{ end }}
- {{- end -}}
- {{- end -}}
\ No newline at end of file
diff --git a/views/routes/components/_unified_piece_entry.gohtml b/views/routes/components/_unified_piece_entry.gohtml
new file mode 100644
index 0000000..c5f53d6
--- /dev/null
+++ b/views/routes/components/_unified_piece_entry.gohtml
@@ -0,0 +1,615 @@
+{{- /*
+ Unified Piece Entry Component
+ Displays piece entries with category-specific descriptions across all views
+
+ Usage: {{ template "_unified_piece_entry" (dict
+ "Piece" $piece
+ "CurrentActorID" $currentActorID
+ "DisplayMode" "issue|akteure|place|search"
+ "ShowPlaceTags" true|false
+ "UseColonFormat" true|false
+ "ShowContinuation" true|false
+ ) }}
+
+ Parameters:
+ - Piece: The piece object to display
+ - CurrentActorID: ID of current actor (for akteure view context)
+ - DisplayMode: Context for formatting ("issue", "akteure", "place", "search")
+ - ShowPlaceTags: Whether to show place tags (default: true)
+ - UseColonFormat: Use colon format instead of "mit" for place view (default: false)
+ - ShowContinuation: Show continuation prefixes (default: true for issue mode)
+*/ -}}
+
+{{- $pieceInput := .Piece -}}
+{{- $currentActorID := .CurrentActorID -}}
+{{- $displayMode := .DisplayMode -}}
+{{- if not $displayMode -}}{{ $displayMode = "issue" }}{{- end -}}
+{{- $showPlaceTags := .ShowPlaceTags -}}
+{{- if eq $showPlaceTags nil -}}{{ $showPlaceTags = true }}{{- end -}}
+{{- $useColonFormat := .UseColonFormat -}}
+{{- if eq $useColonFormat nil -}}{{ $useColonFormat = false }}{{- end -}}
+{{- $showContinuation := .ShowContinuation -}}
+{{- if eq $showContinuation nil -}}{{ $showContinuation = (eq $displayMode "issue") }}{{- end -}}
+
+{{- /* Handle different piece types: viewmodels.PieceByIssue vs xmlmodels.Piece */ -}}
+{{- $piece := $pieceInput -}}
+{{- $isContinuation := false -}}
+{{- if eq $displayMode "issue" -}}
+ {{- /* Issue view uses viewmodels.PieceByIssue with .Piece field */ -}}
+ {{- $piece = $pieceInput.Piece -}}
+ {{- $isContinuation = $pieceInput.IsContinuation -}}
+{{- end -}}
+
+{{- $fortsPrefix := "" -}}
+{{- if and $showContinuation $isContinuation -}}
+ {{- $fortsPrefix = "
(Forts.) " -}}
+{{- end -}}
+
+
+ {{- $categoryFlags := GetCategoryFlags $piece -}}
+
+ {{- $place := "" -}}
+ {{- $placeID := "" -}}
+ {{- if $piece.PlaceRefs -}}
+ {{- $placeObj := GetPlace (index $piece.PlaceRefs 0).Ref -}}
+ {{- if gt (len $placeObj.Names) 0 -}}
+ {{- $place = index $placeObj.Names 0 -}}
+ {{- $placeID = $placeObj.ID -}}
+ {{- 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 := "" -}}
+ {{- /* Initialize work contributor collections */ -}}
+ {{- $workAuthors := slice -}}
+ {{- $workTranslators := slice -}}
+ {{- $workEditors := slice -}}
+ {{- 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 contributors: authors, translators, editors */ -}}
+ {{- 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) -}}
+ {{- $workAuthors = append $workAuthors (dict "ID" $workAgentRef.Ref "Name" (index $workAgent.Names 0)) -}}
+ {{- end -}}
+ {{- else if eq $workAgentRef.Category "übersetzer" -}}
+ {{- $workAgent := GetAgent $workAgentRef.Ref -}}
+ {{- if and $workAgent (gt (len $workAgent.Names) 0) -}}
+ {{- $workTranslators = append $workTranslators (dict "ID" $workAgentRef.Ref "Name" (index $workAgent.Names 0)) -}}
+ {{- end -}}
+ {{- else if eq $workAgentRef.Category "herausgeber" -}}
+ {{- $workAgent := GetAgent $workAgentRef.Ref -}}
+ {{- if and $workAgent (gt (len $workAgent.Names) 0) -}}
+ {{- $workEditors = append $workEditors (dict "ID" $workAgentRef.Ref "Name" (index $workAgent.Names 0)) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- /* Legacy single author variables for compatibility */ -}}
+ {{- if gt (len $workAuthors) 0 -}}
+ {{- $workAuthorName = (index $workAuthors 0).Name -}}
+ {{- $workAuthorID = (index $workAuthors 0).ID -}}
+ {{- end -}}
+ {{- end -}}
+
+ {{- /* Place tags helper - handle multiple places */ -}}
+ {{- $placeTag := "" -}}
+ {{- if and $showPlaceTags $piece.PlaceRefs -}}
+ {{- range $placeRef := $piece.PlaceRefs -}}
+ {{- $placeObj := GetPlace $placeRef.Ref -}}
+ {{- if gt (len $placeObj.Names) 0 -}}
+ {{- $placeName := index $placeObj.Names 0 -}}
+ {{- $placeTag = printf "%s
%s" $placeTag $placeObj.ID $placeName -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+
+ {{- /* Author prefix for colon format (place view) */ -}}
+ {{- $colonPrefix := "" -}}
+ {{- if $useColonFormat -}}
+ {{- $colonPrefix = ": " -}}
+ {{- else -}}
+ {{- $colonPrefix = " mit " -}}
+ {{- end -}}
+
+ {{- /* Collect authors, translators, and editors */ -}}
+ {{- $authors := slice -}}
+ {{- $translators := slice -}}
+ {{- $editors := slice -}}
+ {{- 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) -}}
+ {{- $authors = append $authors (dict "ID" $agentref.Ref "Name" (index $agent.Names 0)) -}}
+ {{- end -}}
+ {{- else if eq $agentref.Category "übersetzer" -}}
+ {{- $agent := GetAgent $agentref.Ref -}}
+ {{- if and $agent (gt (len $agent.Names) 0) -}}
+ {{- $translators = append $translators (dict "ID" $agentref.Ref "Name" (index $agent.Names 0)) -}}
+ {{- end -}}
+ {{- else if eq $agentref.Category "herausgeber" -}}
+ {{- $agent := GetAgent $agentref.Ref -}}
+ {{- if and $agent (gt (len $agent.Names) 0) -}}
+ {{- $editors = append $editors (dict "ID" $agentref.Ref "Name" (index $agent.Names 0)) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+
+
+ {{- /* Generate category-specific descriptions */ -}}
+
+ {{- if $categoryFlags.Rezension -}}
+ {{- /* Show authors, translators, and editors in prefix */ -}}
+ {{- if or (gt (len $authors) 0) (gt (len $translators) 0) (gt (len $editors) 0) -}}
+ {{- $hasCurrentActorAuthor := false -}}
+ {{- range $author := $authors -}}
+ {{- if eq $author.ID $currentActorID -}}
+ {{- $hasCurrentActorAuthor = true -}}
+ {{- end -}}
+ {{- end -}}
+ {{- $hasCurrentActorTranslator := false -}}
+ {{- range $translator := $translators -}}
+ {{- if eq $translator.ID $currentActorID -}}
+ {{- $hasCurrentActorTranslator = true -}}
+ {{- end -}}
+ {{- end -}}
+ {{- $hasCurrentActorEditor := false -}}
+ {{- range $editor := $editors -}}
+ {{- if eq $editor.ID $currentActorID -}}
+ {{- $hasCurrentActorEditor = true -}}
+ {{- end -}}
+ {{- end -}}
+ {{- /* Show other authors/translators/editors in prefix */ -}}
+ {{- if and $useColonFormat (or (not $hasCurrentActorAuthor) (not $hasCurrentActorTranslator) (not $hasCurrentActorEditor)) -}}
+ {{ Safe $fortsPrefix }}
+ {{- $authorElements := slice -}}
+ {{- range $author := $authors -}}
+ {{- if ne $author.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s" $author.ID $author.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $translator := $translators -}}
+ {{- if ne $translator.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s (Übers.)" $translator.ID $translator.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $editor := $editors -}}
+ {{- if ne $editor.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s (Hrsg.)" $editor.ID $editor.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $index, $element := $authorElements -}}
+ {{- if gt $index 0 }}, {{ end }}{{ Safe $element }}
+ {{- end -}}{{ $colonPrefix }}Rezension von:
+ {{- else if not $useColonFormat -}}
+ {{ Safe $fortsPrefix }}
+ {{- $authorElements := slice -}}
+ {{- range $author := $authors -}}
+ {{- if ne $author.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s" $author.ID $author.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $translator := $translators -}}
+ {{- if ne $translator.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s (Übers.)" $translator.ID $translator.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $editor := $editors -}}
+ {{- if ne $editor.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s (Hrsg.)" $editor.ID $editor.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $index, $element := $authorElements -}}
+ {{- if gt $index 0 }}, {{ end }}{{ Safe $element }}
+ {{- end -}},
+ {{- else -}}
+ {{ Safe $fortsPrefix }}Rezension von:
+ {{- end -}}
+ {{- else -}}
+ {{ Safe $fortsPrefix }}Rezension von:
+ {{- end -}}
+
+ {{ if or (gt (len $workAuthors) 0) (gt (len $workTranslators) 0) (gt (len $workEditors) 0) }}
+ {{- /* Display work authors */ -}}
+ {{- range $index, $author := $workAuthors -}}
+ {{- if gt $index 0 }}, {{ end }}
+ {{ $author.Name }}
+ {{- end -}}
+ {{- /* Display work translators */ -}}
+ {{- if gt (len $workTranslators) 0 -}}
+ {{- if gt (len $workAuthors) 0 }}, {{ end }}
+ {{- range $index, $translator := $workTranslators -}}
+ {{- if gt $index 0 }}, {{ end }}
+ {{ $translator.Name }} (Übers.)
+ {{- end -}}
+ {{- end -}}
+ {{- /* Display work editors */ -}}
+ {{- if gt (len $workEditors) 0 -}}
+ {{- if or (gt (len $workAuthors) 0) (gt (len $workTranslators) 0) }}, {{ end }}
+ {{- range $index, $editor := $workEditors -}}
+ {{- if gt $index 0 }}, {{ end }}
+ {{ $editor.Name }} (Hrsg.)
+ {{- end -}}
+ {{- end -}},
+ {{ end }}
+ {{ if $workTitle }}
+ {{ $workTitle }}
+ {{ else if $title }}
+ {{ $title }}
+ {{ else }}
+ [Werk unbekannt]
+ {{ end }}{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Weltnachrichten -}}
+ {{ Safe $fortsPrefix }}Politische Nachrichten aus aller Welt{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.EinkommendeFremde -}}
+ {{- if $categoryFlags.Lokalnachrichten -}}
+ {{ Safe $fortsPrefix }}Lokale Meldungen über einreisende Fremde
+ {{- else if $categoryFlags.Nachruf -}}
+ {{ Safe $fortsPrefix }}Nachruf und Einreiseliste
+ {{- else -}}
+ {{ Safe $fortsPrefix }}Einreiseliste
+ {{- end -}}{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Wechselkurse -}}
+ {{ Safe $fortsPrefix }}Wechselkurse{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Buecher -}}
+ {{ Safe $fortsPrefix }}Bücheranzeigen{{ if $title }}:
{{ $title }}{{ end }}{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Lokalanzeigen -}}
+ {{ Safe $fortsPrefix }}{{ if $categoryFlags.Nachruf }}
+ Todesanzeige
+ {{ else }}
+ Lokalanzeige
+ {{ end }}{{ if $title }}:
{{ $title }}{{ end }}{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Lokalnachrichten -}}
+ {{ Safe $fortsPrefix }}{{ if $categoryFlags.Lotterie }}
+ Lotterienachrichten
+ {{ else if $categoryFlags.Nachruf }}
+ Nachrufe
+ {{ else if $categoryFlags.Theaterkritik }}
+ Theaternachrichten
+ {{ else if $categoryFlags.Panegyrik }}
+ Festlichkeiten
+ {{ else }}
+ Lokalnachrichten
+ {{ end }}{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Gedicht -}}
+ {{- $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) -}}
+ {{- if and $useColonFormat (ne $agentref.Ref $currentActorID) -}}
+ {{ Safe $fortsPrefix }}
{{ index $agent.Names 0 }}{{ $colonPrefix }}
+ {{- else if not $useColonFormat -}}
+ {{ Safe $fortsPrefix }}
{{ index $agent.Names 0 }},
+ {{- else -}}
+ {{ Safe $fortsPrefix }}
+ {{- end -}}
+ {{ if $categoryFlags.Kommentar }}
+ Gedicht mit Kommentar
+ {{ else if $categoryFlags.Uebersetzung }}
+ Gedichtübersetzung
+ {{ else if $categoryFlags.GelehrteNachrichten }}
+ Gedicht zu gelehrten Angelegenheiten
+ {{ else }}
+ Gedicht
+ {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}{{ Safe $placeTag }}
+ {{- $authorFound = true -}}
+ {{- break -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- if not $authorFound -}}
+ {{ Safe $fortsPrefix }}{{ if $categoryFlags.Kommentar }}
+ Gedicht mit Kommentar
+ {{ else if $categoryFlags.Uebersetzung }}
+ Gedichtübersetzung
+ {{ else if $categoryFlags.GelehrteNachrichten }}
+ Gedicht zu gelehrten Angelegenheiten
+ {{ else }}
+ Gedicht
+ {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}{{ Safe $placeTag }}
+ {{- end -}}
+
+ {{- else if $categoryFlags.Vorladung -}}
+ {{ Safe $fortsPrefix }}Gerichtliche Vorladung{{ if $title }}:
{{ $title }}{{ end }}{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Aufsatz -}}
+ {{- $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) -}}
+ {{- if and $useColonFormat (ne $agentref.Ref $currentActorID) -}}
+ {{ Safe $fortsPrefix }}
{{ index $agent.Names 0 }}{{ $colonPrefix }}
+ {{- else if not $useColonFormat -}}
+ {{ Safe $fortsPrefix }}
{{ index $agent.Names 0 }},
+ {{- else -}}
+ {{ Safe $fortsPrefix }}
+ {{- end -}}
+ {{ if $categoryFlags.Replik }}
+ Erwiderung
+ {{ else if $categoryFlags.Uebersetzung }}
+ Übersetzung
+ {{ else if $categoryFlags.Nachruf }}
+ Nachruf
+ {{ else if $categoryFlags.Kommentar }}
+ Kommentar
+ {{ else if $categoryFlags.Rezepte }}
+ Rezepte und Anleitungen
+ {{ else }}
+ Aufsatz
+ {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}{{ Safe $placeTag }}
+ {{- $authorFound = true -}}
+ {{- break -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- if not $authorFound -}}
+ {{ Safe $fortsPrefix }}{{ if $categoryFlags.Replik }}
+ Erwiderung
+ {{ else if $categoryFlags.Uebersetzung }}
+ Übersetzung
+ {{ else if $categoryFlags.Nachruf }}
+ Nachruf
+ {{ else if $categoryFlags.Kommentar }}
+ Kommentar
+ {{ else if $categoryFlags.Rezepte }}
+ Rezepte und Anleitungen
+ {{ else }}
+ Aufsatz
+ {{ end }}{{ if $title }}:
„{{ $title }}"{{ end }}{{ Safe $placeTag }}
+ {{- end -}}
+
+ {{- else if $categoryFlags.GelehrteNachrichten -}}
+ {{ Safe $fortsPrefix }}{{ if $categoryFlags.Theaterkritik }}
+ Theaterkritik
+ {{ else if $categoryFlags.Kommentar }}
+ Gelehrter Kommentar
+ {{ else }}
+ Gelehrte Nachrichten
+ {{ end }}{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Theaterkritik -}}
+ {{- $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) -}}
+ {{- if and $useColonFormat (ne $agentref.Ref $currentActorID) -}}
+ {{ Safe $fortsPrefix }}
{{ index $agent.Names 0 }}{{ $colonPrefix }}
+ {{- else if not $useColonFormat -}}
+ {{ Safe $fortsPrefix }}
{{ index $agent.Names 0 }},
+ {{- else -}}
+ {{ Safe $fortsPrefix }}
+ {{- end -}}
+ Theaterkritik{{ if $workTitle }}
+ zu
{{ $workTitle }}{{ if $workAuthorName }}
+ von
+
{{ $workAuthorName }}
+ {{ end }}
+ {{ else if $title }}
+ zu
{{ $title }}
+ {{ end }}{{ Safe $placeTag }}
+ {{- $authorFound = true -}}
+ {{- break -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- if not $authorFound -}}
+ {{ Safe $fortsPrefix }}Theaterkritik{{ if $workTitle }}
+ zu
{{ $workTitle }}{{ if $workAuthorName }}
+ von
{{ $workAuthorName }}
+ {{ end }}
+ {{ else if $title }}
+ zu
{{ $title }}
+ {{ end }}{{ Safe $placeTag }}
+ {{- end -}}
+
+ {{- else if $categoryFlags.Proklamation -}}
+ {{ Safe $fortsPrefix }}Amtliche Proklamation{{ if $title }}:
{{ $title }}{{ end }}{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Ineigenersache -}}
+ {{ Safe $fortsPrefix }}{{ if $categoryFlags.Kommentar }}
+ {{ if $categoryFlags.Nachtrag }}Ergänzender Kommentar{{ else }}Redaktioneller Kommentar{{ end }}
+ {{ else if $categoryFlags.Replik }}
+ Redaktionelle Stellungnahme
+ {{ else }}
+ Anmerkung der Redaktion
+ {{ end }}
+ {{ if $title }}:
{{ $title }}{{ end }}{{ Safe $placeTag }}
+
+ {{- else if $categoryFlags.Brief -}}
+ {{ Safe $fortsPrefix }}{{ if $categoryFlags.Nachruf }}
+ 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
+
{{ index $agent.Names 0 }}{{- $authorFound = true -}}{{- break -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}{{ Safe $placeTag }}
+
+ {{- else -}}
+ {{- /* Check for Nachruf category in AgentRefs first */ -}}
+ {{- $obituaryPersonFound := false -}}
+ {{- range $agentref := $piece.AgentRefs -}}
+ {{- if eq $agentref.Category "nachruf" -}}
+ {{- $agent := GetAgent $agentref.Ref -}}
+ {{- if and $agent (gt (len $agent.Names) 0) -}}
+ {{- if not $obituaryPersonFound -}}
+ {{ Safe $fortsPrefix }}Nachruf auf
+ {{- else -}}
+ ,
+ {{- end -}}
+
{{ index $agent.Names 0 }}
+ {{- $obituaryPersonFound = true -}}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
+ {{- if $obituaryPersonFound -}}
+ {{ Safe $placeTag }}
+ {{- else -}}
+ {{- /* Default handling for pieces without special categories */ -}}
+ {{- if or (gt (len $authors) 0) (gt (len $translators) 0) (gt (len $editors) 0) -}}
+ {{- $hasCurrentActorAuthor := false -}}
+ {{- range $author := $authors -}}
+ {{- if eq $author.ID $currentActorID -}}
+ {{- $hasCurrentActorAuthor = true -}}
+ {{- end -}}
+ {{- end -}}
+ {{- $hasCurrentActorTranslator := false -}}
+ {{- range $translator := $translators -}}
+ {{- if eq $translator.ID $currentActorID -}}
+ {{- $hasCurrentActorTranslator = true -}}
+ {{- end -}}
+ {{- end -}}
+ {{- $hasCurrentActorEditor := false -}}
+ {{- range $editor := $editors -}}
+ {{- if eq $editor.ID $currentActorID -}}
+ {{- $hasCurrentActorEditor = true -}}
+ {{- end -}}
+ {{- end -}}
+ {{- /* Show other authors/translators/editors in prefix */ -}}
+ {{- if and $useColonFormat (or (not $hasCurrentActorAuthor) (not $hasCurrentActorTranslator) (not $hasCurrentActorEditor)) -}}
+ {{ Safe $fortsPrefix }}
+ {{- $authorElements := slice -}}
+ {{- range $author := $authors -}}
+ {{- if ne $author.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s" $author.ID $author.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $translator := $translators -}}
+ {{- if ne $translator.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s (Übers.)" $translator.ID $translator.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $editor := $editors -}}
+ {{- if ne $editor.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s (Hrsg.)" $editor.ID $editor.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $index, $element := $authorElements -}}
+ {{- if gt $index 0 }}, {{ end }}{{ Safe $element }}
+ {{- end -}}{{ $colonPrefix }}
+ {{- else if not $useColonFormat -}}
+ {{ Safe $fortsPrefix }}
+ {{- $authorElements := slice -}}
+ {{- range $author := $authors -}}
+ {{- if ne $author.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s" $author.ID $author.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $translator := $translators -}}
+ {{- if ne $translator.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s (Übers.)" $translator.ID $translator.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $editor := $editors -}}
+ {{- if ne $editor.ID $currentActorID -}}
+ {{- $authorElements = append $authorElements (printf "
%s (Hrsg.)" $editor.ID $editor.Name) -}}
+ {{- end -}}
+ {{- end -}}
+ {{- range $index, $element := $authorElements -}}
+ {{- if gt $index 0 }}, {{ end }}{{ Safe $element }}
+ {{- end -}}
+ {{- if gt (len $authorElements) 0 -}}
+ {{- if $title }}:
{{ $title }}{{ end }}{{ if $workTitle }}
+ {{ if $title }}, {{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
+
{{ $workAuthorName }}, {{ end }}
{{ $workTitle }}
+ {{ end }}
+ {{- else -}}
+ {{- if $title }}
{{ $title }}{{ end }}{{ if $workTitle }}
+ {{ if $title }}, {{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
+
{{ $workAuthorName }}, {{ end }}
{{ $workTitle }}
+ {{ end }}
+ {{- end -}}{{ Safe $placeTag }}
+ {{- else -}}
+ {{ Safe $fortsPrefix }}{{ if $title }}
{{ $title }}{{ end }}{{ if $workTitle }}
+ {{ if $title }}, {{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
+
{{ $workAuthorName }}, {{ end }}
{{ $workTitle }}
+ {{ end }}{{ Safe $placeTag }}
+ {{- end -}}
+ {{- else -}}
+ {{ Safe $fortsPrefix }}{{ if $title }}
{{ $title }}{{ end }}{{ if $workTitle }}
+ {{ if $title }}, {{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
+
{{ $workAuthorName }}, {{ end }}
{{ $workTitle }}
+ {{ else if not $title }}
+ Beitrag ohne Titel
+ {{ end }}{{ Safe $placeTag }}
+ {{- end -}}
+ {{- end -}}
+
+ {{- end -}}
+
+
+{{- if eq $displayMode "issue" -}}
+ {{- /* Only show annotations for issue view and non-continuation pieces */ -}}
+ {{- if not $isContinuation -}}
+ {{- range $annotation := $piece.AnnotationNote.Annotations -}}
+
+ {{ Safe $annotation.HTML }}
+
+ {{- end -}}
+ {{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/views/routes/ort/components/_place_pieces.gohtml b/views/routes/ort/components/_place_pieces.gohtml
index 9758474..33ed876 100644
--- a/views/routes/ort/components/_place_pieces.gohtml
+++ b/views/routes/ort/components/_place_pieces.gohtml
@@ -60,7 +60,7 @@
{{- /* Use first piece for display text with colon format for places */ -}}
- {{ template "_piece_summary_for_place" (dict "Piece" (index $groupedItems 0) "CurrentActorID" "") }}
+ {{ template "_unified_piece_entry" (dict "Piece" (index $groupedItems 0) "CurrentActorID" "" "DisplayMode" "place" "ShowPlaceTags" false "UseColonFormat" true "ShowContinuation" false) }}
{{- /* Show all citations from all pieces in this group inline with commas */ -}}
{{ " " }}{{- range $groupIndex, $groupItem := $groupedItems -}}
diff --git a/views/routes/piece/components/_piece_inhaltsverzeichnis.gohtml b/views/routes/piece/components/_piece_inhaltsverzeichnis.gohtml
index d6fb34e..e20cb1a 100644
--- a/views/routes/piece/components/_piece_inhaltsverzeichnis.gohtml
+++ b/views/routes/piece/components/_piece_inhaltsverzeichnis.gohtml
@@ -19,7 +19,7 @@
- {{ template "_inhaltsverzeichnis_eintrag" $firstPiece.PieceByIssue }}
+ {{ template "_unified_piece_entry" (dict "Piece" $firstPiece.PieceByIssue "DisplayMode" "piece" "ShowPlaceTags" true "UseColonFormat" false "ShowContinuation" true) }}
{{ end }}
@@ -88,7 +88,7 @@
{{ range $otherPiece := $pageEntry.OtherPieces }}
- {{ template "_inhaltsverzeichnis_eintrag" $otherPiece.PieceByIssue }}
+ {{ template "_unified_piece_entry" (dict "Piece" $otherPiece.PieceByIssue "DisplayMode" "piece" "ShowPlaceTags" true "UseColonFormat" false "ShowContinuation" true) }}
{{ end }}
{{ else }}