Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s

- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3)
- Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung
- Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü
- Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person
- Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“
- Benutzerverwaltung im Admin, Zugang vorläufig über is_admin
- vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/
- PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung
- VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-25 20:35:30 +00:00
parent 7197eaebf2
commit 9c0f8de791
15771 changed files with 1564103 additions and 5 deletions

37
resources/js/app.js Normal file
View file

@ -0,0 +1,37 @@
import '../css/app.css';
import { createApp, h } from 'vue';
import { createInertiaApp } from '@inertiajs/vue3';
import { createPortalVuetify } from './plugins/vuetify';
createInertiaApp({
title: (title, page) => {
const portalName = page.props.branding.portal_name;
return title ? `${title} – ${portalName}` : portalName;
},
resolve: (name) => {
const pages = import.meta.glob('./pages/**/*.vue');
const page = pages[`./pages/${name}.vue`];
if (!page) {
throw new Error(`Seite nicht gefunden: ${name}`);
}
return page();
},
setup({ el, App, props, plugin }) {
const shared = props.initialPage.props;
createApp({ render: () => h(App, props) })
.use(plugin)
.use(createPortalVuetify({
primaryColor: shared.branding.primary_color,
theme: shared.auth.user?.theme ?? 'system',
}))
.mount(el);
},
progress: {
color: 'rgb(var(--v-theme-primary))',
},
});

View file

@ -0,0 +1,22 @@
<script setup>
import { computed } from 'vue';
import { usePage } from '@inertiajs/vue3';
defineProps({
height: { type: Number, default: 32 },
});
const branding = computed(() => usePage().props.branding);
</script>
<template>
<span class="d-inline-flex align-center ga-3">
<img
v-if="branding.logo_url"
:src="branding.logo_url"
:alt="branding.portal_name"
:style="{ height: `${height}px`, width: 'auto' }"
/>
<span class="text-title-large font-weight-medium">{{ branding.portal_name }}</span>
</span>
</template>

View file

@ -0,0 +1,15 @@
<script setup>
defineProps({
user: { type: Object, required: true },
size: { type: [Number, String], default: 40 },
});
</script>
<template>
<v-avatar :size="size" color="primary-container">
<v-img v-if="user.avatar_url" :src="user.avatar_url" :alt="user.name" cover />
<span v-else class="text-on-primary-container font-weight-medium" :style="{ fontSize: `${Number(size) * 0.4}px` }">
{{ user.initials }}
</span>
</v-avatar>
</template>

View file

@ -0,0 +1,21 @@
import { router, usePage } from '@inertiajs/vue3';
import { computed } from 'vue';
import { useTheme } from 'vuetify';
/**
* Darstellung (System/Hell/Dunkel) der angemeldeten Person – wird sofort
* angewendet und im Profil gespeichert.
*/
export function useThemePreference() {
const theme = useTheme();
const page = usePage();
const preference = computed(() => page.props.auth.user?.theme ?? 'system');
function setPreference(value) {
theme.change(value);
router.put('/profil/darstellung', { theme: value }, { preserveScroll: true, preserveState: true });
}
return { preference, setPreference };
}

View file

@ -0,0 +1,153 @@
<script setup>
import { computed, ref } from 'vue';
import { Link, router, usePage } from '@inertiajs/vue3';
import { useDisplay } from 'vuetify';
import {
mdiAccountCircleOutline,
mdiAccountEditOutline,
mdiCogOutline,
mdiHomeOutline,
mdiLogout,
mdiMenu,
mdiMonitor,
mdiWeatherNight,
mdiWhiteBalanceSunny,
} from '@mdi/js';
import BrandMark from '../components/BrandMark.vue';
import UserAvatar from '../components/UserAvatar.vue';
import { useThemePreference } from '../composables/useThemePreference';
defineProps({
title: { type: String, default: '' },
});
const page = usePage();
const user = computed(() => page.props.auth.user);
const { mdAndUp } = useDisplay();
const drawer = ref(null);
const { preference, setPreference } = useThemePreference();
const navigation = [
{ title: 'Start', icon: mdiHomeOutline, href: '/', match: (url) => url === '/' },
{ title: 'Mein Profil', icon: mdiAccountCircleOutline, href: '/profil', match: (url) => url.startsWith(`/personen/${user.value.id}`) },
];
const themeOptions = [
{ value: 'system', title: 'System', icon: mdiMonitor },
{ value: 'light', title: 'Hell', icon: mdiWhiteBalanceSunny },
{ value: 'dark', title: 'Dunkel', icon: mdiWeatherNight },
];
function isActive(item) {
return item.match(page.url.split('?')[0]);
}
// Echte Links (Mittelklick, neuer Tab) – ein normaler Klick navigiert per Inertia.
function visit(event, href) {
if (event.metaKey || event.ctrlKey || event.shiftKey || event.button === 1) {
return;
}
event.preventDefault();
router.visit(href);
}
function logout() {
router.post('/logout');
}
</script>
<template>
<v-app>
<v-app-bar>
<v-app-bar-nav-icon v-if="!mdAndUp" :icon="mdiMenu" aria-label="Menü" @click="drawer = !drawer" />
<v-app-bar-title>
<Link href="/" class="brand-link">
<BrandMark />
</Link>
</v-app-bar-title>
<template #append>
<v-menu location="bottom end" :close-on-content-click="false" min-width="280">
<template #activator="{ props: menuProps }">
<v-btn v-bind="menuProps" icon variant="text" class="mr-2" :aria-label="`Menü für ${user.name}`">
<UserAvatar :user="user" :size="40" />
</v-btn>
</template>
<v-card rounded="xl" color="surface-container-high" elevation="3">
<div class="d-flex align-center ga-4 pa-4">
<UserAvatar :user="user" :size="56" />
<div class="overflow-hidden">
<div class="text-title-medium text-truncate">{{ user.name }}</div>
<div v-if="user.job_title" class="text-body-medium text-medium-emphasis text-truncate">{{ user.job_title }}</div>
<div class="text-body-small text-medium-emphasis text-truncate">{{ user.email }}</div>
</div>
</div>
<v-divider />
<v-list bg-color="transparent" density="comfortable">
<v-list-item :prepend-icon="mdiAccountCircleOutline" title="Mein Profil" href="/profil" @click="visit($event, '/profil')" />
<v-list-item :prepend-icon="mdiAccountEditOutline" title="Profil bearbeiten" href="/profil/bearbeiten" @click="visit($event, '/profil/bearbeiten')" />
<v-list-item v-if="user.is_admin" :prepend-icon="mdiCogOutline" title="Administration" href="/admin" />
</v-list>
<div class="px-4 pb-2">
<div class="text-label-large text-medium-emphasis mb-2">Darstellung</div>
<v-btn-toggle
:model-value="preference"
mandatory
divided
variant="outlined"
density="comfortable"
class="w-100"
@update:model-value="setPreference"
>
<v-btn v-for="option in themeOptions" :key="option.value" :value="option.value" class="flex-grow-1" :prepend-icon="option.icon">
{{ option.title }}
</v-btn>
</v-btn-toggle>
</div>
<v-divider class="mt-2" />
<v-list bg-color="transparent" density="comfortable">
<v-list-item :prepend-icon="mdiLogout" title="Abmelden" @click="logout" />
</v-list>
</v-card>
</v-menu>
</template>
</v-app-bar>
<v-navigation-drawer v-model="drawer" :permanent="mdAndUp" width="280">
<v-list nav class="pa-3">
<v-list-item
v-for="item in navigation"
:key="item.href"
:href="item.href"
:prepend-icon="item.icon"
:title="item.title"
:class="{ 'bg-secondary-container': isActive(item) }"
:aria-current="isActive(item) ? 'page' : undefined"
rounded="xl"
@click="visit($event, item.href)"
/>
</v-list>
</v-navigation-drawer>
<v-main>
<div class="page-container pa-4 pa-md-8">
<h1 v-if="title" class="text-headline-medium mb-6">{{ title }}</h1>
<slot />
</div>
</v-main>
</v-app>
</template>
<style scoped>
.brand-link {
color: inherit;
text-decoration: none;
}
</style>

View file

@ -0,0 +1,25 @@
<script setup>
import BrandMark from '../components/BrandMark.vue';
defineProps({
title: { type: String, default: '' },
});
</script>
<template>
<v-app>
<v-main class="bg-surface-container">
<v-container class="fill-height d-flex align-center justify-center">
<div class="w-100 mx-auto" style="max-width: 440px">
<div class="d-flex justify-center mb-8">
<BrandMark :height="48" />
</div>
<v-card rounded="xl" color="surface" class="pa-4 pa-sm-8">
<h1 v-if="title" class="text-headline-small mb-6">{{ title }}</h1>
<slot />
</v-card>
</div>
</v-container>
</v-main>
</v-app>
</template>

View file

@ -0,0 +1,40 @@
<script setup>
import { Head, Link, useForm } from '@inertiajs/vue3';
import GuestLayout from '../../layouts/GuestLayout.vue';
defineProps({
status: { type: String, default: null },
});
const form = useForm({ email: '' });
</script>
<template>
<Head title="Passwort vergessen" />
<GuestLayout title="Passwort vergessen">
<p class="text-body-medium text-medium-emphasis mb-6">
Geben Sie Ihre E-Mail-Adresse ein. Wir senden Ihnen einen Link, mit dem Sie ein neues Passwort festlegen können.
</p>
<v-alert v-if="status" type="success" variant="tonal" class="mb-6">{{ status }}</v-alert>
<v-form @submit.prevent="form.post('/forgot-password')">
<v-text-field
v-model="form.email"
label="E-Mail-Adresse"
type="email"
autocomplete="username"
autofocus
:error-messages="form.errors.email"
class="mb-4"
/>
<v-btn type="submit" size="large" block :loading="form.processing">Link senden</v-btn>
<div class="text-center mt-6">
<Link href="/login" class="text-primary text-body-medium">Zurück zur Anmeldung</Link>
</div>
</v-form>
</GuestLayout>
</template>

View file

@ -0,0 +1,63 @@
<script setup>
import { ref } from 'vue';
import { Head, Link, useForm } from '@inertiajs/vue3';
import { mdiEyeOffOutline, mdiEyeOutline } from '@mdi/js';
import GuestLayout from '../../layouts/GuestLayout.vue';
defineProps({
canResetPassword: { type: Boolean, default: false },
status: { type: String, default: null },
});
const showPassword = ref(false);
const form = useForm({
email: '',
password: '',
remember: false,
});
function submit() {
form.post('/login', {
onFinish: () => form.reset('password'),
});
}
</script>
<template>
<Head title="Anmelden" />
<GuestLayout title="Anmelden">
<v-alert v-if="status" type="success" variant="tonal" class="mb-6">{{ status }}</v-alert>
<v-form @submit.prevent="submit">
<v-text-field
v-model="form.email"
label="E-Mail-Adresse"
type="email"
autocomplete="username"
autofocus
:error-messages="form.errors.email"
class="mb-2"
/>
<v-text-field
v-model="form.password"
label="Passwort"
:type="showPassword ? 'text' : 'password'"
autocomplete="current-password"
:append-inner-icon="showPassword ? mdiEyeOffOutline : mdiEyeOutline"
:error-messages="form.errors.password"
@click:append-inner="showPassword = !showPassword"
/>
<div class="d-flex align-center justify-space-between flex-wrap mb-6">
<v-checkbox v-model="form.remember" label="Angemeldet bleiben" hide-details density="compact" />
<Link v-if="canResetPassword" href="/forgot-password" class="text-primary text-body-medium">
Passwort vergessen?
</Link>
</div>
<v-btn type="submit" size="large" block :loading="form.processing">Anmelden</v-btn>
</v-form>
</GuestLayout>
</template>

View file

@ -0,0 +1,36 @@
<script setup>
import { Head, useForm } from '@inertiajs/vue3';
import GuestLayout from '../../layouts/GuestLayout.vue';
const props = defineProps({
email: { type: String, default: '' },
token: { type: String, required: true },
});
const form = useForm({
token: props.token,
email: props.email,
password: '',
password_confirmation: '',
});
function submit() {
form.post('/reset-password', {
onFinish: () => form.reset('password', 'password_confirmation'),
});
}
</script>
<template>
<Head title="Neues Passwort" />
<GuestLayout title="Neues Passwort festlegen">
<v-form @submit.prevent="submit">
<v-text-field v-model="form.email" label="E-Mail-Adresse" type="email" autocomplete="username" :error-messages="form.errors.email" class="mb-2" />
<v-text-field v-model="form.password" label="Neues Passwort" type="password" autocomplete="new-password" autofocus :error-messages="form.errors.password" class="mb-2" />
<v-text-field v-model="form.password_confirmation" label="Passwort wiederholen" type="password" autocomplete="new-password" class="mb-4" />
<v-btn type="submit" size="large" block :loading="form.processing">Passwort speichern</v-btn>
</v-form>
</GuestLayout>
</template>

View file

@ -0,0 +1,51 @@
<script setup>
import { computed } from 'vue';
import { Head, usePage } from '@inertiajs/vue3';
import { mdiAccountEditOutline, mdiNewspaperVariantOutline, mdiPuzzleOutline } from '@mdi/js';
import AppLayout from '../layouts/AppLayout.vue';
const page = usePage();
const user = computed(() => page.props.auth.user);
const firstName = computed(() => user.value.name.split(' ')[0]);
const greeting = computed(() => {
const hour = new Date().getHours();
if (hour < 11) return 'Guten Morgen';
if (hour < 18) return 'Hallo';
return 'Guten Abend';
});
</script>
<template>
<Head title="Start" />
<AppLayout>
<div class="mb-8">
<h1 class="text-headline-large">{{ greeting }}, {{ firstName }}!</h1>
<p class="text-body-large text-medium-emphasis mt-1">Willkommen in {{ page.props.branding.portal_name }}.</p>
</div>
<v-row>
<v-col cols="12" md="4">
<v-card class="h-100" rounded="xl" href="/profil/bearbeiten">
<v-card-item :prepend-icon="mdiAccountEditOutline" title="Ihr Profil" />
<v-card-text>Profilbild, Funktion und Kontaktdaten helfen Kolleginnen und Kollegen, Sie zu finden.</v-card-text>
</v-card>
</v-col>
<v-col cols="12" md="4">
<v-card class="h-100" rounded="xl" color="secondary-container">
<v-card-item :prepend-icon="mdiNewspaperVariantOutline" title="Neuigkeiten" />
<v-card-text>Hier erscheinen bald Beiträge aus Ihren Kategorien.</v-card-text>
</v-card>
</v-col>
<v-col cols="12" md="4">
<v-card class="h-100" rounded="xl" color="tertiary-container">
<v-card-item :prepend-icon="mdiPuzzleOutline" title="Module" />
<v-card-text>Weitere Funktionen kommen als Plugins hinzu und lassen sich einzeln aktivieren.</v-card-text>
</v-card>
</v-col>
</v-row>
</AppLayout>
</template>

View file

@ -0,0 +1,156 @@
<script setup>
import { computed, ref } from 'vue';
import { Head, router, useForm, usePage } from '@inertiajs/vue3';
import { mdiCameraOutline, mdiDeleteOutline } from '@mdi/js';
import AppLayout from '../../layouts/AppLayout.vue';
import UserAvatar from '../../components/UserAvatar.vue';
const props = defineProps({
profile: { type: Object, required: true },
});
const page = usePage();
const status = computed(() => page.props.flash.status);
const snackbar = ref(false);
const snackbarText = ref('');
function notify(text) {
snackbarText.value = text;
snackbar.value = true;
}
// Stammdaten
const form = useForm({
first_name: props.profile.first_name ?? '',
last_name: props.profile.last_name ?? '',
email: props.profile.email,
job_title: props.profile.job_title ?? '',
department: props.profile.department ?? '',
location: props.profile.location ?? '',
phone: props.profile.phone ?? '',
mobile: props.profile.mobile ?? '',
about: props.profile.about ?? '',
});
function saveProfile() {
form.put('/profil', {
preserveScroll: true,
onSuccess: () => notify('Profil gespeichert.'),
});
}
// Profilbild
const avatarInput = ref(null);
const avatarForm = useForm({ avatar: null });
function chooseAvatar() {
avatarInput.value?.click();
}
function uploadAvatar(event) {
const file = event.target.files?.[0];
if (!file) return;
avatarForm.avatar = file;
avatarForm.post('/profil/bild', {
preserveScroll: true,
forceFormData: true,
onSuccess: () => notify('Profilbild aktualisiert.'),
onFinish: () => {
event.target.value = '';
},
});
}
function removeAvatar() {
router.delete('/profil/bild', {
preserveScroll: true,
onSuccess: () => notify('Profilbild entfernt.'),
});
}
// Passwort
const passwordForm = useForm({
current_password: '',
password: '',
password_confirmation: '',
});
function savePassword() {
passwordForm.put('/user/password', {
preserveScroll: true,
errorBag: 'updatePassword',
onSuccess: () => {
passwordForm.reset();
notify('Passwort geändert.');
},
});
}
</script>
<template>
<Head title="Profil bearbeiten" />
<AppLayout title="Profil bearbeiten">
<v-row>
<v-col cols="12" md="4">
<v-card rounded="xl" class="text-center pa-6">
<UserAvatar :user="profile" :size="144" class="mb-4" />
<div class="text-title-large">{{ profile.name }}</div>
<input ref="avatarInput" type="file" accept="image/jpeg,image/png,image/webp" hidden @change="uploadAvatar" />
<div class="d-flex flex-column ga-2 mt-6">
<v-btn :prepend-icon="mdiCameraOutline" :loading="avatarForm.processing" @click="chooseAvatar">
{{ profile.avatar_url ? 'Bild ändern' : 'Bild hochladen' }}
</v-btn>
<v-btn v-if="profile.avatar_url" variant="text" color="error" :prepend-icon="mdiDeleteOutline" @click="removeAvatar">
Bild entfernen
</v-btn>
</div>
<div v-if="avatarForm.errors.avatar" class="text-error text-body-small mt-3">{{ avatarForm.errors.avatar }}</div>
<div class="text-body-small text-medium-emphasis mt-3">JPG, PNG oder WebP, höchstens 8 MB.</div>
</v-card>
</v-col>
<v-col cols="12" md="8">
<v-card rounded="xl" title="Persönliche Angaben" class="mb-6">
<v-card-text>
<v-form @submit.prevent="saveProfile">
<v-row dense>
<v-col cols="12" sm="6"><v-text-field v-model="form.first_name" label="Vorname" :error-messages="form.errors.first_name" /></v-col>
<v-col cols="12" sm="6"><v-text-field v-model="form.last_name" label="Nachname" :error-messages="form.errors.last_name" /></v-col>
<v-col cols="12"><v-text-field v-model="form.email" label="E-Mail-Adresse" type="email" :error-messages="form.errors.email" /></v-col>
<v-col cols="12" sm="6"><v-text-field v-model="form.job_title" label="Funktion" :error-messages="form.errors.job_title" /></v-col>
<v-col cols="12" sm="6"><v-text-field v-model="form.department" label="Abteilung" :error-messages="form.errors.department" /></v-col>
<v-col cols="12" sm="6"><v-text-field v-model="form.location" label="Standort" :error-messages="form.errors.location" /></v-col>
<v-col cols="12" sm="6"><v-text-field v-model="form.phone" label="Telefon" type="tel" :error-messages="form.errors.phone" /></v-col>
<v-col cols="12" sm="6"><v-text-field v-model="form.mobile" label="Mobil" type="tel" :error-messages="form.errors.mobile" /></v-col>
<v-col cols="12"><v-textarea v-model="form.about" label="Über mich" rows="4" auto-grow counter="2000" :error-messages="form.errors.about" /></v-col>
</v-row>
<div class="d-flex justify-end mt-2">
<v-btn type="submit" :loading="form.processing" :disabled="!form.isDirty">Speichern</v-btn>
</div>
</v-form>
</v-card-text>
</v-card>
<v-card v-if="profile.has_password" rounded="xl" title="Passwort ändern">
<v-card-text>
<v-form @submit.prevent="savePassword">
<v-text-field v-model="passwordForm.current_password" label="Aktuelles Passwort" type="password" autocomplete="current-password" :error-messages="passwordForm.errors.current_password" class="mb-2" />
<v-text-field v-model="passwordForm.password" label="Neues Passwort" type="password" autocomplete="new-password" :error-messages="passwordForm.errors.password" class="mb-2" />
<v-text-field v-model="passwordForm.password_confirmation" label="Neues Passwort wiederholen" type="password" autocomplete="new-password" />
<div class="d-flex justify-end mt-2">
<v-btn type="submit" :loading="passwordForm.processing">Passwort ändern</v-btn>
</div>
</v-form>
</v-card-text>
</v-card>
</v-col>
</v-row>
<v-snackbar v-model="snackbar" :timeout="3000">{{ snackbarText }}</v-snackbar>
</AppLayout>
</template>

View file

@ -0,0 +1,69 @@
<script setup>
import { computed } from 'vue';
import { Head, Link } from '@inertiajs/vue3';
import {
mdiAccountEditOutline,
mdiCellphone,
mdiDomain,
mdiEmailOutline,
mdiMapMarkerOutline,
mdiPhoneOutline,
} from '@mdi/js';
import AppLayout from '../../layouts/AppLayout.vue';
import UserAvatar from '../../components/UserAvatar.vue';
const props = defineProps({
person: { type: Object, required: true },
isOwnProfile: { type: Boolean, default: false },
});
const contact = computed(() => [
{ icon: mdiEmailOutline, label: 'E-Mail', value: props.person.email, href: `mailto:${props.person.email}` },
{ icon: mdiPhoneOutline, label: 'Telefon', value: props.person.phone, href: props.person.phone && `tel:${props.person.phone}` },
{ icon: mdiCellphone, label: 'Mobil', value: props.person.mobile, href: props.person.mobile && `tel:${props.person.mobile}` },
{ icon: mdiDomain, label: 'Abteilung', value: props.person.department },
{ icon: mdiMapMarkerOutline, label: 'Standort', value: props.person.location },
].filter((item) => item.value));
</script>
<template>
<Head :title="person.name" />
<AppLayout>
<v-card rounded="xl" class="mb-6">
<div class="d-flex flex-column flex-sm-row align-center ga-6 pa-6 pa-md-8">
<UserAvatar :user="person" :size="128" />
<div class="flex-grow-1 text-center text-sm-start">
<h1 class="text-headline-medium">{{ person.name }}</h1>
<div v-if="person.job_title" class="text-title-medium text-medium-emphasis mt-1">{{ person.job_title }}</div>
</div>
<Link v-if="isOwnProfile" href="/profil/bearbeiten">
<v-btn variant="tonal" :prepend-icon="mdiAccountEditOutline">Profil bearbeiten</v-btn>
</Link>
</div>
</v-card>
<v-row>
<v-col cols="12" md="5">
<v-card rounded="xl" title="Kontakt" class="h-100">
<v-list bg-color="transparent">
<v-list-item
v-for="item in contact"
:key="item.label"
:prepend-icon="item.icon"
:title="item.value"
:subtitle="item.label"
:href="item.href || undefined"
/>
</v-list>
</v-card>
</v-col>
<v-col cols="12" md="7">
<v-card rounded="xl" title="Über mich" class="h-100">
<v-card-text v-if="person.about" class="text-body-large" style="white-space: pre-line">{{ person.about }}</v-card-text>
<v-card-text v-else class="text-medium-emphasis">Noch keine Angaben.</v-card-text>
</v-card>
</v-col>
</v-row>
</AppLayout>
</template>

View file

@ -0,0 +1,36 @@
import 'vuetify/styles';
import { createVuetify } from 'vuetify';
import { md3 } from 'vuetify/blueprints';
import { aliases, mdi } from 'vuetify/iconsets/mdi-svg';
import { de } from 'vuetify/locale';
import { vuetifyThemes } from '../theme/material';
/**
* @param {{ primaryColor: string, theme: 'system'|'light'|'dark' }} options
*/
export function createPortalVuetify({ primaryColor, theme }) {
return createVuetify({
blueprint: md3,
// SVG-Icons aus @mdi/js: nur die tatsächlich genutzten Icons landen im Bundle.
icons: {
defaultSet: 'mdi',
aliases,
sets: { mdi },
},
locale: {
locale: 'de',
messages: { de },
},
theme: {
defaultTheme: theme,
themes: vuetifyThemes(primaryColor),
},
defaults: {
VAppBar: { color: 'surface-container' },
VNavigationDrawer: { color: 'surface-container-low' },
VCard: { color: 'surface-container-low', elevation: 0 },
VTextField: { color: 'primary' },
VTextarea: { color: 'primary' },
},
});
}

View file

@ -0,0 +1,85 @@
import {
argbFromHex,
hexFromArgb,
Hct,
MaterialDynamicColors,
SchemeTonalSpot,
} from '@material/material-color-utilities';
/**
* Material-3-Rollen, die als Vuetify-Farben bereitgestellt werden.
* Schlüssel = Vuetify-Farbname, Wert = Rolle aus MaterialDynamicColors.
*/
const ROLES = {
primary: 'primary',
'on-primary': 'onPrimary',
'primary-container': 'primaryContainer',
'on-primary-container': 'onPrimaryContainer',
secondary: 'secondary',
'on-secondary': 'onSecondary',
'secondary-container': 'secondaryContainer',
'on-secondary-container': 'onSecondaryContainer',
tertiary: 'tertiary',
'on-tertiary': 'onTertiary',
'tertiary-container': 'tertiaryContainer',
'on-tertiary-container': 'onTertiaryContainer',
error: 'error',
'on-error': 'onError',
'error-container': 'errorContainer',
'on-error-container': 'onErrorContainer',
background: 'background',
'on-background': 'onBackground',
surface: 'surface',
'on-surface': 'onSurface',
'surface-variant': 'surfaceVariant',
'on-surface-variant': 'onSurfaceVariant',
'surface-bright': 'surfaceBright',
'surface-dim': 'surfaceDim',
'surface-container-lowest': 'surfaceContainerLowest',
'surface-container-low': 'surfaceContainerLow',
'surface-container': 'surfaceContainer',
'surface-container-high': 'surfaceContainerHigh',
'surface-container-highest': 'surfaceContainerHighest',
'inverse-surface': 'inverseSurface',
'inverse-on-surface': 'inverseOnSurface',
'inverse-primary': 'inversePrimary',
outline: 'outline',
'outline-variant': 'outlineVariant',
};
/**
* Berechnet aus einer Seed-Farbe das komplette Material-3-Farbschema
* (Dynamic Color, Variante „Tonal Spot“).
*
* @param {string} seedHex z. B. "#2E6B5E"
* @param {boolean} isDark
* @returns {Record<string, string>} Vuetify-Farben
*/
export function materialColors(seedHex, isDark) {
const scheme = new SchemeTonalSpot(Hct.fromInt(argbFromHex(seedHex)), isDark, 0);
const colors = {};
for (const [name, role] of Object.entries(ROLES)) {
colors[name] = hexFromArgb(MaterialDynamicColors[role].getArgb(scheme));
}
// Vuetify nutzt „surface-light“ z. B. für Chips und Hover-Flächen.
colors['surface-light'] = colors['surface-container-high'];
// Statusfarben ohne M3-Entsprechung: auf die Palette abgestimmte Töne.
colors.info = isDark ? '#9ECAFF' : '#0061A4';
colors.success = isDark ? '#7DDC7A' : '#1E6C23';
colors.warning = isDark ? '#FFB86E' : '#8B5000';
return colors;
}
/**
* @param {string} seedHex
*/
export function vuetifyThemes(seedHex) {
return {
light: { dark: false, colors: materialColors(seedHex, false) },
dark: { dark: true, colors: materialColors(seedHex, true) },
};
}