Single person page + reihen list

This commit is contained in:
Simon Martens
2025-02-23 19:27:26 +01:00
parent d8a01bfffb
commit 2ef3eda244
24 changed files with 802 additions and 133 deletions

View File

@@ -1,14 +1,57 @@
{{ $model := . }}
{{ if .entries }}
<h2>Bände nach Riehentiteln</h2>
{{ range $id, $r := .series }}
<div>
{{ template "_reihe" (Arr $model $r) }}
<div class="container-normal font-serif">
{{ if $model.a.CorporateBody }}
<div class="notifier font-sans">
<i class="ri-team-line"></i>
<span class="filtercategory">Verlag, Druckerei oder Vertrieb</span>
</div>
{{ else }}
<div class="notifier font-sans">
<i class="ri-user-line"></i>
<span class="filtercategory">Person</span>
</div>
{{ end }}
{{ else }}
<div>Keine Bände</div>
<h1 class="text-3xl font-bold">{{ $model.a.Name }}</h1>
<div>
<span class="">
{{ $model.a.BiographicalData }}
</span>
<span class="">
{{- $arr := $model.a.ProfessionArray -}}
{{- if $arr -}}
{{- range $i, $p := $arr -}}
<div
class="inline-block align-middle bg-slate-200 px-2 font-sans text-sm py-0.5 rounded mx-1">
{{- $p -}}
</div>
{{- end -}}
{{- end -}}
</span>
</div>
</div>
{{ if .entries }}
<div class="container-normal flex flex-col font-serif mt-7 gap-y-6">
<h2>Bände nach Reihentiteln</h2>
{{ range $id, $r := .series }}
<div class="grow-0 max-w-[48rem]">
<div>
<span class="font-bold">{{ $r.Title }}</span>
</div>
{{ if $r.Annotation }}
<div class="max-w-[48rem]">
<span class="">{{ Safe $r.Annotation }}</span>
</div>
{{ end }}
<div class="">
{{- $bds := index $model.relations $r.Id -}}
{{ template "reiherelations" (Arr $r $bds $model.entries true $model.relations) }}
</div>
</div>
{{ end }}
</div>
{{ end }}
{{ if .contents }}

View File

@@ -0,0 +1,51 @@
{{ $reihe := index . 0 }}
{{ $rels := index . 1 }}
{{ $entries := index . 2 }}
{{ $shownos := index . 3 }}
{{- if $rels -}}
<div class="reiherelations flex flex-col text-base font-sans w-full pt-1 -ml-3">
{{- range $_, $rel := $rels -}}
{{- $bd := index $entries $rel.Entry -}}
{{- if $bd -}}
<div class="flex flex-row odd:bg-zinc-100 px-3 py-0.5 justify-between w-full">
<a href="/almanach/{{ $bd.MusenalmID }}" class="no-underline">
<div class="">
{{- if $bd.PreferredTitle -}}
{{ $bd.PreferredTitle }}
{{- else if ne $bd.Year 0 -}}
{{- $bd.Year -}}
{{- else -}}
[o.J.]
{{- end -}}
</div>
{{- if not (eq $rel.Type "Bevorzugter Reihentitel") -}}
<div class="text-xs whitespace-nowrap">
{{- if eq $rel.Type "Früherer Reihentitel" -}}
Titelauflage aus einer anderen Reihe
{{- else if eq $rel.Type "Späterer Reihentitel" -}}
Titelauflage
{{- else if eq $rel.Type "In anderer Sprache" -}}
{{- if Contains $bd.Language "ger" -}}
In deutscher Sprache
{{- else -}}
In französischer Sprache
{{- end -}}
{{- else -}}
{{ $rel.Type }}
{{- end -}}
</div>
{{- end -}}
</a>
<div class="whitespace-nowrap align-top">
Alm
{{ $bd.MusenalmID }}
</div>
</div>
{{- end -}}
{{- end -}}
</div>
{{- end -}}