Phase 5: Erscheinungsbild mit Entwurf, Vorschau und Veröffentlichen
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m7s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m11s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m16s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m18s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m49s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m46s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m41s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m0s

- Theme in den Einstellungen (Entwurf/veröffentlicht), Übernahme der
  Einstellungen aus Phase 0; statische CSS-Datei mit Hash beim Veröffentlichen
- Logos hell/dunkel, Signet, App-Symbol → Favicon, Homescreen-Symbole,
  Web-App-Manifest; SVG-Bereinigung
- Markenfarbe exakt, zweite Akzentfarbe, Kopfleiste hell/Marke/dunkel,
  Kontrastprüfung (WCAG AA) mit automatisch lesbarer Linkfarbe
- Lokale Schriften (Latein), Überschriften-Schrift, eigene WOFF2-Schrift,
  Ecken, Dichte, Dunkelmodus-Regel
- Anmeldeseite (geteilt/zentriert, Bild, Texte), Fußzeile, E-Mails im Design
- Admin: Live-Vorschau (Startseite, Anmeldung, Beispielseite; hell/dunkel),
  Veröffentlichen, Verwerfen, Export/Import, Zurücksetzen, eigenes CSS
- Admin-Bereich übernimmt Logo, Farbe und Favicon; Whitelabel

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 10:46:05 +00:00
parent ee8dde93c0
commit 82bbeef31b
148 changed files with 2884 additions and 362 deletions

View file

@ -1,6 +1,10 @@
@php
$branding = app(\App\Support\Branding::class);
$theme = auth()->user()?->theme ?? 'system';
// Erzwungene Darstellung aus dem Erscheinungsbild, sonst die Wahl der Person; ?modus= nur für die Vorschau.
$theme = $branding->forcedColorMode() ?? (auth()->user()?->theme ?? 'system');
if ($branding->isPreviewing() && in_array(request()->query('modus'), ['hell', 'dunkel'], true)) {
$theme = request()->query('modus') === 'dunkel' ? 'dark' : 'light';
}
@endphp
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" @class(['dark' => $theme === 'dark']) data-theme="{{ $theme }}">
@ -10,12 +14,22 @@
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="{{ $branding->primaryColor() }}">
<title inertia>{{ $branding->portalName() }}</title>
<style>:root{ {!! $branding->cssVariables() !!} }</style>
<link rel="icon" href="{{ $branding->faviconUrl() }}">
@if ($branding->appleTouchIconUrl())
<link rel="apple-touch-icon" href="{{ $branding->appleTouchIconUrl() }}">
@endif
<link rel="manifest" href="/manifest.webmanifest">
@if ($theme === 'system')
{{-- Dunkles Systemdesign vor dem ersten Zeichnen übernehmen – kein helles Aufblitzen. --}}
<script>if (matchMedia('(prefers-color-scheme: dark)').matches) document.documentElement.classList.add('dark');</script>
@endif
@vite('resources/js/app.js')
{{-- Erscheinungsbild nach dem Portal-CSS, damit seine Variablen gelten. --}}
@if ($stylesheet = $branding->stylesheetUrl())
<link rel="stylesheet" href="{{ $stylesheet }}">
@else
<style>{!! $branding->inlineCss() !!}</style>
@endif
@inertiaHead
</head>
<body>

View file

@ -0,0 +1,63 @@
<x-filament-panels::page>
{{-- Eigene Anordnung mit Inline-Stilen: Filament liefert fertig kompiliertes CSS ohne freie Tailwind-Klassen. --}}
<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())
<x-filament::section compact>
<span style="color: #b45309; font-weight: 500;">Es gibt einen gespeicherten Entwurf, der noch nicht veröffentlicht ist.</span>
</x-filament::section>
@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>

View file

@ -0,0 +1,25 @@
@props([
'url',
'color' => 'primary',
'align' => 'center',
])
<table class="action" align="{{ $align }}" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td align="{{ $align }}">
<table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td align="{{ $align }}">
<table border="0" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
@php($branding = app(\App\Support\Branding::class))
<a href="{{ $url }}" class="button button-{{ $color }}" target="_blank" rel="noopener" style="background-color: {{ $branding->primaryColor() }}; border-color: {{ $branding->primaryColor() }}; color: {{ \App\Support\ColorPalette::foregroundFor($branding->primaryColor()) }};">{!! $slot !!}</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

View file

@ -0,0 +1,11 @@
<tr>
<td>
<table class="footer" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td class="content-cell" align="center">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</td>
</tr>
</table>
</td>
</tr>

View file

@ -0,0 +1,18 @@
@props(['url'])
@php
$branding = app(\App\Support\Branding::class);
// SVG zeigen viele Mailprogramme nicht an – dann den Namen als Text.
$logo = $branding->logoUrl();
$logo = $logo && ! str_ends_with(strtolower($logo), '.svg') ? $logo : null;
@endphp
<tr>
<td class="header">
<a href="{{ $url }}" style="display: inline-block; color: {{ $branding->primaryColor() }}; text-decoration: none; font-weight: 700; font-size: 19px;">
@if ($logo)
<img src="{{ $logo }}" alt="{{ $branding->portalName() }}" style="max-height: 48px; max-width: 240px; border: 0;">
@else
{{ $branding->portalName() }}
@endif
</a>
</td>
</tr>

View file

@ -0,0 +1,58 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<title>{{ config('app.name') }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="color-scheme" content="light">
<meta name="supported-color-schemes" content="light">
<style>
@media only screen and (max-width: 600px) {
.inner-body {
width: 100% !important;
}
.footer {
width: 100% !important;
}
}
@media only screen and (max-width: 500px) {
.button {
width: 100% !important;
}
}
</style>
{!! $head ?? '' !!}
</head>
<body>
<table class="wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td align="center">
<table class="content" width="100%" cellpadding="0" cellspacing="0" role="presentation">
{!! $header ?? '' !!}
<!-- Email Body -->
<tr>
<td class="body" width="100%" cellpadding="0" cellspacing="0" style="border: hidden !important;">
<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
<!-- Body content -->
<tr>
<td class="content-cell">
{!! Illuminate\Mail\Markdown::parse($slot) !!}
{!! $subcopy ?? '' !!}
</td>
</tr>
</table>
</td>
</tr>
{!! $footer ?? '' !!}
</table>
</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,32 @@
<x-mail::layout>
{{-- Header --}}
<x-slot:header>
<x-mail::header :url="config('app.url')">
{{ app(\App\Support\Branding::class)->portalName() }}
</x-mail::header>
</x-slot:header>
{{-- Body --}}
{!! $slot !!}
{{-- Subcopy --}}
@isset($subcopy)
<x-slot:subcopy>
<x-mail::subcopy>
{!! $subcopy !!}
</x-mail::subcopy>
</x-slot:subcopy>
@endisset
{{-- Footer --}}
<x-slot:footer>
<x-mail::footer>
@php($emailFooter = app(\App\Support\Branding::class)->get('email_footer'))
@if ($emailFooter)
{!! nl2br(e($emailFooter)) !!}
@else
© {{ date('Y') }} {{ app(\App\Support\Branding::class)->portalName() }}
@endif
</x-mail::footer>
</x-slot:footer>
</x-mail::layout>

View file

@ -0,0 +1,14 @@
<table class="panel" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td class="panel-content">
<table width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td class="panel-item">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</td>
</tr>
</table>
</td>
</tr>
</table>

View file

@ -0,0 +1,7 @@
<table class="subcopy" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td>
{{ Illuminate\Mail\Markdown::parse($slot) }}
</td>
</tr>
</table>

View file

@ -0,0 +1,3 @@
<div class="table">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</div>

View file

@ -0,0 +1,297 @@
/* Base */
body,
body *:not(html):not(style):not(br):not(tr):not(code) {
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
position: relative;
}
body {
-webkit-text-size-adjust: none;
background-color: #ffffff;
color: #52525b;
height: 100%;
line-height: 1.4;
margin: 0;
padding: 0;
width: 100% !important;
}
p,
ul,
ol,
blockquote {
line-height: 1.4;
text-align: start;
}
a {
color: #18181b;
}
a img {
border: none;
}
/* Typography */
h1 {
color: #18181b;
font-size: 18px;
font-weight: bold;
margin-top: 0;
text-align: start;
}
h2 {
font-size: 16px;
font-weight: bold;
margin-top: 0;
text-align: start;
}
h3 {
font-size: 14px;
font-weight: bold;
margin-top: 0;
text-align: left;
}
p {
font-size: 16px;
line-height: 1.5em;
margin-top: 0;
text-align: left;
}
p.sub {
font-size: 12px;
}
img {
max-width: 100%;
}
/* Layout */
.wrapper {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 100%;
background-color: #fafafa;
margin: 0;
padding: 0;
width: 100%;
}
.content {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 100%;
margin: 0;
padding: 0;
width: 100%;
}
/* Header */
.header {
padding: 25px 0;
text-align: center;
}
.header a {
color: #18181b;
font-size: 19px;
font-weight: bold;
text-decoration: none;
}
/* Logo */
.logo {
height: 75px;
margin-top: 15px;
margin-bottom: 10px;
max-height: 75px;
width: 75px;
}
/* Body */
.body {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 100%;
background-color: #fafafa;
border-bottom: 1px solid #fafafa;
border-top: 1px solid #fafafa;
margin: 0;
padding: 0;
width: 100%;
}
.inner-body {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 570px;
background-color: #ffffff;
border-color: #e4e4e7;
border-radius: 4px;
border-width: 1px;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
margin: 0 auto;
padding: 0;
width: 570px;
}
.inner-body a {
word-break: break-all;
}
/* Subcopy */
.subcopy {
border-top: 1px solid #e4e4e7;
margin-top: 25px;
padding-top: 25px;
}
.subcopy p {
font-size: 14px;
}
/* Footer */
.footer {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 570px;
margin: 0 auto;
padding: 0;
text-align: center;
width: 570px;
}
.footer p {
color: #a1a1aa;
font-size: 12px;
text-align: center;
}
.footer a {
color: #a1a1aa;
text-decoration: underline;
}
/* Tables */
.table table {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 100%;
margin: 30px auto;
width: 100%;
}
.table th {
border-bottom: 1px solid #e4e4e7;
margin: 0;
padding-bottom: 8px;
}
.table td {
color: #52525b;
font-size: 15px;
line-height: 18px;
margin: 0;
padding: 10px 0;
}
.content-cell {
max-width: 100vw;
padding: 32px;
}
/* Buttons */
.action {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
-premailer-width: 100%;
margin: 30px auto;
padding: 0;
text-align: center;
width: 100%;
float: unset;
}
.button {
-webkit-text-size-adjust: none;
border-radius: 4px;
color: #fff;
display: inline-block;
overflow: hidden;
text-decoration: none;
}
.button-blue,
.button-primary {
background-color: #18181b;
border-bottom: 8px solid #18181b;
border-left: 18px solid #18181b;
border-right: 18px solid #18181b;
border-top: 8px solid #18181b;
}
.button-green,
.button-success {
background-color: #16a34a;
border-bottom: 8px solid #16a34a;
border-left: 18px solid #16a34a;
border-right: 18px solid #16a34a;
border-top: 8px solid #16a34a;
}
.button-red,
.button-error {
background-color: #dc2626;
border-bottom: 8px solid #dc2626;
border-left: 18px solid #dc2626;
border-right: 18px solid #dc2626;
border-top: 8px solid #dc2626;
}
/* Panels */
.panel {
border-left: #18181b solid 4px;
margin: 21px 0;
}
.panel-content {
background-color: #fafafa;
color: #52525b;
padding: 16px;
}
.panel-content p {
color: #52525b;
}
.panel-item {
padding: 0;
}
.panel-item p:last-of-type {
margin-bottom: 0;
padding-bottom: 0;
}
/* Utilities */
.break-all {
word-break: break-all;
}

View file

@ -0,0 +1 @@
{{ $slot }}: {{ $url }}

View file

@ -0,0 +1 @@
{{ $slot }}

View file

@ -0,0 +1 @@
{{ $slot }}: {{ $url }}

View file

@ -0,0 +1,9 @@
{!! strip_tags($header ?? '') !!}
{!! strip_tags($slot) !!}
@isset($subcopy)
{!! strip_tags($subcopy) !!}
@endisset
{!! strip_tags($footer ?? '') !!}

View file

@ -0,0 +1,27 @@
<x-mail::layout>
{{-- Header --}}
<x-slot:header>
<x-mail::header :url="config('app.url')">
{{ app(\App\Support\Branding::class)->portalName() }}
</x-mail::header>
</x-slot:header>
{{-- Body --}}
{{ $slot }}
{{-- Subcopy --}}
@isset($subcopy)
<x-slot:subcopy>
<x-mail::subcopy>
{{ $subcopy }}
</x-mail::subcopy>
</x-slot:subcopy>
@endisset
{{-- Footer --}}
<x-slot:footer>
<x-mail::footer>
© {{ date('Y') }} {{ app(\App\Support\Branding::class)->portalName() }}. @lang('All rights reserved.')
</x-mail::footer>
</x-slot:footer>
</x-mail::layout>

View file

@ -0,0 +1 @@
{{ $slot }}

View file

@ -0,0 +1 @@
{{ $slot }}

View file

@ -0,0 +1 @@
{{ $slot }}