Files
kgpz_web/views/routes/components/_akteur_header.gohtml
2025-09-21 23:54:03 +02:00

75 lines
2.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{ $a := . }}
{{ if and $a (ne (len $a.Names) 0) }}
{{ $gnd := GetGND $a.GND }}
<!-- Name and external links -->
<div class="flex items-start justify-between gap-4">
<div class="flex-1">
<!-- Large serif name - bold with inline permalink icon -->
<div class="text-xl font-serif font-bold mb-1 flex items-center gap-2">
<span>{{ index $a.Names 0 }}</span>
<a href="/akteure/{{ $a.ID }}" class="text-gray-500 hover:text-blue-600 transition-colors no-underline" title="Permalink zu {{ index $a.Names 0 }}">
<i class="ri-link text-base"></i>
</a>
</div>
<!-- Years ONLY below name -->
{{ if ne $gnd nil }}
{{- if or (ne (len $gnd.DateOfBirth) 0) (ne (len $gnd.DateOfDeath) 0) -}}
<div class="text-gray-800">
{{- if ne (len $gnd.DateOfBirth) 0 -}}
{{ HRDateYear (index $gnd.DateOfBirth 0) }}
{{- end -}}
{{- if ne (len $gnd.DateOfDeath) 0 -}}
{{ HRDateYear (index $gnd.DateOfDeath 0) }}
{{- end -}}
</div>
{{- end -}}
{{ end }}
<!-- First three professions -->
{{ if ne $gnd nil }}
{{- if ne (len $gnd.ProfessionOrOccupation) 0 -}}
<div class="text-gray-800">
{{ range $i, $prof := $gnd.ProfessionOrOccupation }}
{{ if lt $i 3 }}
{{ if gt $i 0 }} · {{ end }}{{ $prof.Label }}
{{ end }}
{{ end }}
</div>
{{- end -}}
{{ end }}
</div>
<!-- External link symbols on the right -->
<div class="flex gap-3 flex-shrink-0 items-center">
{{- if ne $gnd nil -}}
{{- /* Wikipedia link if available */ -}}
{{- if ne (len $gnd.Wikipedia) 0 -}}
<a href="{{ (index $gnd.Wikipedia 0).ID }}" target="_blank" class="hover:opacity-80 transition-opacity" title="Wikipedia">
<img src="/assets/wikipedia.png" alt="Wikipedia" class="w-6 h-6">
</a>
{{- end -}}
{{- /* GND link if available */ -}}
{{- if ne $a.GND "" -}}
<a href="{{ $a.GND }}" target="_blank" class="hover:opacity-80 transition-opacity" title="Gemeinsame Normdatei">
<img src="/assets/GND.png" alt="GND" class="w-6 h-6">
</a>
{{- else -}}
{{- /* VIAF link if no GND available */ -}}
{{- if ne (len $gnd.SameAs) 0 -}}
{{ range $_, $ref := $gnd.SameAs }}
{{- if ne $ref.ID "" -}}
<a href="{{ $ref.ID }}" target="_blank" class="text-gray-500 hover:text-blue-600 transition-colors" title="External Link">
<i class="ri-global-line"></i>
</a>
{{- end -}}
{{ end }}
{{- end -}}
{{- end -}}
{{- end -}}
</div>
</div>
{{ end }}