More CSS & sorting of T array by keys

This commit is contained in:
Simon Martens
2025-01-16 16:19:19 +01:00
parent e88bb5974a
commit ff310265e4
10 changed files with 190 additions and 40 deletions

File diff suppressed because one or more lines are too long

View File

@@ -16,18 +16,20 @@
<div class="grid grid-cols-11 gap-x-2 gap-y-4 pt-8">
{{ range $index, $month := .model.Issues }}
<!-- Month Header -->
<div class="col-span-1 text-right py-1 px-2.5">
<!-- Month Header -->
{{ $first := index $month 0 }}
<h2 class="text-lg">{{ (MonthName $first.Datum.When.Month) }}</h2>
</div>
<!-- Issues -->
<div class="col-span-10 grid grid-cols-subgrid">
{{ range $issue := $month }}
<div class="col-span-1 bg-slate-100 px-2 py-1.5">
{{ $date := $issue.Datum.When }}
<a class="!no-underline" href="/{{ $y }}/{{ $issue.Number.No }}">
<div>
<div class="">
{{ $issue.Number.No }}
</div>

View File

@@ -58,6 +58,19 @@
<a href="{{ $url.Address }}" target="_blank">{{ $url.Chardata }}</a>
</div>
{{ end }}
{{ $pieces := LookupPieces $w.Item }}
{{ if len $pieces }}
<div>
{{ range $_, $p := $pieces }}
{{- range $_, $i := $p.Item.IssueRefs -}}
<div>
<a href="/{{ $i.When }}/{{ $i.Nr }}">{{ $i.Nr }}/{{ $i.When }}</a>
</div>
{{- end -}}
{{ end }}
</div>
{{ end }}
{{ end }}
</div>
{{ end }}

View File

@@ -1,16 +1,15 @@
{{ $model := .model }}
<div>Inhalt</div>
<div>
{{ range $page := $model.Pieces.Pages }}
<div>
<div>Seite {{ $page }}</div>
<div class="pt-4">
<div class="">Seite {{ $page }}</div>
<ol class="list-disc" >
{{ range $piece := (index $model.Pieces.Items $page) }}
<li class="ml-0" >
{{ template "_inhaltsverzeichnis_eintrag" $piece }}
<!-- Links zu anderen Teilen: -->
{{ if gt (len $piece.IssueRefs) 1 }}
<div>
@@ -33,9 +32,11 @@
</ol>
</div>
{{ end }}
</li>
{{ end }}
<!-- Pages end -->
</div>
{{ end }}
</div>

View File

@@ -1,20 +1,50 @@
{{ $piece := . }}
Eintrag!
<!-- Autor(en) -->
{{ $authorset := false }}
<div class="authors">
{{ range $agentref := $piece.AgentRefs }}
{{ if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) }}
{{ $agent := GetAgent $agentref.Ref }}
<!-- NOT IMPLEMENTED: Multiple agent names -->
{{- if gt (len $agent.Names) 0 -}}
<div class="author inline-block">{{- index $agent.Names 0 -}}</div>
{{ if $piece.AgentRefs }}
<div class="authors">
{{ range $agentref := $piece.AgentRefs }}
{{ if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) }}
{{ $agent := GetAgent $agentref.Ref }}
{{- if gt (len $agent.Names) 0 -}}
<a href="/akteure/{{ $agentref.Ref }}" class="inline-block">
{{- index $agent.Names 0 -}}
</a>
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
<!-- Kategorien -->
<div class="">
<!-- Einzelkategorien -->
{{ if $piece.CategoryRefs }}
{{ range $catref := $piece.CategoryRefs }}
{{ $category := GetCategory $catref.Ref }}
{{- if gt (len $category.Names) 0 -}}
<div class="category inline-block">{{- index $category.Names 0 -}}</div>
{{ end }}
{{ end }}
{{ end }}
<!-- Kategorie Werk -->
{{ if $piece.WorkRefs }}
{{ range $workref := $piece.WorkRefs }}
{{ $work := GetWork $workref.Ref }}
{{- if $work.PreferredTitle -}}
<div class="category inline-block">{{- index $work.PreferredTitle -}}</div>
{{- else if $work.Citation.Title -}}
<div class="category inline-block">{{- index $work.Citation.Title -}}</div>
{{ end }}
{{ end }}
{{ end }}
</div>
<!-- Notizen -->
{{ range $annotation := $piece.AnnotationNote.Annotations }}
<div>
{{ $annotation.Inner.InnerXML }}