{{- /* Unified Piece Entry Component Displays piece entries with category-specific descriptions across all views Usage: {{ template "_unified_piece_entry" (dict "Piece" $piece "CurrentActorID" $currentActorID "DisplayMode" "issue|akteure|place|search" "ShowPlaceTags" true|false "UseColonFormat" true|false "ShowContinuation" true|false ) }} Parameters: - Piece: The piece object to display - CurrentActorID: ID of current actor (for akteure view context) - DisplayMode: Context for formatting ("issue", "akteure", "place", "search") - 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) */ -}} {{- $pieceInput := .Piece -}} {{- $currentActorID := .CurrentActorID -}} {{- $displayMode := .DisplayMode -}} {{- if not $displayMode -}}{{ $displayMode = "issue" }}{{- end -}} {{- $showPlaceTags := .ShowPlaceTags -}} {{- if eq $showPlaceTags nil -}}{{ $showPlaceTags = true }}{{- end -}} {{- $useColonFormat := .UseColonFormat -}} {{- if eq $useColonFormat nil -}}{{ $useColonFormat = false }}{{- end -}} {{- $showContinuation := .ShowContinuation -}} {{- if eq $showContinuation nil -}}{{ $showContinuation = (eq $displayMode "issue") }}{{- end -}} {{- /* Handle different piece types: viewmodels.PieceByIssue vs xmlmodels.Piece */ -}} {{- $piece := $pieceInput -}} {{- $isContinuation := false -}} {{- if eq $displayMode "issue" -}} {{- /* Issue view uses viewmodels.PieceByIssue with .Piece field */ -}} {{- $piece = $pieceInput.Piece -}} {{- $isContinuation = $pieceInput.IsContinuation -}} {{- end -}} {{- $fortsPrefix := "" -}} {{- if and $showContinuation $isContinuation -}} {{- $fortsPrefix = "(Forts.) " -}} {{- end -}}