Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m29s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m31s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m56s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m2s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m20s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m22s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m42s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m41s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m18s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
64 lines
4.5 KiB
PHP
64 lines
4.5 KiB
PHP
<x-filament-panels::page>
|
||
{{-- Eigene Anordnung: Formular links, Vorschau rechts (klebt beim Scrollen). --}}
|
||
<style>
|
||
.appearance-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
|
||
@media (min-width: 1280px) { .appearance-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } .appearance-preview { position: sticky; top: 5rem; align-self: start; } }
|
||
.appearance-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .75rem; border-bottom: 1px solid rgba(127,127,127,.2); }
|
||
.appearance-seg { display: flex; padding: 2px; border-radius: .5rem; background: rgba(127,127,127,.12); font-size: .75rem; }
|
||
.appearance-seg button { padding: .25rem .6rem; border-radius: .375rem; color: inherit; opacity: .65; }
|
||
.appearance-seg button[aria-pressed="true"] { background: white; color: #111; opacity: 1; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
|
||
.appearance-frame { position: relative; height: 70vh; overflow: hidden; background: #f4f5f7; }
|
||
.appearance-frame iframe { position: absolute; top: 0; left: 0; width: 1280px; border: 0; transform-origin: top left; }
|
||
</style>
|
||
|
||
<div
|
||
x-data="{
|
||
page: '/',
|
||
mode: 'hell',
|
||
stamp: Date.now(),
|
||
scale: 0.55,
|
||
get src() { return this.page + (this.page.includes('?') ? '&' : '?') + 'vorschau=entwurf&modus=' + this.mode + '&t=' + this.stamp },
|
||
}"
|
||
x-init="$nextTick(() => { const frame = $el.querySelector('.appearance-frame'); if (frame) new ResizeObserver(() => scale = frame.clientWidth / 1280).observe(frame) })"
|
||
x-on:theme-preview-reload.window="stamp = Date.now()"
|
||
class="appearance-grid"
|
||
>
|
||
<form wire:submit="save" style="display: grid; gap: 1.5rem; align-content: start;">
|
||
@if ($this->hasDraft())
|
||
<p class="flex items-center gap-2 rounded-lg bg-warning-50 px-3 py-2 text-[13px] font-medium text-warning-800 ring-1 ring-warning-600/20 dark:bg-warning-400/10 dark:text-warning-300">
|
||
<x-filament::icon icon="heroicon-o-pencil-square" class="size-4" />
|
||
Gespeicherter Entwurf – noch nicht veröffentlicht.
|
||
</p>
|
||
@endif
|
||
|
||
{{ $this->form }}
|
||
|
||
<div style="display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;">
|
||
<x-filament::button type="submit" icon="heroicon-o-eye">Entwurf speichern und ansehen</x-filament::button>
|
||
<span style="font-size: .875rem; opacity: .7;">Für alle sichtbar erst mit „Veröffentlichen“ oben rechts.</span>
|
||
</div>
|
||
</form>
|
||
|
||
<section class="appearance-preview">
|
||
<x-filament::section :heading="null" style="padding: 0; overflow: hidden;">
|
||
<div class="appearance-toolbar">
|
||
<strong style="margin-right: auto; font-size: .875rem;">Vorschau</strong>
|
||
<div class="appearance-seg" role="group" aria-label="Seite">
|
||
<button type="button" x-on:click="page = '/'" :aria-pressed="page === '/'">Startseite</button>
|
||
<button type="button" x-on:click="page = '/erscheinungsbild/vorschau/anmeldung'" :aria-pressed="page === '/erscheinungsbild/vorschau/anmeldung'">Anmeldung</button>
|
||
<button type="button" x-on:click="page = '/erscheinungsbild/vorschau/beispiel'" :aria-pressed="page === '/erscheinungsbild/vorschau/beispiel'">Beispielseite</button>
|
||
</div>
|
||
<div class="appearance-seg" role="group" aria-label="Darstellung">
|
||
<button type="button" x-on:click="mode = 'hell'" :aria-pressed="mode === 'hell'">Hell</button>
|
||
<button type="button" x-on:click="mode = 'dunkel'" :aria-pressed="mode === 'dunkel'">Dunkel</button>
|
||
</div>
|
||
<a :href="src" target="_blank" style="font-size: .75rem; text-decoration: underline;">Im neuen Tab</a>
|
||
</div>
|
||
<div class="appearance-frame" x-ref="frame">
|
||
<iframe :src="src" title="Vorschau des Portals" :style="`transform: scale(${scale}); height: ${100 / scale}%`"></iframe>
|
||
</div>
|
||
</x-filament::section>
|
||
<p style="margin-top: .5rem; font-size: .75rem; opacity: .7;">Die Vorschau zeigt den gespeicherten Entwurf. Nur Sie sehen ihn – bis zum Veröffentlichen.</p>
|
||
</section>
|
||
</div>
|
||
</x-filament-panels::page>
|