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

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 }}