mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-30 17:45:30 +00:00
+Startseite u. Suche Baic styling
This commit is contained in:
62
views/routes/components/_page_action_buttons.gohtml
Normal file
62
views/routes/components/_page_action_buttons.gohtml
Normal file
@@ -0,0 +1,62 @@
|
||||
{{- /*
|
||||
Shared Page Action Buttons Component
|
||||
Action buttons for page sharing, citation, and enlargement
|
||||
|
||||
Usage: {{ template "_page_action_buttons" (dict
|
||||
"PageNumber" $pageNumber
|
||||
"IsBeilage" $isBeilage
|
||||
"PartNumber" $partNumber
|
||||
"ImageElement" $imageElement
|
||||
"ButtonSize" "small|medium"
|
||||
"ShowZoom" true|false
|
||||
) }}
|
||||
|
||||
Parameters:
|
||||
- PageNumber: The page number
|
||||
- IsBeilage: Whether this is a Beilage page (default: false)
|
||||
- PartNumber: Part number for piece view (optional)
|
||||
- ImageElement: CSS selector for the image element to enlarge (e.g., ".piece-page-image")
|
||||
- ButtonSize: "small" for 6x6, "medium" for larger buttons (default: "small")
|
||||
- ShowZoom: Whether to show the zoom button (default: true)
|
||||
*/ -}}
|
||||
|
||||
{{- $pageNumber := .PageNumber -}}
|
||||
{{- $isBeilage := .IsBeilage -}}
|
||||
{{- if eq $isBeilage nil -}}{{ $isBeilage = false }}{{- end -}}
|
||||
{{- $partNumber := .PartNumber -}}
|
||||
{{- $imageElement := .ImageElement -}}
|
||||
{{- if not $imageElement -}}{{ $imageElement = ".newspaper-page-image, .piece-page-image" }}{{- end -}}
|
||||
{{- $buttonSize := .ButtonSize -}}
|
||||
{{- if not $buttonSize -}}{{ $buttonSize = "small" }}{{- end -}}
|
||||
{{- $showZoom := .ShowZoom -}}
|
||||
{{- if eq $showZoom nil -}}{{ $showZoom = true }}{{- end -}}
|
||||
|
||||
{{- $sizeClasses := "w-6 h-6" -}}
|
||||
{{- $iconSize := "text-xs" -}}
|
||||
{{- if eq $buttonSize "medium" -}}
|
||||
{{- $sizeClasses = "w-8 h-8" -}}
|
||||
{{- $iconSize = "text-sm" -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Share Link Button -->
|
||||
<button onclick="copyPagePermalink('{{ $pageNumber }}', this{{ if $isBeilage }}, true{{ end }})"
|
||||
class="{{ $sizeClasses }} bg-blue-100 hover:bg-blue-200 text-blue-700 border border-blue-300 rounded flex items-center justify-center transition-colors duration-200 cursor-pointer"
|
||||
title="Link zu Seite {{ $pageNumber }} kopieren">
|
||||
<i class="ri-share-line {{ $iconSize }}"></i>
|
||||
</button>
|
||||
|
||||
<!-- Citation Button -->
|
||||
<button onclick="generatePageCitation('{{ $pageNumber }}', this)"
|
||||
class="{{ $sizeClasses }} bg-green-100 hover:bg-green-200 text-green-700 border border-green-300 rounded flex items-center justify-center transition-colors duration-200 cursor-pointer"
|
||||
title="Zitation für Seite {{ $pageNumber }} generieren">
|
||||
<i class="ri-file-text-line {{ $iconSize }}"></i>
|
||||
</button>
|
||||
|
||||
<!-- Zoom/Enlarge Button -->
|
||||
{{ if $showZoom }}
|
||||
<button onclick="enlargePage(document.querySelector('{{ $imageElement }}'), {{ $pageNumber }}, false{{ if $partNumber }}, {{ $partNumber }}{{ end }})"
|
||||
class="{{ $sizeClasses }} bg-purple-100 hover:bg-purple-200 text-purple-700 border border-purple-300 rounded flex items-center justify-center transition-colors duration-200 cursor-pointer"
|
||||
title="Seite {{ $pageNumber }} vergrößern">
|
||||
<i class="ri-zoom-in-line {{ $iconSize }}"></i>
|
||||
</button>
|
||||
{{ end }}
|
||||
21
views/routes/components/_page_modal.gohtml
Normal file
21
views/routes/components/_page_modal.gohtml
Normal file
@@ -0,0 +1,21 @@
|
||||
{{- /*
|
||||
Shared Page Modal Component
|
||||
Modal for enlarged page viewing used by both issue and piece pages
|
||||
|
||||
Usage: {{ template "_page_modal" }}
|
||||
*/ -}}
|
||||
|
||||
<!-- Modal for enlarged view -->
|
||||
<div
|
||||
id="pageModal"
|
||||
class="fixed inset-0 bg-black bg-opacity-75 hidden z-50 flex items-center justify-center backdrop-blur-sm"
|
||||
onclick="closeModal()">
|
||||
<div class="relative max-w-full max-h-full p-4">
|
||||
<img id="modalImage" src="" alt="" class="max-w-full max-h-full object-contain rounded-lg" />
|
||||
<button
|
||||
onclick="closeModal()"
|
||||
class="absolute top-2 right-2 text-white bg-slate-800 bg-opacity-80 rounded-full w-10 h-10 flex items-center justify-center hover:bg-opacity-100 transition-all duration-200">
|
||||
<i class="ri-close-line text-xl"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -9,6 +9,7 @@
|
||||
"ShowPlaceTags" true|false
|
||||
"UseColonFormat" true|false
|
||||
"ShowContinuation" true|false
|
||||
"LongForm" true|false
|
||||
) }}
|
||||
|
||||
Parameters:
|
||||
@@ -18,6 +19,7 @@
|
||||
- ShowPlaceTags: Whether to show place tags (default: true)
|
||||
- UseColonFormat: Use colon format instead of "mit" for place view (default: false)
|
||||
- ShowContinuation: Show continuation prefixes (default: true for issue mode)
|
||||
- LongForm: Whether to show annotations in a new line after the piece (default: false)
|
||||
*/ -}}
|
||||
|
||||
{{- $pieceInput := .Piece -}}
|
||||
@@ -30,6 +32,8 @@
|
||||
{{- if eq $useColonFormat nil -}}{{ $useColonFormat = false }}{{- end -}}
|
||||
{{- $showContinuation := .ShowContinuation -}}
|
||||
{{- if eq $showContinuation nil -}}{{ $showContinuation = (eq $displayMode "issue") }}{{- end -}}
|
||||
{{- $longForm := .LongForm -}}
|
||||
{{- if eq $longForm nil -}}{{ $longForm = false }}{{- end -}}
|
||||
|
||||
{{- /* Handle different piece types: viewmodels.PieceByIssue vs xmlmodels.Piece */ -}}
|
||||
{{- $piece := $pieceInput -}}
|
||||
|
||||
Reference in New Issue
Block a user