Führe eine zentrale Widget-Registry mit visuellem Seiteneditor ein.
CI Feature / test (push) Successful in 31s
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:
1 parent
cfdd6de0c7
commit
9d936bfa4a
76 files changed
+4237
-475
No files matched your search
@@ -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>
|
||||
@@ -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>
|
||||
Reference in new issue
Block a user