This commit is contained in:
Simon Martens
2025-09-28 11:59:58 +02:00
parent adc45f2212
commit e8855a6c3c
13 changed files with 1478 additions and 198 deletions

View File

@@ -134,7 +134,7 @@
{{- /* Author prefix for colon format (place view) */ -}}
{{- $colonPrefix := "" -}}
{{- if $useColonFormat -}}
{{- $colonPrefix = ":" -}}
{{- $colonPrefix = ", " -}}
{{- else -}}
{{- $colonPrefix = " mit " -}}
{{- end -}}

View File

@@ -1,7 +1,7 @@
{{- /* Associated pieces section for place detail view */ -}}
<!-- Associated Pieces -->
<div>
<h2 class="text-xl font-semibold text-slate-800 mb-4">
<div class="mt-2">
<h2 class="font-bold mb-4">
<i class="ri-newspaper-line mr-2"></i><u class="decoration underline-offset-3">Verlinkte Beiträge</u> ({{ len .Pieces }})
</h2>
@@ -27,13 +27,13 @@
{{- end -}}
{{- $sortedYears = sortStrings $sortedYears -}}
<div class="space-y-6 max-w-[85ch]">
<div class="columns-2 gap-6 hyphens-auto">
{{- range $year := $sortedYears -}}
{{- $yearPieces := index $piecesByYear $year -}}
<!-- Year Header -->
<div>
<h3 class="text-lg font-bold font-serif text-slate-800 mb-3">{{ $year }}</h3>
<div class="break-inside-avoid mb-6">
<h3 class="font-bold font-serif text-slate-800 mb-1">{{ $year }}</h3>
<div class="space-y-1">
{{- /* Group pieces by title within each year */ -}}
@@ -57,8 +57,8 @@
{{- end -}}
{{- range $groupKey, $groupedItems := $groupedPieces -}}
<div>
<div class="pb-1 text-lg indent-4">
<div class="break-inside-avoid">
<div class="pb-1 indent-4">
{{- /* Use first piece for display text with colon format for places */ -}}
{{ template "_unified_piece_entry" (dict "Piece" (index $groupedItems 0) "CurrentActorID" "" "DisplayMode" "place" "ShowPlaceTags" false "UseColonFormat" true "ShowContinuation" false) }}
@@ -78,7 +78,8 @@
{{- if gt (len $firstGroupItem.IssueRefs) 1 -}}
{{ " " }}<div class="inline-flex items-center gap-1 px-2 py-1 bg-blue-50
hover:bg-blue-100 text-blue-700 hover:text-blue-800 border border-blue-200
hover:border-blue-300 rounded text-xs font-medium transition-colors duration-200">
hover:border-blue-300 rounded text-xs font-medium transition-colors duration-200
indent-0">
<i class="ri-file-copy-2-line text-xs"></i>
<a href="{{ GetPieceURL $firstGroupItem.ID }}" class="">
Ganzer Beitrag

View File

@@ -1,4 +1,4 @@
{{- /* Fragment with specific class for HTMX selection */ -}}
<div class="place-fragment-content p-4 border-t border-slate-200 bg-slate-50">
<div class="place-fragment-content p-4 border-t border-slate-200 bg-slate-50 text-base">
{{ template "_place_pieces" .model.SelectedPlace }}
</div>

View File

@@ -1,10 +1,10 @@
{{- /* Places overview page body */ -}}
<div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
<div class="grid grid-cols-1 lg:grid-cols-7 gap-8">
{{- /* Main content - Places list */ -}}
<div class="lg:col-span-3">
<div class="lg:col-span-5">
{{- /* Places list */ -}}
{{ if .model.Places }}
<div class="bg-white border border-slate-200 rounded-lg mt-6">
<div class="bg-white mt-6">
{{ range $placeID := .model.Sorted }}
{{ $place := index $.model.Places $placeID }}
{{ $pieceCount := index $.model.PlacePieceCounts $placeID }}
@@ -20,7 +20,7 @@
<div class="block p-4 hover:bg-slate-50 transition-colors duration-200 cursor-pointer">
<div class="flex items-start justify-between gap-2">
<div class="flex-1 min-w-0">
<h3 class="font-medium text-slate-800 mb-1 truncate">
<h3 class="font-bold text-slate-800 mb-1 truncate">
{{ if $place.Names }}
{{ index $place.Names 0 }}
{{ else }}
@@ -41,6 +41,24 @@
{{ end }}
</div>
<div class="flex-shrink-0 flex items-center gap-2">
<!-- External links -->
{{ if ne $geonames nil }}
{{ if ne $geonames.WikipediaURL "" }}
<a href="https://{{ $geonames.WikipediaURL }}" target="_blank" class="hover:opacity-80 transition-opacity no-underline" title="Wikipedia" onclick="event.stopPropagation()">
<img src="/assets/wikipedia.png" alt="Wikipedia" class="w-5 h-5">
</a>
{{ end }}
{{ if and (ne $geonames.Lat "") (ne $geonames.Lng "") }}
<a href="https://www.openstreetmap.org/?mlat={{ $geonames.Lat }}&mlon={{ $geonames.Lng }}&zoom=12" target="_blank" class="hover:opacity-80 transition-opacity no-underline" title="OpenStreetMap" onclick="event.stopPropagation()">
<i class="ri-map-pin-line text-base text-green-600"></i>
</a>
{{ end }}
{{ end }}
{{ if $place.Geo }}
<a href="{{ $place.Geo }}" target="_blank" class="hover:opacity-80 transition-opacity no-underline" title="Geonames" onclick="event.stopPropagation()">
<i class="ri-global-line text-base text-blue-600"></i>
</a>
{{ end }}
<span class="inline-flex items-center px-2 py-1 text-xs font-medium bg-slate-100 text-slate-700 rounded">
{{ $pieceCount }}
</span>
@@ -65,49 +83,34 @@
</div>
{{- /* Sidebar */ -}}
<div class="lg:col-span-1 sticky top-0 self-start">
<div class="bg-slate-50 p-6 filter-sidebar">
<h1 class="text-2xl font-bold text-slate-800 mb-4">Orte</h1>
<div class="lg:col-span-2 sticky top-0 self-start">
{{- /* Top Section - Title, Description, Search */ -}}
<div class="bg-slate-50 p-6 border-b border-slate-200 filter-sidebar">
<h1 class="text-2xl font-bold text-slate-800 mb-2">Orte</h1>
<p class="text-slate-600 mb-6">
Verzeichnis aller in der Zeitung erwähnten Orte und Lokalitäten
</p>
{{- /* Search Filter */ -}}
<div class="mb-4">
<generic-filter
placeholder="Ortsnamen eingeben..."
item-selector="[data-place-name]"
search-attributes="data-place-name,data-modern-name"
count-selector="[data-filter-count]"
item-type="Orte"
item-type-singular="Ort">
</generic-filter>
</div>
<div class="text-sm text-slate-700 mb-4" data-filter-count>
Alle Orte ({{ len .model.Places }})
<div class="flex items-center gap-4">
<div class="flex-1">
<generic-filter
placeholder="Ortsnamen eingeben..."
item-selector="[data-place-name]"
search-attributes="data-place-name,data-modern-name"
count-selector="[data-filter-count]"
item-type="Orte"
item-type-singular="Ort">
</generic-filter>
</div>
<div class="flex items-center text-sm font-bold text-slate-700 whitespace-nowrap" data-filter-count></div>
</div>
</div>
{{- /* Statistics */ -}}
<div class="bg-slate-50 border border-slate-200 rounded-lg p-4 mt-4">
<div class="text-sm text-slate-700 space-y-2">
<div class="flex justify-between">
<span>Orte gesamt:</span>
<span class="font-medium">{{ len .model.Places }}</span>
</div>
<div class="flex justify-between">
<span>Beiträge mit Ort:</span>
<span class="font-medium">{{ .model.TotalPiecesWithPlaces }}</span>
</div>
{{- if .model.SelectedPlace -}}
<div class="flex justify-between">
<span>Beiträge hier:</span>
<span class="font-medium">{{ len .model.SelectedPlace.Pieces }}</span>
</div>
{{- end -}}
</div>
{{- /* Bottom Section - Map */ -}}
<div class="bg-white p-6">
<places-map data-places="{{ .model.PlacesJSON }}" class="w-full"></places-map>
</div>
</div>
</div>