Loheide-eu-mitarbeiterplatt.../resources/js/layouts/AppLayout.vue
Friederich Loheide 82bbeef31b
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
Phase 5: Erscheinungsbild mit Entwurf, Vorschau und Veröffentlichen
- 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>
2026-09-26 10:46:05 +00:00

195 lines
10 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup>
import { computed, ref } from 'vue';
import { Head, Link, router, usePage } from '@inertiajs/vue3';
import { ChevronDown, LogOut, Menu, Monitor, Moon, Search, Settings, Sun, UserRound, UserRoundPen } from '@lucide/vue';
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
import { Toaster } from '@/components/ui/sonner';
import BrandLogo from '@/components/BrandLogo.vue';
import NotificationBell from '@/components/NotificationBell.vue';
import PersonAvatar from '@/components/PersonAvatar.vue';
import { useThemePreference } from '@/composables/useThemePreference';
defineProps({
title: { type: String, default: '' },
});
const page = usePage();
const user = computed(() => page.props.auth.user);
const branding = computed(() => page.props.branding);
const headerStyle = computed(() => branding.value.header_style ?? 'light');
const navigation = computed(() => page.props.navigation);
const { preference, setPreference } = useThemePreference();
const mobileNavOpen = ref(false);
const search = ref(new URLSearchParams(page.url.split('?')[1] ?? '').get('q') ?? '');
function submitSearch() {
router.get('/personen', search.value ? { q: search.value } : {});
}
const themeOptions = [
{ value: 'system', label: 'Wie im System', icon: Monitor },
{ value: 'light', label: 'Hell', icon: Sun },
{ value: 'dark', label: 'Dunkel', icon: Moon },
];
</script>
<template>
<Head v-if="title" :title="title" />
<div class="flex min-h-screen flex-col">
<div v-if="branding.preview" class="flex flex-wrap items-center justify-center gap-x-3 gap-y-1 bg-amber-400 px-4 py-1.5 text-center text-[13px] font-medium text-amber-950">
Vorschau des Entwurfs – so sieht das Portal nach dem Veröffentlichen aus.
<a href="?vorschau=aus" class="underline">Vorschau beenden</a>
</div>
<header
class="sticky top-0 z-40 border-b"
:class="headerStyle === 'light' ? 'bg-card/95 backdrop-blur supports-[backdrop-filter]:bg-card/85' : ''"
:data-header="headerStyle"
>
<div class="mx-auto flex h-16 max-w-[1440px] items-center gap-2 px-4 lg:gap-6 lg:px-6">
<Sheet v-model:open="mobileNavOpen">
<SheetTrigger class="-ml-2 grid size-10 place-items-center rounded-md text-foreground/80 hover:bg-accent lg:hidden" aria-label="Menü öffnen">
<Menu class="size-5" />
</SheetTrigger>
<SheetContent side="left" class="w-72 p-0">
<SheetHeader class="border-b px-5 py-4">
<SheetTitle class="text-left"><BrandLogo /></SheetTitle>
</SheetHeader>
<nav class="grid gap-1 p-3" aria-label="Hauptnavigation">
<Link
v-for="item in navigation"
:key="item.href"
:href="item.href"
class="rounded-md px-3 py-2.5 text-[15px] font-medium"
:class="item.active ? 'bg-brand-soft text-brand-soft-foreground' : 'text-foreground/80 hover:bg-accent'"
@click="mobileNavOpen = false"
>
{{ item.label }}
</Link>
</nav>
</SheetContent>
</Sheet>
<Link href="/" class="shrink-0 text-foreground" aria-label="Startseite">
<BrandLogo :inverted="headerStyle !== 'light'" compact />
</Link>
<nav class="hidden h-full lg:block" aria-label="Hauptnavigation">
<ul class="flex h-full items-stretch gap-1">
<li v-for="item in navigation" :key="item.href" class="flex">
<Link
:href="item.href"
class="relative flex items-center px-3 text-sm font-medium whitespace-nowrap transition-colors"
:class="item.active ? 'text-foreground' : 'text-foreground/70 hover:text-foreground'"
:aria-current="item.active ? 'page' : undefined"
>
{{ item.label }}
<span v-if="item.active" class="nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand" />
</Link>
</li>
</ul>
</nav>
<div class="ml-auto flex items-center gap-1">
<form class="mr-2 hidden w-64 md:block xl:w-80" role="search" @submit.prevent="submitSearch">
<label class="relative block">
<span class="sr-only">Personen suchen</span>
<Search class="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" />
<input
v-model="search"
type="search"
placeholder="Personen suchen …"
class="h-10 w-full rounded-md border border-input bg-card pr-3 pl-9 text-sm shadow-xs placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none"
/>
</label>
</form>
<Link href="/personen" class="grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground md:hidden" aria-label="Personen suchen">
<Search class="size-5" />
</Link>
<NotificationBell />
<a
v-if="user.can_admin"
href="/admin"
class="grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground"
aria-label="Administration"
title="Administration"
>
<Settings class="size-5" />
</a>
<DropdownMenu>
<DropdownMenuTrigger
class="ml-1 flex items-center gap-1.5 rounded-full py-1 pr-1.5 pl-1 hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none"
:aria-label="`Menü für ${user.name}`"
>
<PersonAvatar :person="user" class="size-9" />
<ChevronDown class="size-4 text-muted-foreground" />
</DropdownMenuTrigger>
<DropdownMenuContent align="end" class="w-72">
<DropdownMenuLabel class="flex items-center gap-3 py-2 font-normal">
<PersonAvatar :person="user" class="size-10" />
<div class="min-w-0">
<div class="truncate text-sm font-semibold">{{ user.name }}</div>
<div class="truncate text-xs text-muted-foreground">{{ user.email }}</div>
</div>
</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem as-child>
<Link :href="`/personen/${user.id}`"><UserRound /> Mein Profil</Link>
</DropdownMenuItem>
<DropdownMenuItem as-child>
<Link href="/profil/bearbeiten"><UserRoundPen /> Profil bearbeiten</Link>
</DropdownMenuItem>
<DropdownMenuItem v-if="user.can_admin" as-child>
<a href="/admin"><Settings /> Administration</a>
</DropdownMenuItem>
<template v-if="!branding.color_mode">
<DropdownMenuSeparator />
<DropdownMenuLabel class="text-xs font-medium text-muted-foreground">Darstellung</DropdownMenuLabel>
<DropdownMenuRadioGroup :model-value="preference" @update:model-value="setPreference">
<DropdownMenuRadioItem v-for="option in themeOptions" :key="option.value" :value="option.value">
<component :is="option.icon" class="size-4 text-muted-foreground" />
{{ option.label }}
</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
</template>
<DropdownMenuSeparator />
<DropdownMenuItem as-child>
<Link href="/logout" method="post" as="button" class="w-full"><LogOut /> Abmelden</Link>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
</div>
</header>
<main class="mx-auto w-full max-w-[1440px] flex-1 px-4 py-6 lg:px-6 lg:py-8">
<slot />
</main>
<footer v-if="branding.footer.text || branding.footer.links.length" class="border-t">
<div class="mx-auto flex max-w-[1440px] flex-wrap items-center justify-between gap-x-6 gap-y-2 px-4 py-5 text-[13px] text-muted-foreground lg:px-6">
<p v-if="branding.footer.text">{{ branding.footer.text }}</p>
<nav v-if="branding.footer.links.length" class="flex flex-wrap gap-x-5 gap-y-1" aria-label="Fußzeile">
<a v-for="link in branding.footer.links" :key="link.url" :href="link.url" class="hover:text-foreground hover:underline">{{ link.label }}</a>
</nav>
</div>
</footer>
</div>
<Toaster position="bottom-right" />
</template>