Startseite: großes Bild über der Begrüßung

Wie bei der Vitus-App zeigt die Startseite oben ein Bild. Es wird in den
Einstellungen gewählt (oder ausgeblendet); ohne eigenes Foto erscheint
eine Platzhalter-Illustration (static/hero-placeholder.svg).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-30 14:22:47 +00:00
parent bef8574e07
commit 6f706dfa49
6 changed files with 123 additions and 17 deletions

View file

@ -7,7 +7,7 @@ import { cleanHtml } from '$lib/server/sanitize';
export const load = ({ locals }) => {
requireAdmin(locals.user);
const s = getSettings();
return { settings: s, logo: getMedia(s.logoId) };
return { settings: s, logo: getMedia(s.logoId), hero: getMedia(s.heroImageId) };
};
export const actions = {
@ -28,6 +28,8 @@ export const actions = {
intro: f.str('intro', 400),
brandColor,
logoId: f.int('logoId'),
heroEnabled: f.bool('heroEnabled'),
heroImageId: f.int('heroImageId'),
website,
contactEmail: f.str('contactEmail', 200),
contactIntro: f.str('contactIntro', 400),

View file

@ -4,6 +4,7 @@
import Panel from '$lib/admin/Panel.svelte';
import ImageField from '$lib/admin/ImageField.svelte';
import RichEditor from '$lib/admin/RichEditor.svelte';
import Switch from '$lib/admin/Switch.svelte';
let { data } = $props();
const s = $derived(data.settings);
@ -37,6 +38,14 @@
</Panel>
<Panel title="Startseite">
<Switch name="heroEnabled" checked={s.heroEnabled} label="Bild oben anzeigen" hint="Großes Bild über der Begrüßung" />
<div class="max-w-xl">
<ImageField name="heroImageId" value={data.hero} label="Startbild" aspect="aspect-[16/7]" />
<p class="hint">
Am besten ein Foto im Querformat, mindestens 1600 px breit. Solange keins gewählt ist, erscheint eine
Platzhalter-Illustration.
</p>
</div>
<div>
<label class="label" for="greeting">Begrüßung</label>
<input id="greeting" name="greeting" class="field" value={s.greeting} />