mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 17:15:31 +00:00
Some improvements with the akteure page
This commit is contained in:
@@ -1,144 +1,8 @@
|
||||
{{ $a := . }}
|
||||
{{ if and $a (ne (len $a.Names) 0) }}
|
||||
{{ $gnd := GetGND $a.GND }}
|
||||
{{ $works := LookupWorks $a }}
|
||||
{{ $pieces := LookupPieces $a }}
|
||||
<div>
|
||||
|
||||
<!-- Name and external links -->
|
||||
<div class="flex items-start justify-between gap-4">
|
||||
<div class="flex-1">
|
||||
<!-- Large serif name - bold -->
|
||||
<div class="text-xl font-serif font-bold text-gray-900 leading-tight">
|
||||
<a href="/akteure/{{ $a.ID }}" class="hover:text-blue-600 transition-colors">
|
||||
{{ index $a.Names 0 }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Years only below name -->
|
||||
{{ if ne $gnd nil }}
|
||||
{{- if or (ne (len $gnd.DateOfBirth) 0) (ne (len $gnd.DateOfDeath) 0) -}}
|
||||
<div class="text-gray-600 text-sm mt-1">
|
||||
{{- if ne (len $gnd.DateOfBirth) 0 -}}
|
||||
{{ HRDateYear (index $gnd.DateOfBirth 0) }}
|
||||
{{- end -}}
|
||||
{{- if ne (len $gnd.DateOfDeath) 0 -}}
|
||||
–{{ HRDateYear (index $gnd.DateOfDeath 0) }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
|
||||
<!-- First three professions -->
|
||||
{{ if ne $gnd nil }}
|
||||
{{- if ne (len $gnd.ProfessionOrOccupation) 0 -}}
|
||||
<div class="text-gray-600 text-sm mt-1">
|
||||
{{ range $i, $prof := $gnd.ProfessionOrOccupation }}
|
||||
{{ if lt $i 3 }}
|
||||
{{ if gt $i 0 }} · {{ end }}{{ $prof.Label }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<!-- External link symbols on the right -->
|
||||
<div class="flex gap-2 flex-shrink-0">
|
||||
{{- if ne $gnd nil -}}
|
||||
{{- /* Wikipedia link if available */ -}}
|
||||
{{- if ne (len $gnd.Wikipedia) 0 -}}
|
||||
<a href="{{ (index $gnd.Wikipedia 0).ID }}" target="_blank" class="text-gray-500 hover:text-blue-600 transition-colors text-lg" title="Wikipedia">
|
||||
<i class="ri-wikipedia-line"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* GND link if available */ -}}
|
||||
{{- if ne $a.GND "" -}}
|
||||
<a href="{{ $a.GND }}" target="_blank" class="text-gray-500 hover:text-blue-600 transition-colors text-lg" title="Gemeinsame Normdatei">
|
||||
<i class="ri-links-line"></i>
|
||||
</a>
|
||||
{{- else -}}
|
||||
{{- /* VIAF link if no GND available */ -}}
|
||||
{{- if ne (len $gnd.SameAs) 0 -}}
|
||||
{{ range $_, $ref := $gnd.SameAs }}
|
||||
{{- if ne $ref.ID "" -}}
|
||||
<a href="{{ $ref.ID }}" target="_blank" class="text-gray-500 hover:text-blue-600 transition-colors text-lg" title="External Link">
|
||||
<i class="ri-global-line"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{- if ne (len $works) 0 -}}
|
||||
<div class="mt-3">
|
||||
<div class="text-sm font-medium text-gray-700 mb-2">
|
||||
<i class="ri-book-line mr-1"></i>Werke
|
||||
</div>
|
||||
{{ range $_, $w := $works }}
|
||||
<div class="mb-2">
|
||||
{{- if ne (len $w.Item.Citation.InnerXML ) 0 -}}
|
||||
<div class="text-sm">
|
||||
<span class="italic">
|
||||
<script type="application/xml" xslt-template="transform-citation" xslt-onload>
|
||||
<xml>
|
||||
{{- Safe $w.Item.Citation.InnerXML -}}
|
||||
</xml>
|
||||
</script>
|
||||
</span>
|
||||
{{- range $_, $url := $w.Item.URLs -}}
|
||||
<span class="ml-1">
|
||||
<a href="{{ $url.Address }}" target="_blank" class="text-blue-600 hover:text-blue-800 text-sm">
|
||||
{{ $url.Chardata }} <i class="ri-external-link-line text-xs"></i>
|
||||
</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ $workPieces := LookupPieces $w.Item }}
|
||||
{{ if len $workPieces }}
|
||||
<div class="flex flex-wrap gap-1 mt-1">
|
||||
{{ range $_, $p := $workPieces }}
|
||||
{{ range $_, $issue := $p.Item.IssueRefs }}
|
||||
<span class="inline-block bg-green-50 hover:bg-green-100 text-green-700 hover:text-green-800 px-2 py-1 rounded text-xs transition-colors">
|
||||
{{ template "_citation" $issue }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ $pieces := LookupPieces $a }}
|
||||
{{ if ne (len $pieces) 0 }}
|
||||
<div class="mt-3">
|
||||
<div class="text-sm font-medium text-gray-700 mb-2">
|
||||
<i class="ri-newspaper-line mr-1"></i>Beiträge
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
{{ range $_, $p := SortPiecesByDate $pieces }}
|
||||
<div class="border-l-2 border-gray-200 pl-3">
|
||||
<div class="text-sm">
|
||||
{{ template "_piece_summary" $p.Item }}
|
||||
</div>
|
||||
<div class="mt-1 flex flex-wrap gap-1">
|
||||
{{ range $_, $issue := $p.Item.IssueRefs }}
|
||||
<span class="inline-block bg-green-50 hover:bg-green-100 text-green-700 hover:text-green-800 px-2 py-1 rounded text-xs transition-colors">
|
||||
{{ template "_citation" $issue }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ template "_akteur_header" $a }}
|
||||
{{ template "_akteur_werke" $a }}
|
||||
{{ template "_akteur_beitraege" $a }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
74
views/routes/components/_akteur_beitraege.gohtml
Normal file
74
views/routes/components/_akteur_beitraege.gohtml
Normal file
@@ -0,0 +1,74 @@
|
||||
{{ $a := . }}
|
||||
{{ $pieces := LookupPieces $a }}
|
||||
{{ if ne (len $pieces) 0 }}
|
||||
<div class="mt-8">
|
||||
<div class="px-4 py-3 rounded-lg mb-4">
|
||||
<h2 class="text-lg font-bold text-gray-900">
|
||||
<i class="ri-newspaper-line mr-2"></i>Beiträge
|
||||
</h2>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
{{- /* Group pieces by title and work reference */ -}}
|
||||
{{- $groupedPieces := dict -}}
|
||||
{{- range $_, $p := SortPiecesByDate $pieces -}}
|
||||
{{- $groupKey := "" -}}
|
||||
{{- if $p.Item.Title -}}
|
||||
{{- $groupKey = index $p.Item.Title 0 -}}
|
||||
{{- else if $p.Item.WorkRefs -}}
|
||||
{{- $work := GetWork (index $p.Item.WorkRefs 0).Ref -}}
|
||||
{{- if $work.PreferredTitle -}}
|
||||
{{- $groupKey = $work.PreferredTitle -}}
|
||||
{{- else if $work.Citation.Title -}}
|
||||
{{- $groupKey = $work.Citation.Title -}}
|
||||
{{- end -}}
|
||||
{{- else if $p.Item.Incipit -}}
|
||||
{{- $groupKey = index $p.Item.Incipit 0 -}}
|
||||
{{- else -}}
|
||||
{{- $groupKey = printf "untitled-%s" $p.Item.ID -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $existing := index $groupedPieces $groupKey -}}
|
||||
{{- if $existing -}}
|
||||
{{- $groupedPieces = merge $groupedPieces (dict $groupKey (append $existing $p)) -}}
|
||||
{{- else -}}
|
||||
{{- $groupedPieces = merge $groupedPieces (dict $groupKey (slice $p)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<div class="columns-2 gap-6">
|
||||
{{- /* Display grouped pieces */ -}}
|
||||
{{- range $groupKey, $groupedItems := $groupedPieces -}}
|
||||
<div class="border-l-2 border-gray-200 pl-4 break-inside-avoid">
|
||||
<div class="text-lg">
|
||||
{{- /* Use first piece for display text */ -}}
|
||||
{{ template "_piece_summary" (dict "Piece" (index $groupedItems 0).Item "CurrentActorID" $a.ID) }}
|
||||
|
||||
{{- /* Show all citations from all pieces in this group */ -}}
|
||||
{{- range $_, $groupItem := $groupedItems -}}
|
||||
{{- range $i, $issue := $groupItem.Item.IssueRefs -}}
|
||||
{{ $issueData := GetIssue (printf "%d-%d" $issue.When.Year $issue.Nr) }}
|
||||
{{- $url := printf "/%s/%d" $issue.When $issue.Nr -}}
|
||||
{{- if $issue.Von -}}
|
||||
{{- if $issue.Beilage -}}
|
||||
{{- $url = printf "%s#beilage-%d-page-%d" $url $issue.Beilage $issue.Von -}}
|
||||
{{- else -}}
|
||||
{{- $url = printf "%s/%d" $url $issue.Von -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<a href="{{ $url }}" class="inline-block text-sm bg-green-50 text-green-700 hover:bg-green-100 hover:text-green-800 px-3 py-2 rounded ml-2 no-underline">
|
||||
{{- if $issueData -}}
|
||||
{{ $issueData.Datum.When.Day }}.{{ $issueData.Datum.When.Month }}.{{ $issueData.Datum.When.Year }}/{{ $issue.Nr }}, S. {{ $issue.Von }}{{- if and $issue.Bis (ne $issue.Von $issue.Bis) }}-{{ $issue.Bis }}{{ end }}
|
||||
{{- else -}}
|
||||
{{ $issue.When.Day }}.{{ $issue.When.Month }}.{{ $issue.When.Year }}/{{ $issue.Nr }}, S. {{ $issue.Von }}{{- if and $issue.Bis (ne $issue.Von $issue.Bis) }}-{{ $issue.Bis }}{{ end }}
|
||||
{{- end -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
73
views/routes/components/_akteur_header.gohtml
Normal file
73
views/routes/components/_akteur_header.gohtml
Normal file
@@ -0,0 +1,73 @@
|
||||
{{ $a := . }}
|
||||
{{ if and $a (ne (len $a.Names) 0) }}
|
||||
{{ $gnd := GetGND $a.GND }}
|
||||
|
||||
<!-- Name and external links -->
|
||||
<div class="flex items-start justify-between gap-4">
|
||||
<div class="flex-1">
|
||||
<!-- Large serif name - bold -->
|
||||
<div class="text-2xl font-serif font-bold text-gray-900 leading-tight">
|
||||
<a href="/akteure/{{ $a.ID }}" class="hover:text-blue-600 transition-colors">
|
||||
{{ index $a.Names 0 }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Years only below name -->
|
||||
{{ if ne $gnd nil }}
|
||||
{{- if or (ne (len $gnd.DateOfBirth) 0) (ne (len $gnd.DateOfDeath) 0) -}}
|
||||
<div class="text-gray-600 text-xl mt-2">
|
||||
{{- if ne (len $gnd.DateOfBirth) 0 -}}
|
||||
{{ HRDateYear (index $gnd.DateOfBirth 0) }}
|
||||
{{- end -}}
|
||||
{{- if ne (len $gnd.DateOfDeath) 0 -}}
|
||||
–{{ HRDateYear (index $gnd.DateOfDeath 0) }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
|
||||
<!-- First three professions -->
|
||||
{{ if ne $gnd nil }}
|
||||
{{- if ne (len $gnd.ProfessionOrOccupation) 0 -}}
|
||||
<div class="text-gray-600 text-xl mt-2">
|
||||
{{ range $i, $prof := $gnd.ProfessionOrOccupation }}
|
||||
{{ if lt $i 3 }}
|
||||
{{ if gt $i 0 }} · {{ end }}{{ $prof.Label }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<!-- External link symbols on the right -->
|
||||
<div class="flex gap-2 flex-shrink-0">
|
||||
{{- if ne $gnd nil -}}
|
||||
{{- /* Wikipedia link if available */ -}}
|
||||
{{- if ne (len $gnd.Wikipedia) 0 -}}
|
||||
<a href="{{ (index $gnd.Wikipedia 0).ID }}" target="_blank" class="text-gray-500 hover:text-blue-600 transition-colors text-lg" title="Wikipedia">
|
||||
<i class="ri-wikipedia-line"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* GND link if available */ -}}
|
||||
{{- if ne $a.GND "" -}}
|
||||
<a href="{{ $a.GND }}" target="_blank" class="text-gray-500 hover:text-blue-600 transition-colors text-lg" title="Gemeinsame Normdatei">
|
||||
<i class="ri-links-line"></i>
|
||||
</a>
|
||||
{{- else -}}
|
||||
{{- /* VIAF link if no GND available */ -}}
|
||||
{{- if ne (len $gnd.SameAs) 0 -}}
|
||||
{{ range $_, $ref := $gnd.SameAs }}
|
||||
{{- if ne $ref.ID "" -}}
|
||||
<a href="{{ $ref.ID }}" target="_blank" class="text-gray-500 hover:text-blue-600 transition-colors text-lg" title="External Link">
|
||||
<i class="ri-global-line"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
188
views/routes/components/_akteur_werke.gohtml
Normal file
188
views/routes/components/_akteur_werke.gohtml
Normal file
@@ -0,0 +1,188 @@
|
||||
{{ $a := . }}
|
||||
{{ $works := LookupWorks $a }}
|
||||
{{- if ne (len $works) 0 -}}
|
||||
<div class="mt-8">
|
||||
<div class="px-4 py-3 rounded-lg mb-4">
|
||||
<h2 class="text-lg font-bold text-gray-900">
|
||||
<i class="ri-book-line mr-2"></i>Werke
|
||||
</h2>
|
||||
</div>
|
||||
<div class="columns-2 gap-6">
|
||||
{{ range $_, $w := $works }}
|
||||
<div class="mb-2 break-inside-avoid pl-4">
|
||||
{{- if ne (len $w.Item.Citation.InnerXML ) 0 -}}
|
||||
<div class="text-lg">
|
||||
<span class="italic">
|
||||
<script type="application/xml" xslt-template="transform-citation" xslt-onload>
|
||||
<xml>
|
||||
{{- Safe $w.Item.Citation.InnerXML -}}
|
||||
</xml>
|
||||
</script>
|
||||
</span>
|
||||
{{- range $_, $url := $w.Item.URLs -}}
|
||||
<span class="ml-1">
|
||||
<a href="{{ $url.Address }}" target="_blank" class="text-blue-600 hover:text-blue-800 text-sm">
|
||||
{{ $url.Chardata }} <i class="ri-external-link-line text-xs"></i>
|
||||
</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ $workPieces := LookupPieces $w.Item }}
|
||||
{{ if len $workPieces }}
|
||||
<div class="mt-1 text-lg">
|
||||
{{- /* Group pieces by category and display inline */ -}}
|
||||
{{- $groupedByCategory := dict -}}
|
||||
{{- range $_, $p := $workPieces -}}
|
||||
{{- $categoryFlags := GetCategoryFlags $p.Item -}}
|
||||
{{- $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 -}}
|
||||
{{- if eq (len $categories) 0 -}}
|
||||
{{- $categories = append $categories "Beitrag" -}}
|
||||
{{- end -}}
|
||||
{{- $categoryName := "" -}}
|
||||
{{- if eq (len $categories) 0 -}}
|
||||
{{- $categoryName = "Beitrag" -}}
|
||||
{{- else -}}
|
||||
{{- $sortedCategories := sortStrings $categories -}}
|
||||
{{- $categoryName = joinWithUnd $sortedCategories -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $existing := index $groupedByCategory $categoryName -}}
|
||||
{{- if $existing -}}
|
||||
{{- $groupedByCategory = merge $groupedByCategory (dict $categoryName (append $existing $p)) -}}
|
||||
{{- else -}}
|
||||
{{- $groupedByCategory = merge $groupedByCategory (dict $categoryName (slice $p)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Display each category group */ -}}
|
||||
{{- range $categoryName, $categoryPieces := $groupedByCategory -}}
|
||||
<span class="inline-block text-sm bg-green-50 text-green-700 px-3 py-2 rounded ml-2">
|
||||
{{ $categoryName }}
|
||||
{{- /* Check for additional authors (non-current actor) */ -}}
|
||||
{{- $additionalAuthorIDs := slice -}}
|
||||
{{- range $_, $p := $categoryPieces -}}
|
||||
{{- range $agentref := $p.Item.AgentRefs -}}
|
||||
{{- if and (or (eq $agentref.Category "") (eq $agentref.Category "autor")) (ne $agentref.Ref $a.ID) -}}
|
||||
{{- $additionalAuthorIDs = append $additionalAuthorIDs $agentref.Ref -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $uniqueAuthorIDs := unique $additionalAuthorIDs -}}
|
||||
{{- if $uniqueAuthorIDs -}}
|
||||
{{ " " }}von {{ range $i, $authorID := $uniqueAuthorIDs }}{{- if gt $i 0 }} und {{ end }}{{- $agent := GetAgent $authorID -}}{{- if and $agent (gt (len $agent.Names) 0) -}}<a href="/akteure/{{ $authorID }}" class="text-green-700 hover:text-green-900 underline text-sm font-bold">{{ index $agent.Names 0 }}</a>{{- end -}}{{ end }}
|
||||
{{- end -}}{{ ":" }}
|
||||
</span>
|
||||
{{- /* Show all citations for this category */ -}}
|
||||
{{- range $_, $p := $categoryPieces -}}
|
||||
{{- range $_, $issue := $p.Item.IssueRefs -}}
|
||||
{{ $issueData := GetIssue (printf "%d-%d" $issue.When.Year $issue.Nr) }}
|
||||
{{- $url := printf "/%s/%d" $issue.When $issue.Nr -}}
|
||||
{{- if $issue.Von -}}
|
||||
{{- if $issue.Beilage -}}
|
||||
{{- $url = printf "%s#beilage-%d-page-%d" $url $issue.Beilage $issue.Von -}}
|
||||
{{- else -}}
|
||||
{{- $url = printf "%s/%d" $url $issue.Von -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<a href="{{ $url }}" class="inline-block text-sm bg-blue-50 text-blue-700 hover:bg-blue-100 hover:text-blue-800 px-3 py-2 rounded ml-2 no-underline">
|
||||
{{- if $issueData -}}
|
||||
{{ $issueData.Datum.When.Day }}.{{ $issueData.Datum.When.Month }}.{{ $issueData.Datum.When.Year }}/{{ $issue.Nr }}, S. {{ $issue.Von }}{{- if and $issue.Bis (ne $issue.Von $issue.Bis) }}-{{ $issue.Bis }}{{ end }}
|
||||
{{- else -}}
|
||||
{{ $issue.When.Day }}.{{ $issue.When.Month }}.{{ $issue.When.Year }}/{{ $issue.Nr }}, S. {{ $issue.Von }}{{- if and $issue.Bis (ne $issue.Von $issue.Bis) }}-{{ $issue.Bis }}{{ end }}
|
||||
{{- end -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -1,4 +1,5 @@
|
||||
{{- $piece := . -}}
|
||||
{{- $piece := .Piece -}}
|
||||
{{- $currentActorID := .CurrentActorID -}}
|
||||
|
||||
<div class="leading-snug">
|
||||
{{- $categoryFlags := GetCategoryFlags $piece -}}
|
||||
@@ -42,14 +43,113 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Generate piece descriptions */ -}}
|
||||
{{- /* 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" -}}
|
||||
{{- $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) -}}
|
||||
<a href="/akteure/{{ $agentref.Ref }}" class="text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a>, Rezension von:
|
||||
{{- if ne $agentref.Ref $currentActorID -}}
|
||||
<a href="/akteure/{{ $agentref.Ref }}" class="text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a>,
|
||||
{{- end -}}
|
||||
{{ $categoryName }} von:
|
||||
{{ if $workAuthorName }}
|
||||
<a href="/akteure/{{ $workAuthorID }}" class="text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>,
|
||||
{{ end }}
|
||||
@@ -66,7 +166,7 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
Rezension von:
|
||||
{{ $categoryName }} von:
|
||||
{{ if $workAuthorName }}
|
||||
<a href="/akteure/{{ $workAuthorID }}" class="text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>,
|
||||
{{ end }}
|
||||
@@ -79,104 +179,24 @@
|
||||
{{ end }}
|
||||
{{- 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) -}}
|
||||
<a href="/akteure/{{ $agentref.Ref }}" class="text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a>, Gedicht{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- $authorFound = true -}}
|
||||
{{- break -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
Gedicht{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- 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) -}}
|
||||
<a href="/akteure/{{ $agentref.Ref }}" class="text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a>, Aufsatz{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- $authorFound = true -}}
|
||||
{{- break -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
Aufsatz{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- 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) -}}
|
||||
<a href="/akteure/{{ $agentref.Ref }}" class="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>{{ else if $title }} zu <em>{{ $title }}</em>{{ end }}
|
||||
{{- $authorFound = true -}}
|
||||
{{- break -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
Theaterkritik{{ if $workTitle }} zu <em>{{ $workTitle }}</em>{{ else if $title }} zu <em>{{ $title }}</em>{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- else if $categoryFlags.Brief -}}
|
||||
{{ if $categoryFlags.Nachruf }}Kondolenzbrief{{ else }}Leserbrief{{ end }}
|
||||
{{- 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="text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a>
|
||||
{{- break -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- 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) -}}
|
||||
<a href="/akteure/{{ $agentref.Ref }}" class="text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a>, Erzählung{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- $authorFound = true -}}
|
||||
{{- break -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
Erzählung{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- else if $categoryFlags.Lokalnachrichten -}}
|
||||
{{ if $categoryFlags.Lotterie }}Lotterienachrichten{{ else if $categoryFlags.Nachruf }}Nachrufe{{ else if $categoryFlags.Theaterkritik }}Theaternachrichten{{ else }}Lokalnachrichten{{ end }}
|
||||
|
||||
{{- else if $categoryFlags.Weltnachrichten -}}
|
||||
Politische Nachrichten aus aller Welt
|
||||
|
||||
{{- 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) -}}
|
||||
<a href="/akteure/{{ $agentref.Ref }}" class="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 ne $agentref.Ref $currentActorID -}}
|
||||
<a href="/akteure/{{ $agentref.Ref }}" class="text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a>,
|
||||
{{- end -}}
|
||||
{{ $categoryName }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- $authorFound = true -}}
|
||||
{{- break -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
{{ if $title }}<em>{{ $title }}</em>{{ else }}Beitrag ohne Titel{{ end }}
|
||||
{{ $categoryName }}{{ if $title }}: <em>„{{ $title }}"</em>{{ else if eq $categoryName "Beitrag" }} ohne Titel{{ end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $place }} <span class="inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md ml-1 whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user