mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-28 16:45:32 +00:00
Refactored eintrag
This commit is contained in:
140
helpers/templatefunctions/categories.go
Normal file
140
helpers/templatefunctions/categories.go
Normal file
@@ -0,0 +1,140 @@
|
||||
package templatefunctions
|
||||
|
||||
import "github.com/Theodor-Springmann-Stiftung/kgpz_web/xmlmodels"
|
||||
|
||||
// CategoryFlags represents all possible category flags for a piece
|
||||
type CategoryFlags struct {
|
||||
Rezension bool
|
||||
Weltnachrichten bool
|
||||
EinkommendeFremde bool
|
||||
Wechselkurse bool
|
||||
Buecher bool
|
||||
Lokalanzeigen bool
|
||||
Lokalnachrichten bool
|
||||
Lotterie bool
|
||||
Gedicht bool
|
||||
Vorladung bool
|
||||
Auszug bool
|
||||
Aufsatz bool
|
||||
GelehrteNachrichten bool
|
||||
Theaterkritik bool
|
||||
Uebersetzung bool
|
||||
Kommentar bool
|
||||
Nachruf bool
|
||||
Replik bool
|
||||
Proklamation bool
|
||||
Ineigenersache bool
|
||||
Brief bool
|
||||
Anzeige bool
|
||||
Desertionsliste bool
|
||||
Notenblatt bool
|
||||
Vorlesungsverzeichnis bool
|
||||
Erzaehlung bool
|
||||
Nachtrag bool
|
||||
Panegyrik bool
|
||||
Kriminalanzeige bool
|
||||
Abbildung bool
|
||||
Rezepte bool
|
||||
Korrektur bool
|
||||
}
|
||||
|
||||
// GetCategoryFlags analyzes a piece and returns a CategoryFlags struct with all category flags set
|
||||
func GetCategoryFlags(piece xmlmodels.Piece) CategoryFlags {
|
||||
flags := CategoryFlags{}
|
||||
|
||||
// Process CategoryRefs
|
||||
for _, catref := range piece.CategoryRefs {
|
||||
switch catref.Ref {
|
||||
case "rezension":
|
||||
flags.Rezension = true
|
||||
case "weltnachrichten":
|
||||
flags.Weltnachrichten = true
|
||||
case "einkommende-fremde":
|
||||
flags.EinkommendeFremde = true
|
||||
case "wechselkurse":
|
||||
flags.Wechselkurse = true
|
||||
case "buecher":
|
||||
flags.Buecher = true
|
||||
case "lokalanzeigen":
|
||||
flags.Lokalanzeigen = true
|
||||
case "lokalnachrichten":
|
||||
flags.Lokalnachrichten = true
|
||||
case "lotterie":
|
||||
flags.Lotterie = true
|
||||
case "gedicht":
|
||||
flags.Gedicht = true
|
||||
case "vorladung":
|
||||
flags.Vorladung = true
|
||||
case "auszug":
|
||||
flags.Auszug = true
|
||||
case "aufsatz":
|
||||
flags.Aufsatz = true
|
||||
case "gelehrte-nachrichten":
|
||||
flags.GelehrteNachrichten = true
|
||||
case "theaterkritik":
|
||||
flags.Theaterkritik = true
|
||||
case "uebersetzung":
|
||||
flags.Uebersetzung = true
|
||||
case "kommentar":
|
||||
flags.Kommentar = true
|
||||
case "nachruf":
|
||||
flags.Nachruf = true
|
||||
case "replik":
|
||||
flags.Replik = true
|
||||
case "proklamation":
|
||||
flags.Proklamation = true
|
||||
case "ineigenersache":
|
||||
flags.Ineigenersache = true
|
||||
case "brief":
|
||||
flags.Brief = true
|
||||
case "anzeige":
|
||||
flags.Anzeige = true
|
||||
case "desertionsliste":
|
||||
flags.Desertionsliste = true
|
||||
case "notenblatt":
|
||||
flags.Notenblatt = true
|
||||
case "vorlesungsverzeichnis":
|
||||
flags.Vorlesungsverzeichnis = true
|
||||
case "erzaehlung":
|
||||
flags.Erzaehlung = true
|
||||
case "nachtrag":
|
||||
flags.Nachtrag = true
|
||||
case "panegyrik":
|
||||
flags.Panegyrik = true
|
||||
case "kriminalanzeige":
|
||||
flags.Kriminalanzeige = true
|
||||
case "abbildung":
|
||||
flags.Abbildung = true
|
||||
case "rezepte":
|
||||
flags.Rezepte = true
|
||||
case "korrektur":
|
||||
flags.Korrektur = true
|
||||
}
|
||||
}
|
||||
|
||||
// Process WorkRefs with category mapping
|
||||
for _, workref := range piece.WorkRefs {
|
||||
kat := workref.Category
|
||||
if kat == "" {
|
||||
kat = "rezension" // Default category for WorkRefs
|
||||
}
|
||||
switch kat {
|
||||
case "rezension":
|
||||
flags.Rezension = true
|
||||
case "auszug":
|
||||
flags.Auszug = true
|
||||
case "theaterkritik":
|
||||
flags.Theaterkritik = true
|
||||
case "uebersetzung":
|
||||
flags.Uebersetzung = true
|
||||
case "kommentar":
|
||||
flags.Kommentar = true
|
||||
case "anzeige":
|
||||
flags.Anzeige = true
|
||||
case "replik":
|
||||
flags.Replik = true
|
||||
}
|
||||
}
|
||||
|
||||
return flags
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/Theodor-Springmann-Stiftung/kgpz_web/functions"
|
||||
"github.com/Theodor-Springmann-Stiftung/kgpz_web/helpers"
|
||||
"github.com/Theodor-Springmann-Stiftung/kgpz_web/helpers/templatefunctions"
|
||||
"github.com/Theodor-Springmann-Stiftung/kgpz_web/views"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/etag"
|
||||
@@ -148,6 +149,7 @@ func (e *Engine) funcs() error {
|
||||
// Piece view helpers
|
||||
e.AddFunc("GetPieceURL", GetPieceURL)
|
||||
e.AddFunc("IssueContext", IssueContext)
|
||||
e.AddFunc("GetCategoryFlags", templatefunctions.GetCategoryFlags)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ type PiecePageEntry struct {
|
||||
IsContinuation bool
|
||||
IssueContext string // "1764 Nr. 37" for display
|
||||
Available bool
|
||||
OtherPieces []IndividualPieceByIssue // Other pieces on the same page
|
||||
}
|
||||
|
||||
type PieceImages struct {
|
||||
@@ -77,6 +78,7 @@ func NewPieceView(piece xmlmodels.Piece, lib *xmlmodels.Library) (*PieceVM, erro
|
||||
IsContinuation: pageNum > issueRef.Von || partIndex > 0,
|
||||
IssueContext: issueContext,
|
||||
Available: true, // Will be updated when we load images
|
||||
OtherPieces: []IndividualPieceByIssue{}, // Will be populated later
|
||||
}
|
||||
|
||||
// Get actual image path from registry
|
||||
@@ -98,6 +100,11 @@ func NewPieceView(piece xmlmodels.Piece, lib *xmlmodels.Library) (*PieceVM, erro
|
||||
return nil, fmt.Errorf("failed to create continuous pages: %w", err)
|
||||
}
|
||||
|
||||
// Populate other pieces on each page
|
||||
if err := pvm.populateOtherPieces(lib); err != nil {
|
||||
return nil, fmt.Errorf("failed to populate other pieces: %w", err)
|
||||
}
|
||||
|
||||
return pvm, nil
|
||||
}
|
||||
|
||||
@@ -203,4 +210,63 @@ func getImagePathFromRegistry(year, page int) string {
|
||||
|
||||
// Fallback: generate a default path (though this probably won't exist)
|
||||
return fmt.Sprintf("/static/pictures/%d/seite_%d.jpg", year, page)
|
||||
}
|
||||
|
||||
// populateOtherPieces finds and populates other pieces that appear on the same pages as this piece
|
||||
func (pvm *PieceVM) populateOtherPieces(lib *xmlmodels.Library) error {
|
||||
fmt.Printf("DEBUG: Starting populateOtherPieces for piece %s\n", pvm.Piece.ID)
|
||||
for i, pageEntry := range pvm.AllPages {
|
||||
fmt.Printf("DEBUG: Processing page %d from issue %d/%d\n", pageEntry.PageNumber, pageEntry.IssueYear, pageEntry.IssueNumber)
|
||||
|
||||
// Find the issue this page belongs to
|
||||
var issue *xmlmodels.Issue
|
||||
lib.Issues.Lock()
|
||||
for _, iss := range lib.Issues.Array {
|
||||
if iss.Datum.When.Year == pageEntry.IssueYear && iss.Number.No == pageEntry.IssueNumber {
|
||||
issue = &iss
|
||||
break
|
||||
}
|
||||
}
|
||||
lib.Issues.Unlock()
|
||||
|
||||
if issue == nil {
|
||||
fmt.Printf("DEBUG: Issue not found for %d/%d\n", pageEntry.IssueYear, pageEntry.IssueNumber)
|
||||
continue
|
||||
}
|
||||
|
||||
// Get all pieces for this issue using the same approach as the ausgabe view
|
||||
piecesForIssue, _, err := PiecesForIsssue(lib, *issue)
|
||||
if err != nil {
|
||||
fmt.Printf("DEBUG: Error getting pieces for issue: %v\n", err)
|
||||
continue
|
||||
}
|
||||
|
||||
// Create IndividualPiecesByPage using the same function as ausgabe view
|
||||
individualPieces := CreateIndividualPagesWithMetadata(piecesForIssue, lib)
|
||||
|
||||
// Get pieces that appear on this specific page
|
||||
if individualPiecesOnPage, exists := individualPieces.Items[pageEntry.PageNumber]; exists {
|
||||
fmt.Printf("DEBUG: Found %d pieces on page %d\n", len(individualPiecesOnPage), pageEntry.PageNumber)
|
||||
otherPieces := []IndividualPieceByIssue{}
|
||||
|
||||
for _, individualPiece := range individualPiecesOnPage {
|
||||
fmt.Printf("DEBUG: Checking piece %s (current: %s)\n", individualPiece.PieceByIssue.Piece.ID, pvm.Piece.ID)
|
||||
// Skip the current piece itself
|
||||
if individualPiece.PieceByIssue.Piece.ID == pvm.Piece.ID {
|
||||
fmt.Printf("DEBUG: Skipping current piece\n")
|
||||
continue
|
||||
}
|
||||
|
||||
fmt.Printf("DEBUG: Adding other piece %s\n", individualPiece.PieceByIssue.Piece.ID)
|
||||
otherPieces = append(otherPieces, individualPiece)
|
||||
}
|
||||
|
||||
fmt.Printf("DEBUG: Found %d other pieces on page %d\n", len(otherPieces), pageEntry.PageNumber)
|
||||
pvm.AllPages[i].OtherPieces = otherPieces
|
||||
} else {
|
||||
fmt.Printf("DEBUG: No pieces found on page %d\n", pageEntry.PageNumber)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -6,89 +6,7 @@
|
||||
|
||||
|
||||
<div class="entry-description leading-snug mb-1">
|
||||
{{- $hasRezension := false -}}
|
||||
{{- $hasWeltnachrichten := false -}}
|
||||
{{- $hasEinkommendeFremde := false -}}
|
||||
{{- $hasWechselkurse := false -}}
|
||||
{{- $hasBuecher := false -}}
|
||||
{{- $hasLokalanzeigen := false -}}
|
||||
{{- $hasLokalnachrichten := false -}}
|
||||
{{- $hasLotterie := false -}}
|
||||
{{- $hasGedicht := false -}}
|
||||
{{- $hasVorladung := false -}}
|
||||
{{- $hasAuszug := false -}}
|
||||
{{- $hasAufsatz := false -}}
|
||||
{{- $hasGelehrteNachrichten := false -}}
|
||||
{{- $hasTheaterkritik := false -}}
|
||||
{{- $hasUebersetzung := false -}}
|
||||
{{- $hasKommentar := false -}}
|
||||
{{- $hasNachruf := false -}}
|
||||
{{- $hasReplik := false -}}
|
||||
{{- $hasProklamation := false -}}
|
||||
{{- $hasIneigenersache := false -}}
|
||||
{{- $hasBrief := false -}}
|
||||
{{- $hasAnzeige := false -}}
|
||||
{{- $hasDesertionsliste := false -}}
|
||||
{{- $hasNotenblatt := false -}}
|
||||
{{- $hasVorlesungsverzeichnis := false -}}
|
||||
{{- $hasErzaehlung := false -}}
|
||||
{{- $hasNachtrag := false -}}
|
||||
{{- $hasPanegyrik := false -}}
|
||||
{{- $hasKriminalanzeige := false -}}
|
||||
{{- $hasAbbildung := false -}}
|
||||
{{- $hasRezepte := false -}}
|
||||
{{- $hasKorrektur := false -}}
|
||||
|
||||
{{- range $catref := $piece.CategoryRefs -}}
|
||||
{{- if eq $catref.Ref "rezension" -}}{{- $hasRezension = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "weltnachrichten" -}}{{- $hasWeltnachrichten = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "einkommende-fremde" -}}{{- $hasEinkommendeFremde = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "wechselkurse" -}}{{- $hasWechselkurse = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "buecher" -}}{{- $hasBuecher = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "lokalanzeigen" -}}{{- $hasLokalanzeigen = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "lokalnachrichten" -}}{{- $hasLokalnachrichten = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "lotterie" -}}{{- $hasLotterie = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "gedicht" -}}{{- $hasGedicht = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "vorladung" -}}{{- $hasVorladung = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "auszug" -}}{{- $hasAuszug = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "aufsatz" -}}{{- $hasAufsatz = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "gelehrte-nachrichten" -}}
|
||||
{{- $hasGelehrteNachrichten = true -}}
|
||||
{{- end -}}
|
||||
{{- if eq $catref.Ref "theaterkritik" -}}{{- $hasTheaterkritik = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "uebersetzung" -}}{{- $hasUebersetzung = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "kommentar" -}}{{- $hasKommentar = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "nachruf" -}}{{- $hasNachruf = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "replik" -}}{{- $hasReplik = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "proklamation" -}}{{- $hasProklamation = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "ineigenersache" -}}{{- $hasIneigenersache = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "brief" -}}{{- $hasBrief = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "anzeige" -}}{{- $hasAnzeige = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "desertionsliste" -}}{{- $hasDesertionsliste = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "notenblatt" -}}{{- $hasNotenblatt = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "vorlesungsverzeichnis" -}}
|
||||
{{- $hasVorlesungsverzeichnis = true -}}
|
||||
{{- end -}}
|
||||
{{- if eq $catref.Ref "erzaehlung" -}}{{- $hasErzaehlung = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "nachtrag" -}}{{- $hasNachtrag = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "panegyrik" -}}{{- $hasPanegyrik = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "kriminalanzeige" -}}{{- $hasKriminalanzeige = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "abbildung" -}}{{- $hasAbbildung = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "rezepte" -}}{{- $hasRezepte = true -}}{{- end -}}
|
||||
{{- if eq $catref.Ref "korrektur" -}}{{- $hasKorrektur = true -}}{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $workref := $piece.WorkRefs -}}
|
||||
{{- $kat := $workref.Category -}}
|
||||
{{- if not $kat -}}{{- $kat = "rezension" -}}{{- end -}}
|
||||
{{- if eq $kat "rezension" -}}{{- $hasRezension = true -}}{{- end -}}
|
||||
{{- if eq $kat "auszug" -}}{{- $hasAuszug = true -}}{{- end -}}
|
||||
{{- if eq $kat "theaterkritik" -}}{{- $hasTheaterkritik = true -}}{{- end -}}
|
||||
{{- if eq $kat "uebersetzung" -}}{{- $hasUebersetzung = true -}}{{- end -}}
|
||||
{{- if eq $kat "kommentar" -}}{{- $hasKommentar = true -}}{{- end -}}
|
||||
{{- if eq $kat "anzeige" -}}{{- $hasAnzeige = true -}}{{- end -}}
|
||||
{{- if eq $kat "replik" -}}{{- $hasReplik = true -}}{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $categoryFlags := GetCategoryFlags $piece.Piece -}}
|
||||
|
||||
{{- $place := "" -}}
|
||||
{{- if $piece.PlaceRefs -}}
|
||||
@@ -144,7 +62,7 @@
|
||||
|
||||
{{- /* Generate natural text descriptions */ -}}
|
||||
|
||||
{{- if $hasRezension -}}
|
||||
{{- if $categoryFlags.Rezension -}}
|
||||
{{- $authorFound := false -}}
|
||||
{{- range $agentref := $piece.AgentRefs -}}
|
||||
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
|
||||
@@ -205,55 +123,55 @@
|
||||
>{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- else if $hasWeltnachrichten -}}
|
||||
{{- else if $categoryFlags.Weltnachrichten -}}
|
||||
{{ Safe $fortsPrefix }}Politische Nachrichten aus aller Welt
|
||||
{{- else if $hasEinkommendeFremde -}}
|
||||
{{- if $hasLokalnachrichten -}}
|
||||
{{- else if $categoryFlags.EinkommendeFremde -}}
|
||||
{{- if $categoryFlags.Lokalnachrichten -}}
|
||||
Lokale Meldungen über einreisende Fremde
|
||||
{{- else if $hasNachruf -}}
|
||||
{{- else if $categoryFlags.Nachruf -}}
|
||||
Nachruf und Einreiseliste
|
||||
{{- else -}}
|
||||
Einreiseliste
|
||||
{{- end -}}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasWechselkurse -}}
|
||||
{{- else if $categoryFlags.Wechselkurse -}}
|
||||
Wechselkurse{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasBuecher -}}
|
||||
{{- else if $categoryFlags.Buecher -}}
|
||||
Bücheranzeigen{{ if $title }}: <em>{{ $title }}</em>{{ end }}
|
||||
|
||||
{{- else if $hasLokalanzeigen -}}
|
||||
{{ if $hasNachruf }}
|
||||
{{- else if $categoryFlags.Lokalanzeigen -}}
|
||||
{{ if $categoryFlags.Nachruf }}
|
||||
Todesanzeige
|
||||
{{ else }}
|
||||
Lokalanzeige
|
||||
{{ end }}{{ if $title }}: <em>{{ $title }}</em>{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasLokalnachrichten -}}
|
||||
{{ if $hasLotterie }}
|
||||
{{- else if $categoryFlags.Lokalnachrichten -}}
|
||||
{{ if $categoryFlags.Lotterie }}
|
||||
Lotterienachrichten
|
||||
{{ else if $hasNachruf }}
|
||||
{{ else if $categoryFlags.Nachruf }}
|
||||
Nachrufe
|
||||
{{ else if $hasTheaterkritik }}
|
||||
{{ else if $categoryFlags.Theaterkritik }}
|
||||
Theaternachrichten
|
||||
{{ else if $hasPanegyrik }}
|
||||
{{ else if $categoryFlags.Panegyrik }}
|
||||
Festlichkeiten
|
||||
{{ else }}
|
||||
Lokalnachrichten
|
||||
{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasGedicht -}}
|
||||
{{- else if $categoryFlags.Gedicht -}}
|
||||
{{- $authorFound := false -}}
|
||||
{{- range $agentref := $piece.AgentRefs -}}
|
||||
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
|
||||
{{- $agent := GetAgent $agentref.Ref -}}
|
||||
{{- if and $agent (gt (len $agent.Names) 0) -}}
|
||||
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ index $agent.Names 0 }}</a>,
|
||||
{{ if $hasKommentar }}
|
||||
{{ if $categoryFlags.Kommentar }}
|
||||
Gedicht mit Kommentar
|
||||
{{ else if $hasUebersetzung }}
|
||||
{{ else if $categoryFlags.Uebersetzung }}
|
||||
Gedichtübersetzung
|
||||
{{ else if $hasGelehrteNachrichten }}
|
||||
{{ else if $categoryFlags.GelehrteNachrichten }}
|
||||
Gedicht zu gelehrten Angelegenheiten
|
||||
{{ else }}
|
||||
Gedicht
|
||||
@@ -264,21 +182,21 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $hasKommentar }}
|
||||
{{ Safe $fortsPrefix }}{{ if $categoryFlags.Kommentar }}
|
||||
Gedicht mit Kommentar
|
||||
{{ else if $hasUebersetzung }}
|
||||
{{ else if $categoryFlags.Uebersetzung }}
|
||||
Gedichtübersetzung
|
||||
{{ else if $hasGelehrteNachrichten }}
|
||||
{{ else if $categoryFlags.GelehrteNachrichten }}
|
||||
Gedicht zu gelehrten Angelegenheiten
|
||||
{{ else }}
|
||||
Gedicht
|
||||
{{ end }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- else if $hasVorladung -}}
|
||||
{{- else if $categoryFlags.Vorladung -}}
|
||||
Gerichtliche Vorladung{{ if $title }}: <em>{{ $title }}</em>{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasAufsatz -}}
|
||||
{{- else if $categoryFlags.Aufsatz -}}
|
||||
{{- $authorFound := false -}}
|
||||
{{- range $agentref := $piece.AgentRefs -}}
|
||||
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
|
||||
@@ -287,15 +205,15 @@
|
||||
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600"
|
||||
>{{ index $agent.Names 0 }}</a
|
||||
>,
|
||||
{{ if $hasReplik }}
|
||||
{{ if $categoryFlags.Replik }}
|
||||
Erwiderung
|
||||
{{ else if $hasUebersetzung }}
|
||||
{{ else if $categoryFlags.Uebersetzung }}
|
||||
Übersetzung
|
||||
{{ else if $hasNachruf }}
|
||||
{{ else if $categoryFlags.Nachruf }}
|
||||
Nachruf
|
||||
{{ else if $hasKommentar }}
|
||||
{{ else if $categoryFlags.Kommentar }}
|
||||
Kommentar
|
||||
{{ else if $hasRezepte }}
|
||||
{{ else if $categoryFlags.Rezepte }}
|
||||
Rezepte und Anleitungen
|
||||
{{ else }}
|
||||
Aufsatz
|
||||
@@ -306,31 +224,31 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $hasReplik }}
|
||||
{{ Safe $fortsPrefix }}{{ if $categoryFlags.Replik }}
|
||||
Erwiderung
|
||||
{{ else if $hasUebersetzung }}
|
||||
{{ else if $categoryFlags.Uebersetzung }}
|
||||
Übersetzung
|
||||
{{ else if $hasNachruf }}
|
||||
{{ else if $categoryFlags.Nachruf }}
|
||||
Nachruf
|
||||
{{ else if $hasKommentar }}
|
||||
{{ else if $categoryFlags.Kommentar }}
|
||||
Kommentar
|
||||
{{ else if $hasRezepte }}
|
||||
{{ else if $categoryFlags.Rezepte }}
|
||||
Rezepte und Anleitungen
|
||||
{{ else }}
|
||||
Aufsatz
|
||||
{{ end }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- else if $hasGelehrteNachrichten -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $hasTheaterkritik }}
|
||||
{{- else if $categoryFlags.GelehrteNachrichten -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $categoryFlags.Theaterkritik }}
|
||||
Theaterkritik
|
||||
{{ else if $hasKommentar }}
|
||||
{{ else if $categoryFlags.Kommentar }}
|
||||
Gelehrter Kommentar
|
||||
{{ else }}
|
||||
Gelehrte Nachrichten
|
||||
{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasTheaterkritik -}}
|
||||
{{- else if $categoryFlags.Theaterkritik -}}
|
||||
{{- $authorFound := false -}}
|
||||
{{- range $agentref := $piece.AgentRefs -}}
|
||||
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
|
||||
@@ -362,22 +280,22 @@
|
||||
{{ end }}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- else if $hasProklamation -}}
|
||||
{{- else if $categoryFlags.Proklamation -}}
|
||||
{{ Safe $fortsPrefix }}Amtliche
|
||||
Proklamation{{ if $title }}: <em>{{ $title }}</em>{{ end }}
|
||||
|
||||
{{- else if $hasIneigenersache -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $hasKommentar }}
|
||||
{{ if $hasNachtrag }}Ergänzender Kommentar{{ else }}Redaktioneller Kommentar{{ end }}
|
||||
{{ else if $hasReplik }}
|
||||
{{- else if $categoryFlags.Ineigenersache -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $categoryFlags.Kommentar }}
|
||||
{{ if $categoryFlags.Nachtrag }}Ergänzender Kommentar{{ else }}Redaktioneller Kommentar{{ end }}
|
||||
{{ else if $categoryFlags.Replik }}
|
||||
Redaktionelle Stellungnahme
|
||||
{{ else }}
|
||||
Anmerkung der Redaktion
|
||||
{{ end }}
|
||||
{{ if $title }}: <em>{{ $title }}</em>{{ end }}
|
||||
|
||||
{{- else if $hasBrief -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $hasNachruf }}
|
||||
{{- else if $categoryFlags.Brief -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $categoryFlags.Nachruf }}
|
||||
Kondolenzbrief
|
||||
{{ else }}
|
||||
Leserbrief
|
||||
@@ -394,18 +312,18 @@
|
||||
|
||||
{{- end -}}{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasDesertionsliste -}}
|
||||
{{- else if $categoryFlags.Desertionsliste -}}
|
||||
{{ Safe $fortsPrefix }}Desertionsliste{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasNotenblatt -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $hasNachtrag }}Ergänztes{{ end }}Notenblatt{{ if $title }}
|
||||
{{- else if $categoryFlags.Notenblatt -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $categoryFlags.Nachtrag }}Ergänztes{{ end }}Notenblatt{{ if $title }}
|
||||
: <em>{{ $title }}</em>
|
||||
{{ end }}
|
||||
|
||||
{{- else if $hasVorlesungsverzeichnis -}}
|
||||
{{- else if $categoryFlags.Vorlesungsverzeichnis -}}
|
||||
{{ Safe $fortsPrefix }}Vorlesungsverzeichnis{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasErzaehlung -}}
|
||||
{{- else if $categoryFlags.Erzaehlung -}}
|
||||
{{- $authorFound := false -}}
|
||||
{{- range $agentref := $piece.AgentRefs -}}
|
||||
{{- if (or (eq $agentref.Category "") (eq $agentref.Category "autor")) -}}
|
||||
@@ -414,7 +332,7 @@
|
||||
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600"
|
||||
>{{ index $agent.Names 0 }}</a
|
||||
>,
|
||||
{{ if $hasUebersetzung }}
|
||||
{{ if $categoryFlags.Uebersetzung }}
|
||||
Übersetzung einer Erzählung
|
||||
{{ else }}
|
||||
Erzählung
|
||||
@@ -425,37 +343,37 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $hasUebersetzung }}
|
||||
{{ Safe $fortsPrefix }}{{ if $categoryFlags.Uebersetzung }}
|
||||
Übersetzung einer Erzählung
|
||||
{{ else }}
|
||||
Erzählung
|
||||
{{ end }}{{ if $title }}: <em>„{{ $title }}"</em>{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- else if $hasAbbildung -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $hasAufsatz }}
|
||||
{{- else if $categoryFlags.Abbildung -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $categoryFlags.Aufsatz }}
|
||||
Illustrierter Aufsatz
|
||||
{{ else }}
|
||||
Abbildung
|
||||
{{ end }}
|
||||
{{ if $title }}: <em>{{ $title }}</em>{{ end }}
|
||||
|
||||
{{- else if $hasKriminalanzeige -}}
|
||||
{{- else if $categoryFlags.Kriminalanzeige -}}
|
||||
{{ Safe $fortsPrefix }}Kriminalanzeige{{ if $place }} <span class="place-tag inline-block bg-slate-200 text-slate-700 text-xs px-2 py-0.5 rounded-md whitespace-nowrap">{{ $place }}</span>{{ end }}
|
||||
|
||||
{{- else if $hasKorrektur -}}
|
||||
{{- else if $categoryFlags.Korrektur -}}
|
||||
{{ Safe $fortsPrefix }}Korrektur{{ if $title }}: <em>{{ $title }}</em>{{ end }}
|
||||
|
||||
{{- else if $hasAnzeige -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $hasAuszug }}
|
||||
{{ if $hasGedicht }}Gedichtauszug{{ else }}Textauszug{{ end }}
|
||||
{{- else if $categoryFlags.Anzeige -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $categoryFlags.Auszug }}
|
||||
{{ if $categoryFlags.Gedicht }}Gedichtauszug{{ else }}Textauszug{{ end }}
|
||||
{{ else }}
|
||||
Anzeige
|
||||
{{ end }}
|
||||
{{ if $title }}: <em>{{ $title }}</em>{{ end }}
|
||||
|
||||
{{- else if $hasAuszug -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $title }}<em>{{ $title }}</em>, {{ end }}{{ if $hasUebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ if $workAuthorName }}
|
||||
{{- else if $categoryFlags.Auszug -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $title }}<em>{{ $title }}</em>, {{ end }}{{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ if $workAuthorName }}
|
||||
<a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>, {{ end }}{{ if $workTitle }}<em
|
||||
class="work-title"
|
||||
data-short-title="{{ $workTitle }}"
|
||||
@@ -471,7 +389,7 @@
|
||||
{{ Safe $fortsPrefix }}<a href="/akteure/{{ $agentref.Ref }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600"
|
||||
>{{ index $agent.Names 0 }}</a
|
||||
>{{ if $title }}: <em>{{ $title }}</em>{{ end }}{{ if $workTitle }}
|
||||
{{ if $title }}, {{ if $hasUebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
|
||||
{{ if $title }}, {{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
|
||||
<a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>, {{ end }}<em
|
||||
class="work-title"
|
||||
data-short-title="{{ $workTitle }}"
|
||||
@@ -485,7 +403,7 @@
|
||||
{{- end -}}
|
||||
{{- if not $authorFound -}}
|
||||
{{ Safe $fortsPrefix }}{{ if $title }}<em>{{ $title }}</em>{{ end }}{{ if $workTitle }}
|
||||
{{ if $title }}, {{ if $hasUebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
|
||||
{{ if $title }}, {{ if $categoryFlags.Uebersetzung }}Übersetzung aus:{{ else }}Auszug aus:{{ end }} {{ end }}{{ if $workAuthorName }}
|
||||
<a href="/akteure/{{ $workAuthorID }}" class="author-link text-slate-700 hover:text-slate-900 underline decoration-slate-400 hover:decoration-slate-600">{{ $workAuthorName }}</a>, {{ end }}<em
|
||||
class="work-title"
|
||||
data-short-title="{{ $workTitle }}"
|
||||
|
||||
@@ -56,6 +56,23 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<!-- Other pieces on this page -->
|
||||
{{ if $pageEntry.OtherPieces }}
|
||||
<div class="mt-4 p-4 bg-blue-50 border border-blue-200 rounded">
|
||||
<h4 class="text-sm font-semibold text-blue-800 mb-3 flex items-center gap-2">
|
||||
<i class="ri-file-list-2-line"></i>
|
||||
Außerdem auf dieser Seite:
|
||||
</h4>
|
||||
<div class="space-y-2">
|
||||
{{ range $otherPiece := $pageEntry.OtherPieces }}
|
||||
<div class="text-sm">
|
||||
{{ template "_inhaltsverzeichnis_eintrag" $otherPiece }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user