FIX: fud not showing for pages

This commit is contained in:
Simon Martens
2026-01-15 22:50:45 +01:00
parent ab984442ec
commit 19ceab314e
13 changed files with 830 additions and 761 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,3 @@
<title>{{ pageMetaField "index" "title" }}</title>
<meta name="description" content="{{ pageMetaField "index" "description" }}" />
<meta name="page-key" content="index" />

View File

@@ -1,2 +1,3 @@
<title>{{ .site.title }} &ndash; {{ pageMetaField "benutzerhinweise" "title" }}</title>
<meta name="description" content="{{ pageMetaField "benutzerhinweise" "description" }}" />
<meta name="page-key" content="benutzerhinweise" />

View File

@@ -1,2 +1,3 @@
<title>{{ .site.title }} &ndash; {{ pageMetaField "danksagungen" "title" }}</title>
<meta name="description" content="{{ pageMetaField "danksagungen" "description" }}" />
<meta name="page-key" content="danksagungen" />

View File

@@ -1,2 +1,3 @@
<title>{{ .site.title }} &ndash; {{ pageMetaField "einleitung" "title" }}</title>
<meta name="description" content="{{ pageMetaField "einleitung" "description" }}" />
<meta name="page-key" content="einleitung" />

View File

@@ -1,2 +1,3 @@
<title>{{ .site.title }} &ndash; {{ pageMetaField "kontakt" "title" }}</title>
<meta name="description" content="{{ pageMetaField "kontakt" "description" }}" />
<meta name="page-key" content="kontakt" />

View File

@@ -1,2 +1,3 @@
<title>{{ .site.title }} &ndash; {{ pageMetaField "lesekabinett" "title" }}</title>
<meta name="description" content="{{ pageMetaField "lesekabinett" "description" }}" />
<meta name="page-key" content="lesekabinett" />

View File

@@ -1,2 +1,3 @@
<title>{{ .site.title }} &ndash; {{ pageMetaField "literatur" "title" }}</title>
<meta name="description" content="{{ pageMetaField "literatur" "description" }}" />
<meta name="page-key" content="literatur" />

View File

@@ -1 +1,2 @@
<title>{{ .site.title }} &ndash; Reihen</title>
<meta name="page-key" content="reihen" />

View File

@@ -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

View File

@@ -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 {