mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 17:25:32 +00:00
Introduced templating and views
This commit is contained in:
1
views/routes/body.gohtml
Normal file
1
views/routes/body.gohtml
Normal file
@@ -0,0 +1 @@
|
||||
Hello from the root remplate!
|
||||
92
views/routes/components/_akteur.gohtml
Normal file
92
views/routes/components/_akteur.gohtml
Normal file
@@ -0,0 +1,92 @@
|
||||
{{ $a := . }}
|
||||
{{ if and $a (ne (len $a.Names) 0) }}
|
||||
<div class="pb-4">
|
||||
{{ index $a.Names 0 }}
|
||||
<div>
|
||||
{{ $gnd := GetGND $a.GND }}
|
||||
{{ if (ne $gnd nil) }}
|
||||
{{- if ne (len $gnd.DateOfBirth) 0 -}}
|
||||
<i class="ri-asterisk text-xs relative bottom-0.5"></i>
|
||||
{{- HRDateShort (index $gnd.DateOfBirth 0) -}}
|
||||
{{- end -}}
|
||||
{{- if ne (len $gnd.DateOfDeath) 0 }}
|
||||
 <i class="ri-cross-fill text-xs relative bottom-0.5"></i
|
||||
> {{ HRDateShort (index $gnd.DateOfDeath 0) }}
|
||||
{{ end }}
|
||||
{{- if ne (len $gnd.ProfessionOrOccupation) 0 -}}
|
||||
<div>
|
||||
{{- (index $gnd.ProfessionOrOccupation 0).Label -}}
|
||||
{{- if gt (len $gnd.ProfessionOrOccupation) 1 -}}
|
||||
,
|
||||
{{ (index $gnd.ProfessionOrOccupation 1).Label -}}
|
||||
{{ end -}}
|
||||
{{- if gt (len $gnd.ProfessionOrOccupation) 2 -}}
|
||||
,
|
||||
{{ (index $gnd.ProfessionOrOccupation 2).Label -}}
|
||||
{{ end -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<div class="flex gap-x-2 flex-row">
|
||||
<a href="/akteure/{{ $a.ID }}" class="no-underline!"><i class="ri-links-line"></i></a>
|
||||
|
||||
{{- if ne $gnd nil -}}
|
||||
<a href="{{ $a.GND }}" target="_blank">GND →</a>
|
||||
{{- if ne (len $gnd.Wikipedia) 0 -}}
|
||||
<a href="{{ (index $gnd.Wikipedia 0).Label }}" target="_blank">WIKI →</a>
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ $works := LookupWorks $a }}
|
||||
{{- if ne (len $works) 0 -}}
|
||||
<div>
|
||||
{{ range $_, $w := $works }}
|
||||
{{- if ne (len $w.Item.Citation.InnerXML ) 0 -}}
|
||||
<script type="application/xml" xslt-template="transform-citation" xslt-onload>
|
||||
<xml>
|
||||
{{- Safe $w.Item.Citation.InnerXML -}}
|
||||
</xml>
|
||||
</script>
|
||||
{{- end -}}
|
||||
{{ range $_, $url := $w.Item.URLs }}
|
||||
<div>
|
||||
<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 }}
|
||||
|
||||
{{ $pieces := LookupPieces $a }}
|
||||
{{- if ne (len $pieces) 0 -}}
|
||||
<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 }}
|
||||
|
||||
</div>
|
||||
{{ end }}
|
||||
0
views/routes/datenschutz/body.gohtml
Normal file
0
views/routes/datenschutz/body.gohtml
Normal file
1
views/routes/datenschutz/head.gohtml
Normal file
1
views/routes/datenschutz/head.gohtml
Normal file
@@ -0,0 +1 @@
|
||||
<title>KGPZ – Impressum & Datenschutz</title>
|
||||
1
views/routes/head.gohtml
Normal file
1
views/routes/head.gohtml
Normal file
@@ -0,0 +1 @@
|
||||
<title>Musenalm</title>
|
||||
Reference in New Issue
Block a user