mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 02:25:30 +00:00
FIX: fud not showing for pages
This commit is contained in:
@@ -181,7 +181,6 @@ const (
|
||||
DOKUMENTATION_TITLE = "Benutzerhinweise"
|
||||
DOKUMENTATION_DESCRIPTION = "Musenalm: Verzeichnis deutschsprachiger Almanache des 18. und 19. Jahrhunderts. Dokumentation der Sortierung und Struktur der Almanache."
|
||||
DOKUMENTATION_TEXT = `
|
||||
<h1 class="mb-12">Benutzerhinweise</h1>
|
||||
<div class="text">
|
||||
<h3>Sortierung der Reihentitel</h3>
|
||||
<p>Wir sortieren die Reihentitel nach dem Kopf der Nominalphrase, den wir zu diesem Zweck ggf. an den Anfang stellen und mit Kommas abtrennen.</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,3 @@
|
||||
<title>{{ pageMetaField "index" "title" }}</title>
|
||||
<meta name="description" content="{{ pageMetaField "index" "description" }}" />
|
||||
<meta name="page-key" content="index" />
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
<title>{{ .site.title }} – {{ pageMetaField "benutzerhinweise" "title" }}</title>
|
||||
<meta name="description" content="{{ pageMetaField "benutzerhinweise" "description" }}" />
|
||||
<meta name="page-key" content="benutzerhinweise" />
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
<title>{{ .site.title }} – {{ pageMetaField "danksagungen" "title" }}</title>
|
||||
<meta name="description" content="{{ pageMetaField "danksagungen" "description" }}" />
|
||||
<meta name="page-key" content="danksagungen" />
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
<title>{{ .site.title }} – {{ pageMetaField "einleitung" "title" }}</title>
|
||||
<meta name="description" content="{{ pageMetaField "einleitung" "description" }}" />
|
||||
<meta name="page-key" content="einleitung" />
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
<title>{{ .site.title }} – {{ pageMetaField "kontakt" "title" }}</title>
|
||||
<meta name="description" content="{{ pageMetaField "kontakt" "description" }}" />
|
||||
<meta name="page-key" content="kontakt" />
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
<title>{{ .site.title }} – {{ pageMetaField "lesekabinett" "title" }}</title>
|
||||
<meta name="description" content="{{ pageMetaField "lesekabinett" "description" }}" />
|
||||
<meta name="page-key" content="lesekabinett" />
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
<title>{{ .site.title }} – {{ pageMetaField "literatur" "title" }}</title>
|
||||
<meta name="description" content="{{ pageMetaField "literatur" "description" }}" />
|
||||
<meta name="page-key" content="literatur" />
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
<title>{{ .site.title }} – Reihen</title>
|
||||
<meta name="page-key" content="reihen" />
|
||||
|
||||
@@ -25,6 +25,8 @@ export class FabMenu extends HTMLElement {
|
||||
let hasEntry = false,
|
||||
entryId = "",
|
||||
entryUpdated = "";
|
||||
let hasPage = false,
|
||||
pageKey = "";
|
||||
|
||||
// Reihe detail page: /reihe/{id} (but not /reihe/new or /reihe/{id}/edit)
|
||||
const reiheMatch = path.match(/^\/reihe\/([^\/]+)\/?$/);
|
||||
@@ -57,6 +59,34 @@ export class FabMenu extends HTMLElement {
|
||||
}
|
||||
}
|
||||
|
||||
// Page views use page editor keys via meta tag or URL mapping
|
||||
const pageKeyMeta = document.querySelector('meta[name="page-key"]');
|
||||
if (pageKeyMeta && pageKeyMeta.content) {
|
||||
hasPage = true;
|
||||
pageKey = pageKeyMeta.content;
|
||||
} else {
|
||||
const textPageMatch = path.match(/^\/redaktion\/([^\/]+)\/?$/);
|
||||
const textPageKey = textPageMatch ? textPageMatch[1] : "";
|
||||
const knownPageKeys = new Set([
|
||||
"kontakt",
|
||||
"danksagungen",
|
||||
"literatur",
|
||||
"einleitung",
|
||||
"benutzerhinweise",
|
||||
"lesekabinett",
|
||||
]);
|
||||
if (textPageKey && knownPageKeys.has(textPageKey)) {
|
||||
hasPage = true;
|
||||
pageKey = textPageKey;
|
||||
} else if (path === "/" || path === "/index/") {
|
||||
hasPage = true;
|
||||
pageKey = "index";
|
||||
} else if (path === "/reihen" || path === "/reihen/") {
|
||||
hasPage = true;
|
||||
pageKey = "reihen";
|
||||
}
|
||||
}
|
||||
|
||||
// Try to find CSRF token from page forms
|
||||
let csrfToken = "";
|
||||
const csrfInput = document.querySelector('input[name="csrf_token"]');
|
||||
@@ -65,7 +95,7 @@ export class FabMenu extends HTMLElement {
|
||||
}
|
||||
const hasCsrf = csrfToken !== "";
|
||||
|
||||
this.hasContext = hasReihe || hasPerson || hasEntry;
|
||||
this.hasContext = hasReihe || hasPerson || hasEntry || hasPage;
|
||||
|
||||
// Build half-open menu content
|
||||
let halfOpenContent = "";
|
||||
@@ -99,6 +129,16 @@ export class FabMenu extends HTMLElement {
|
||||
<span class="text-gray-900">Bearbeiten</span>
|
||||
</a>
|
||||
`;
|
||||
} else if (hasPage) {
|
||||
halfOpenContent = `
|
||||
<div class="px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider">
|
||||
Seite
|
||||
</div>
|
||||
<a href="/redaktion/seiten/?key=${pageKey}" hx-boost="false" class="flex items-center px-4 py-2 hover:bg-gray-100 transition-colors no-underline text-sm">
|
||||
<i class="ri-edit-line text-base text-gray-700 mr-2.5"></i>
|
||||
<span class="text-gray-900">Seite bearbeiten</span>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
// Build full menu content
|
||||
|
||||
@@ -198,11 +198,11 @@
|
||||
}
|
||||
|
||||
.text {
|
||||
@apply font-serif hyphens-auto;
|
||||
@apply font-serif text-lg hyphens-auto;
|
||||
}
|
||||
|
||||
.text p {
|
||||
@apply text-lg hyphens-auto max-w-[70ch];
|
||||
@apply hyphens-auto max-w-[70ch];
|
||||
}
|
||||
|
||||
.text ul {
|
||||
|
||||
Reference in New Issue
Block a user