Globale Fußzeile mit Baukasten (0.38.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 10m3s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 9m26s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 10m59s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 11m24s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m26s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m54s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m8s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m26s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 49s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m6s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-27 15:59:26 +00:00
parent 6f59caa880
commit 8eb5d4a475
189 changed files with 1011 additions and 571 deletions

View file

@ -20,6 +20,7 @@ import PersonAvatar from '@/components/PersonAvatar.vue';
import NavLink from '@/components/nav/NavLink.vue';
import AppIcon from '@/components/AppIcon.vue';
import GlobalSearchBox from '@/components/GlobalSearchBox.vue';
import PageContent from '@/pagebuilder/PageContent.vue';
import { useThemePreference } from '@/composables/useThemePreference';
defineProps({
@ -29,6 +30,8 @@ defineProps({
const page = usePage();
const user = computed(() => page.props.auth.user);
const branding = computed(() => page.props.branding);
// Frei gestaltete Fußzeile (Backend → Startseite & Menü → Fußzeile gestalten)
const footerContent = computed(() => (page.props.footerContent?.blocks?.length ? page.props.footerContent : null));
const headerStyle = computed(() => branding.value.header_style ?? 'light');
const navigation = computed(() => page.props.navigation);
@ -308,8 +311,11 @@ const themeOptions = [
<slot />
</main>
<footer v-if="branding.footer.text || branding.footer.links.length" class="border-t">
<div class="mx-auto flex max-w-[1440px] flex-wrap items-center justify-between gap-x-6 gap-y-2 px-4 py-5 text-[13px] text-muted-foreground lg:px-6">
<footer v-if="footerContent || branding.footer.text || branding.footer.links.length" class="border-t" :class="{ 'bg-card': footerContent }">
<div v-if="footerContent" class="@container mx-auto max-w-[1440px] px-4 pt-10 pb-6 lg:px-6">
<PageContent :content="footerContent" />
</div>
<div v-if="branding.footer.text || branding.footer.links.length" class="mx-auto flex max-w-[1440px] flex-wrap items-center justify-between gap-x-6 gap-y-2 px-4 py-5 text-[13px] text-muted-foreground lg:px-6" :class="{ 'border-t': footerContent }">
<p v-if="branding.footer.text">{{ branding.footer.text }}</p>
<nav v-if="branding.footer.links.length" class="flex flex-wrap gap-x-5 gap-y-1" aria-label="Fußzeile">
<a v-for="link in branding.footer.links" :key="link.url" :href="link.url" class="hover:text-foreground hover:underline">{{ link.label }}</a>

View file

@ -17,9 +17,9 @@ import { useMediaPicker } from '@/components/media/useMediaPicker';
import { http } from '@/lib/http';
/**
* Frei gestaltete Startseite: derselbe Baukasten wie bei Seiten, dazu jede
* Frei gestaltete Startseite bzw. Fußzeile: derselbe Baukasten wie bei Seiten, dazu jede
* Startseiten-Kachel als Block. Entwurf wird laufend gespeichert, sichtbar erst
* nach „Veröffentlichen“.
* nach „Veröffentlichen“. Texte und Adressen kommen über „config“ vom Server.
*/
const props = defineProps({
content: { type: Object, required: true },
@ -29,9 +29,11 @@ const props = defineProps({
blockGroups: { type: Object, required: true },
audienceOptions: { type: Object, required: true },
uploadsUrl: { type: String, required: true },
config: { type: Object, required: true },
});
const base = '/startseite/gestalten';
const base = props.config.base;
const isHomepage = props.config.kind === 'homepage';
const types = Object.fromEntries(props.blockTypes.map((type) => [type.key, type]));
const working = reactive({ content: clone(props.content) });
@ -98,7 +100,7 @@ function containsActive(item) {
}
const uploadImage = (file, onProgress) => uploadWithProgress(`${base}/bilder`, file, { onProgress });
const mediaPicker = useMediaPicker({ upload: uploadImage, contextLabel: 'Auf der Startseite', contextPaths: () => collectImagePaths(working.content) });
const mediaPicker = useMediaPicker({ upload: uploadImage, contextLabel: props.config.media_label, contextPaths: () => collectImagePaths(working.content) });
provide('pagebuilder:editor', {
types,
@ -198,7 +200,7 @@ function applyContent(content) {
const publishing = ref(false);
async function publish() {
const activate = state.value.mode !== 'builder';
const activate = isHomepage && state.value.mode !== 'builder';
if (activate && !window.confirm('Veröffentlichen und die frei gestaltete Startseite für alle einschalten? Die bisherige Kachel-Startseite bleibt erhalten und lässt sich im Backend unter „Startseite“ wieder wählen.')) return;
@ -210,7 +212,7 @@ async function publish() {
state.value = data.state;
revisions.value = data.revisions;
saveState.value = 'saved';
toast.success(activate ? 'Veröffentlicht – die Startseite ist jetzt frei gestaltet.' : 'Veröffentlicht – die Startseite ist aktualisiert.');
toast.success(activate ? 'Veröffentlicht – die Startseite ist jetzt frei gestaltet.' : isHomepage ? 'Veröffentlicht – die Startseite ist aktualisiert.' : 'Veröffentlicht – die Fußzeile ist aktualisiert.');
} catch (error) {
toast.error(error.message);
} finally {
@ -238,7 +240,7 @@ async function restore(revision) {
async function openPreview() {
await save();
window.open('/?entwurf=1', '_blank');
window.open(props.config.preview, '_blank');
}
const devices = [
@ -259,13 +261,13 @@ onBeforeUnmount(() => window.removeEventListener('beforeunload', warnUnsaved));
</script>
<template>
<Head title="Startseite gestalten" />
<Head :title="config.title" />
<div class="flex h-dvh flex-col bg-background">
<header class="flex shrink-0 items-center gap-3 border-b bg-card px-3 py-2 sm:px-4">
<a href="/admin/startseite" class="grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent" aria-label="Zurück ins Backend"><ArrowLeft class="size-5" /></a>
<a :href="config.back" class="grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent" aria-label="Zurück ins Backend"><ArrowLeft class="size-5" /></a>
<div class="min-w-0 flex-1">
<p class="truncate text-sm font-semibold">Startseite gestalten</p>
<p class="truncate text-sm font-semibold">{{ config.title }}</p>
<p class="flex items-center gap-1.5 text-xs text-muted-foreground">
<LoaderCircle v-if="saveState === 'saving'" class="size-3 animate-spin" />
<CloudAlert v-else-if="saveState === 'error'" class="size-3 text-destructive" />
@ -273,9 +275,9 @@ onBeforeUnmount(() => window.removeEventListener('beforeunload', warnUnsaved));
<span v-if="saveState === 'error'">Nicht gespeichert</span>
<span v-else-if="saveState !== 'saved'">Entwurf wird gespeichert …</span>
<span v-else-if="state.has_draft">Entwurf gespeichert – noch nicht veröffentlicht</span>
<span v-else-if="!state.published">Noch nicht veröffentlicht – Ausgangspunkt ist die heutige Startseite</span>
<span v-else-if="!state.published">{{ config.initial }}</span>
<span v-else>Veröffentlicht</span>
<span class="max-sm:sr-only">· Startseite zeigt derzeit: {{ state.mode === 'builder' ? 'diese Gestaltung' : 'Kacheln (wie bisher)' }}</span>
<span v-if="isHomepage" class="max-sm:sr-only">· Startseite zeigt derzeit: {{ state.mode === 'builder' ? 'diese Gestaltung' : 'Kacheln (wie bisher)' }}</span>
</p>
</div>
@ -308,7 +310,7 @@ onBeforeUnmount(() => window.removeEventListener('beforeunload', warnUnsaved));
<main class="min-w-0 flex-1 overflow-y-auto bg-muted/40" @click="select(null)">
<div class="mx-auto px-4 py-8 transition-[max-width] duration-300 sm:px-6" :class="canvasWidth">
<p v-if="!working.content.blocks.length" class="rounded-lg border border-dashed bg-card p-8 text-center text-sm text-muted-foreground">
Leere Startseite – rechts Blöcke wählen, z. B. „Spalten“ und darin „Neuigkeiten“ oder „Kachel“.
{{ config.empty }}
</p>
<div class="@container">
<EditorBlockList :item="working.content" root />
@ -336,7 +338,7 @@ onBeforeUnmount(() => window.removeEventListener('beforeunload', warnUnsaved));
<div class="min-h-0 flex-1 overflow-y-auto p-4">
<BlockSettings v-if="sidebarTab === 'block' && selected" :key="selected.id" :block="selected" />
<template v-else>
<p class="mb-4 text-xs text-muted-foreground">Unter „Startseite“ stehen alle Kacheln als Block bereit. Jeder Block lässt sich über „Sichtbarkeit“ auf Rollen, Abteilungen oder Standorte beschränken.</p>
<p class="mb-4 text-xs text-muted-foreground">{{ config.hint }}</p>
<BlockPalette @pick="insertFromPalette" />
</template>
</div>