mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 09:05:30 +00:00
185 lines
7.8 KiB
Plaintext
185 lines
7.8 KiB
Plaintext
{{ $a := . }}
|
|
{{ $works := LookupWorks $a }}
|
|
{{- if ne (len $works) 0 -}}
|
|
<div class="mt-4 akteur-werke-section">
|
|
<div class="py-1 rounded-lg mb-1">
|
|
<h2 class="text-lg font-bold">
|
|
<i class="ri-book-line mr-2"></i><u class="decoration underline-offset-3">Werke</u>
|
|
</h2>
|
|
</div>
|
|
<div class="">
|
|
{{ range $_, $w := $works }}
|
|
<div class="mb-1.5 break-inside-avoid max-w-[95ch]">
|
|
{{- if ne (len $w.Item.Citation.InnerXML ) 0 -}}
|
|
<div class="text-lg indent-6">
|
|
{{- Safe $w.Item.Citation.HTML -}}
|
|
{{- range $_, $url := $w.Item.URLs -}}
|
|
<span class="ml-1 whitespace-nowrap">
|
|
<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 -}}
|
|
<div>
|
|
<span class="inline-block">
|
|
{{ $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="">{{ 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-blue-700 hover:text-blue-800 rounded ml-2 ">
|
|
{{- 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>
|
|
{{- end -}}
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
{{ end }}
|