Führe eine zentrale Widget-Registry mit visuellem Seiteneditor ein.
CI Feature / test (push) Successful in 31s

- Codebasiertes Widget-Register (config/cms.php) mit Vertrag
  {id, type, v, variant, settings, data, refs}: Typkennung, Schemaversion,
  Prüfregeln, freigegebene Varianten, Editorfelder, Blade-Ansicht,
  Verweisauflösung und Medienliste je Widget-Art.
- Die sechs Bestandsbausteine bleiben als Version 1 lesbar; gespeicherte
  Revisionen werden nicht umgeschrieben, sondern beim Lesen angehoben
  (Bild und Text: Version 2 mit Titel, formatiertem Text, Bild links/rechts).
  Wiederherstellen kopiert eine Revision unverändert.
- Neue Widgets: Einstieg (Hero) und Programm-/Modulkarten. Letztere speichern
  nur Verweise; Titel und Kurzbeschreibung kommen aus den Fachdaten. Öffentlich
  erscheinen nur Programme mit Anzeigefreigabe (gleiche Regel wie /programme,
  jetzt in PublicCatalogReader); Module nur in der Redaktionsvorschau, bis
  öffentliche Profile (ADR-29) bestehen.
- Ein Renderer für öffentliche Seite, Vorschau und Blockvorschau im Editor.
- Seiteneditor als Filament-Builder: Auswahl mit Beschreibung und Schema,
  kompakte Abschnitte mit Vorschau, Bearbeitung im Dialog, Sortieren,
  Duplizieren. Speichern erzeugt nur einen Entwurf.
- Vorschau einer Revision in 390/768/1440 px; Vorschauroute nutzt den
  Personal-Guard (vorher war sie für Redakteure ohne Mitgliedersitzung
  nicht erreichbar).
- Basislayout in Komponenten (Marke, Kopf, Fuß, Seitenvorlage).
- Navigation: bearbeiten, ausblenden, löschen, per Ziehen sortieren;
  unsichere Adressen (javascript:) werden abgewiesen und nicht ausgegeben.
  Ergänzende Migration is_visible (Vorgabe sichtbar).
- Pfadfehler und doppelte Pfade erscheinen am Pfadfeld statt still zu scheitern.

Tests: BlockRegistryTest geht in WidgetRegistryTest auf (gleiche Prüfungen
plus Registrierung, Versionierung, Bereinigung). Bestandsseiten werden gegen
Textfixtures aus dem Stand vor der Umstellung geprüft.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-17 17:49:30 +01:00
1 parent cfdd6de0c7
commit 9d936bfa4a
76 files changed
+4237 -475

No files matched your search

@@ -0,0 +1,10 @@
{{--
Markenzeichen der Website. Solange keine freigegebene Wortmarke als Datei vorliegt
(docs/Brand-UI-Kit/README.md, Abschnitt Markenleitlinien Nr. 5), bleibt es die Textwortmarke.
Eine freigegebene Datei wird ausschließlich hier eingesetzt.
--}}
@props(['compact' => false])
<div {{ $attributes->class(['wordmark', 'wordmark-compact' => $compact]) }}>
<a href="{{ route('home') }}"><strong>Lara &amp; Felix</strong></a>
<span>Stark im Alltag</span>
</div>
@@ -0,0 +1,13 @@
@props(['navigation'])
<footer class="site-footer">
<div class="site-footer-inner">
<x-site.brand compact />
<nav aria-label="Rechtliches und Service">
@foreach ($navigation->where('placement', 'footer') as $item)
@if ($item->href())
<a href="{{ $item->href() }}">{{ $item->label }}</a>
@endif
@endforeach
</nav>
</div>
</footer>
@@ -0,0 +1,18 @@
@props(['navigation', 'page' => null])
<header class="masthead">
<div class="masthead-inner">
<x-site.brand />
<nav class="site-nav" aria-label="Hauptnavigation">
@foreach ($navigation->where('placement', 'header') as $item)
@if ($item->href())
<a href="{{ $item->href() }}" @if($page !== null && $item->page_id === $page->id) aria-current="page" @endif>{{ $item->label }}</a>
@endif
@endforeach
@auth('web')
<a href="{{ route('member.dashboard') }}">Mitgliederbereich</a>
@else
<a href="{{ route('register') }}">Registrieren</a>
@endauth
</nav>
</div>
</header>
@@ -0,0 +1,9 @@
<style>
.luf-widget-pick { display: flex; gap: .75rem; align-items: flex-start; text-align: start; white-space: normal; }
.luf-widget-pick-schematic { flex: none; border: 1px solid rgb(0 0 0 / 12%); border-radius: 3px; }
.luf-widget-pick-text { display: flex; flex-direction: column; gap: .15rem; }
.luf-widget-pick-name { font-weight: 600; }
.luf-widget-pick-desc { font-size: .8rem; line-height: 1.3; opacity: .8; }
.luf-widget-preview-frame { display: block; width: 100%; min-height: 4rem; border: 0; pointer-events: none; background: #f7faf8; }
.luf-widget-preview-empty { margin: 0; padding: 1rem; font-size: .875rem; opacity: .75; }
</style>
@@ -0,0 +1,22 @@
{{--
Blockvorschau im Seiteneditor. Das Widget wird mit derselben Ansicht wie auf der öffentlichen Seite gerendert
und in einem eigenen Dokument angezeigt, damit Website- und Verwaltungsstile sich nicht überlagern.
--}}
@php
$document = '<!DOCTYPE html><html lang="de"><head><meta charset="utf-8"><base target="_blank">'
.$stylesheets
.'<style>html{background:var(--color-sheet,#f7faf8)}body{margin:0;padding:1.25rem 1.5rem;min-height:0}main{display:block}</style>'
.'</head><body><main class="sheet-preview">'.$html.'</main></body></html>';
@endphp
@if (trim($html) === '')
<p class="luf-widget-preview-empty">Dieser Abschnitt zeigt öffentlich nichts an. Bitte Inhalte ergänzen.</p>
@else
<iframe
class="luf-widget-preview-frame"
title="Vorschau des Abschnitts"
tabindex="-1"
srcdoc="{{ $document }}"
loading="lazy"
onload="this.style.height = (this.contentDocument?.documentElement?.scrollHeight ?? 200) + 'px'"
></iframe>
@endif
+2 -31
View File
@@ -15,42 +15,13 @@
</head>
<body>
<a class="skip" href="#inhalt">Zum Inhalt</a>
<header class="masthead">
<div class="masthead-inner">
<div class="wordmark">
<a href="{{ route('home') }}"><strong>Lara &amp; Felix</strong></a>
<span>Stark im Alltag</span>
</div>
<nav class="site-nav" aria-label="Hauptnavigation">
@foreach (($navigation ?? collect())->where('placement', 'header') as $item)
@if ($item->href())
<a href="{{ $item->href() }}" @if(isset($page) && $item->page_id === $page->id) aria-current="page" @endif>{{ $item->label }}</a>
@endif
@endforeach
@auth
<a href="{{ route('member.dashboard') }}">Mitgliederbereich</a>
@else
<a href="{{ route('register') }}">Registrieren</a>
@endauth
</nav>
</div>
</header>
<x-site.header :navigation="$navigation ?? collect()" :page="$page ?? null" />
<main id="inhalt" class="sheet">
@if (session('status'))
<p class="status" role="status">{{ session('status') }}</p>
@endif
@yield('content')
</main>
<footer class="site-footer">
<div class="site-footer-inner">
<nav aria-label="Rechtliches und Service">
@foreach (($navigation ?? collect())->where('placement', 'footer') as $item)
@if ($item->href())
<a href="{{ $item->href() }}">{{ $item->label }}</a>
@endif
@endforeach
</nav>
</div>
</footer>
<x-site.footer :navigation="$navigation ?? collect()" />
</body>
</html>
@@ -1,7 +0,0 @@
<div class="cta">
<h2>{{ $block['heading'] }}</h2>
@if (filled($block['text'] ?? null))
<p>{{ $block['text'] }}</p>
@endif
<a href="{{ $block['url'] }}">{{ $block['label'] }}</a>
</div>
@@ -1,19 +0,0 @@
<ul class="cards">
@foreach ($block['items'] as $item)
<li class="card">
@if (filled($item['url'] ?? null))
<a href="{{ $item['url'] }}">
<h3>{{ $item['title'] }}</h3>
@if (filled($item['text'] ?? null))
<p>{{ $item['text'] }}</p>
@endif
</a>
@else
<h3>{{ $item['title'] }}</h3>
@if (filled($item['text'] ?? null))
<p>{{ $item['text'] }}</p>
@endif
@endif
</li>
@endforeach
</ul>
@@ -1,6 +0,0 @@
<dl class="faq">
@foreach ($block['items'] as $item)
<dt>{{ $item['question'] }}</dt>
<dd>{{ $item['answer'] }}</dd>
@endforeach
</dl>
@@ -1,8 +0,0 @@
@if (! empty($first))
<h1>{{ $block['heading'] }}</h1>
@else
<h2>{{ $block['heading'] }}</h2>
@endif
@if (filled($block['intro'] ?? null))
<p class="lede">{{ $block['intro'] }}</p>
@endif
@@ -1,10 +0,0 @@
<div class="image-text">
@if (filled($block['image'] ?? null))
<img src="{{ route('media.public', ['path' => $block['image']]) }}" alt="{{ $block['alt'] }}">
@endif
<div class="prose">
@foreach (preg_split("/\n\s*\n/", trim($block['body'])) as $paragraph)
<p>{{ $paragraph }}</p>
@endforeach
</div>
</div>
@@ -1,5 +0,0 @@
<div class="prose">
@foreach (preg_split("/\n\s*\n/", trim($block['body'])) as $paragraph)
<p>{{ $paragraph }}</p>
@endforeach
</div>
+1 -11
View File
@@ -8,15 +8,5 @@
@if ($preview)
<p class="preview-banner" role="status">Vorschau einer unveröffentlichten Revision. Die öffentliche Seite bleibt unverändert.</p>
@endif
@foreach ($revision->blocks as $block)
<section class="block">
@include('public.blocks.'.$block['type'], ['block' => $block, 'first' => $loop->first])
</section>
@endforeach
@if ($page->path === '/' && ($themes ?? collect())->isNotEmpty())
<section class="block">
<h2>Themenbereiche</h2>
@include('public.themes.list', ['themes' => $themes])
</section>
@endif
@include($template, ['content' => $content, 'page' => $page, 'themes' => $themes ?? collect()])
@endsection
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<title>Vorschau {{ $page->path }} · Revision {{ $revision->id }}</title>
<style>
:root { color-scheme: light; --ink: #1b2838; --line: #c5d2cb; --pine: #0f6e56; }
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Source Sans 3', 'Segoe UI', sans-serif; background: #dfe6e2; color: var(--ink); }
.bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; padding: .75rem 1rem; background: var(--ink); color: #f4f7f5; }
.bar strong { font-size: 1rem; }
.bar p { margin: 0; font-size: .9rem; }
.widths { display: flex; gap: .4rem; margin-left: auto; }
.widths button { font: inherit; border: 1px solid rgb(255 255 255 / 45%); background: transparent; color: inherit; padding: .35rem .8rem; border-radius: .25rem; cursor: pointer; }
.widths button[aria-pressed='true'] { background: #f4f7f5; color: var(--ink); }
.widths button:focus-visible, .bar a:focus-visible { outline: 3px solid #fcd10a; outline-offset: 2px; }
.bar a { color: inherit; }
.stage { overflow-x: auto; padding: 1.25rem 1rem 3rem; }
.device { margin-inline: auto; background: white; box-shadow: 0 1px 4px rgb(0 0 0 / 18%); transition: none; }
.device iframe { display: block; width: 100%; height: calc(100vh - 7rem); min-height: 36rem; border: 0; }
.size { text-align: center; font-size: .85rem; margin: 0 0 .5rem; }
</style>
</head>
<body>
<div class="bar">
<strong>Vorschau {{ $page->path }}</strong>
<p>Revision {{ $revision->id }} · {{ $isLive ? 'veröffentlicht' : 'nicht veröffentlicht' }}</p>
<div class="widths" role="group" aria-label="Ansichtsbreite">
<button type="button" data-width="390" aria-pressed="false">Smartphone 390 px</button>
<button type="button" data-width="768" aria-pressed="false">Tablet 768 px</button>
<button type="button" data-width="1440" aria-pressed="true">Desktop 1440 px</button>
</div>
<p><a href="{{ route('pages.preview', $revision) }}" target="_blank" rel="noopener">Ohne Rahmen öffnen</a></p>
</div>
<div class="stage">
<p class="size" id="preview-size" aria-live="polite">Desktop, 1440 px</p>
<div class="device" id="preview-device" style="width: 1440px">
<iframe src="{{ route('pages.preview', $revision) }}" title="Seitenvorschau {{ $page->path }}"></iframe>
</div>
</div>
<script>
(() => {
const names = { 390: 'Smartphone', 768: 'Tablet', 1440: 'Desktop' };
const device = document.getElementById('preview-device');
const size = document.getElementById('preview-size');
const buttons = document.querySelectorAll('[data-width]');
buttons.forEach((button) => button.addEventListener('click', () => {
const width = Number(button.dataset.width);
device.style.width = width + 'px';
size.textContent = names[width] + ', ' + width + ' px';
buttons.forEach((other) => other.setAttribute('aria-pressed', String(other === button)));
}));
})();
</script>
</body>
</html>
@@ -0,0 +1,10 @@
{{-- Seitenvorlage „standard“: Widgets in voller Inhaltsbreite untereinander. --}}
<div class="page-template page-template-standard">
{{ $content }}
@if ($page->path === '/' && $themes->isNotEmpty())
<section class="block">
<h2>Themenbereiche</h2>
@include('public.themes.list', ['themes' => $themes])
</section>
@endif
</div>
@@ -0,0 +1,9 @@
<div class="cta">
<h2>{{ $data['heading'] ?? '' }}</h2>
@if (filled($data['text'] ?? null))
<p>{{ $data['text'] }}</p>
@endif
@if (\App\Domain\Cms\Widgets\Support\SafeUrl::isSafe($data['url'] ?? null))
<a href="{{ $data['url'] }}">{{ $data['label'] ?? '' }}</a>
@endif
</div>
+27
View File
@@ -0,0 +1,27 @@
@if ($items !== [])
<ul class="cards cards-{{ $variant === 'compact' ? 'compact' : 'grid' }}">
@foreach ($items as $item)
<li class="card @if ($item['imageUrl']) card-with-image @endif">
@if ($item['url'])
<a href="{{ $item['url'] }}">
@if ($item['imageUrl'])
<img class="card-image" src="{{ $item['imageUrl'] }}" alt="" loading="lazy">
@endif
<h3>{{ $item['title'] }}</h3>
@if (filled($item['text']))
<p>{{ $item['text'] }}</p>
@endif
</a>
@else
@if ($item['imageUrl'])
<img class="card-image" src="{{ $item['imageUrl'] }}" alt="" loading="lazy">
@endif
<h3>{{ $item['title'] }}</h3>
@if (filled($item['text']))
<p>{{ $item['text'] }}</p>
@endif
@endif
</li>
@endforeach
</ul>
@endif
@@ -0,0 +1,39 @@
@if ($entries !== [] || $context->preview)
<div class="catalog-cards catalog-cards-{{ $variant === 'compact' ? 'compact' : 'standard' }}">
@if (filled($data['heading'] ?? null))
<h2>{{ $data['heading'] }}</h2>
@endif
@if (filled($data['intro'] ?? null))
<p class="lede">{{ $data['intro'] }}</p>
@endif
@if ($entries === [])
<p class="preview-note">Noch kein Programm oder Modul gewählt, oder keines ist öffentlich sichtbar. Öffentlich erscheint dieser Abschnitt nicht.</p>
@else
<ul class="catalog-list">
@foreach ($entries as $entry)
<li class="catalog-card @unless ($entry->public) catalog-card-internal @endunless">
@if ($variant !== 'compact')
<div class="catalog-card-visual" aria-hidden="true"><span>{{ $entry->kindLabel }}</span></div>
@endif
<div class="catalog-card-body">
<p class="catalog-card-kind">{{ $entry->kindLabel }}</p>
<h3>
@if ($entry->url)
<a href="{{ $entry->url }}">{{ $entry->title }}</a>
@else
{{ $entry->title }}
@endif
</h3>
@if ($variant !== 'compact' && filled($entry->summary))
<p>{{ $entry->summary }}</p>
@endif
@unless ($entry->public)
<p class="preview-note">Nur in der Redaktionsvorschau sichtbar: Für diese Inhaltsart gibt es noch keine öffentliche Freigabe (öffentliches Profil, ADR-29).</p>
@endunless
</div>
</li>
@endforeach
</ul>
@endif
</div>
@endif
+6
View File
@@ -0,0 +1,6 @@
<dl class="faq">
@foreach ($data['items'] ?? [] as $item)
<dt>{{ $item['question'] ?? '' }}</dt>
<dd>{{ $item['answer'] ?? '' }}</dd>
@endforeach
</dl>
@@ -0,0 +1,8 @@
@if (! empty($first))
<h1>{{ $data['heading'] ?? '' }}</h1>
@else
<h2>{{ $data['heading'] ?? '' }}</h2>
@endif
@if (filled($data['intro'] ?? null))
<p class="lede">{{ $data['intro'] }}</p>
@endif
+18
View File
@@ -0,0 +1,18 @@
<div class="hero hero-{{ $variant === 'highlight' ? 'highlight' : 'standard' }} @if ($imageUrl) hero-with-image @endif">
<div class="hero-copy">
@if (! empty($first))
<h1>{{ $data['heading'] ?? '' }}</h1>
@else
<h2>{{ $data['heading'] ?? '' }}</h2>
@endif
@if (filled($data['text'] ?? null))
<p class="lede">{{ $data['text'] }}</p>
@endif
@if ($action)
<a class="button" href="{{ $action['url'] }}">{{ $action['label'] }}</a>
@endif
</div>
@if ($imageUrl)
<img class="hero-image" src="{{ $imageUrl }}" alt="{{ $data['alt'] ?? '' }}">
@endif
</div>
@@ -0,0 +1,15 @@
<div class="image-text image-text-{{ $variant === 'image_right' ? 'right' : 'left' }} @unless ($imageUrl) image-text-no-image @endunless">
@if ($imageUrl)
<img src="{{ $imageUrl }}" alt="{{ $data['alt'] ?? '' }}" loading="lazy">
@endif
<div class="image-text-copy">
@if (filled($data['title'] ?? null))
@if (! empty($first))
<h1>{{ $data['title'] }}</h1>
@else
<h2>{{ $data['title'] }}</h2>
@endif
@endif
<div class="prose">{!! $body !!}</div>
</div>
</div>
+7
View File
@@ -0,0 +1,7 @@
@if (filled($data['body'] ?? null))
<div class="prose">
@foreach (preg_split("/\n\s*\n/", trim($data['body'])) as $paragraph)
<p>{{ $paragraph }}</p>
@endforeach
</div>
@endif