Neues Design: Tailwind + shadcn-vue statt Vuetify/Material 3
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 1m3s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 1m16s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 1m20s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m29s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m33s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m28s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m33s
CI / Build-Artefakte aktuell (pull_request) Failing after 52s

- Nüchterne, professionelle Optik: neutrale Flächen, Markenfarbe nur als Akzent, Inter-Schrift (lokal)
- Zweizeiliger Header mit Suche, Hauptnavigation und Avatar-Menü
- Startseite mit Begrüßungskarte, Schnellzugriffen und „Neu im Team“
- Personenverzeichnis mit Suche, Abteilungsfilter und Seitenaufteilung
- Markenfarbe exakt übernommen, Abstufungen serverseitig in OKLCH (ColorPalette) –
  gemeinsam für Portal und Admin, keine Farbberechnung im Browser
- Schnellzugriffe im Admin pflegbar
- Filament-Avatare lokal statt über ui-avatars.com (DSGVO)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-25 20:51:53 +00:00
parent 9c0f8de791
commit 5a3f1f34c7
141 changed files with 3873 additions and 974 deletions

View file

@ -1,24 +1,20 @@
<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';
import { ref } from 'vue';
import { router, useForm } from '@inertiajs/vue3';
import { Camera, LoaderCircle, Trash2 } from '@lucide/vue';
import { toast } from 'vue-sonner';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
import FormField from '@/components/FormField.vue';
import Panel from '@/components/Panel.vue';
import PersonAvatar from '@/components/PersonAvatar.vue';
import AppLayout from '@/layouts/AppLayout.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 ?? '',
@ -35,18 +31,28 @@ const form = useForm({
function saveProfile() {
form.put('/profil', {
preserveScroll: true,
onSuccess: () => notify('Profil gespeichert.'),
onSuccess: () => {
form.defaults();
toast.success('Profil gespeichert');
},
});
}
const fields = [
{ key: 'first_name', label: 'Vorname', autocomplete: 'given-name' },
{ key: 'last_name', label: 'Nachname', autocomplete: 'family-name' },
{ key: 'email', label: 'E-Mail-Adresse', type: 'email', autocomplete: 'email', wide: true },
{ key: 'job_title', label: 'Funktion', autocomplete: 'organization-title' },
{ key: 'department', label: 'Abteilung' },
{ key: 'location', label: 'Standort' },
{ key: 'phone', label: 'Telefon', type: 'tel', autocomplete: 'tel' },
{ key: 'mobile', label: 'Mobil', type: 'tel' },
];
// Profilbild
const avatarInput = ref(null);
const avatarForm = useForm({ avatar: null });
function chooseAvatar() {
avatarInput.value?.click();
}
function uploadAvatar(event) {
const file = event.target.files?.[0];
@ -56,7 +62,7 @@ function uploadAvatar(event) {
avatarForm.post('/profil/bild', {
preserveScroll: true,
forceFormData: true,
onSuccess: () => notify('Profilbild aktualisiert.'),
onSuccess: () => toast.success('Profilbild aktualisiert'),
onFinish: () => {
event.target.value = '';
},
@ -66,7 +72,7 @@ function uploadAvatar(event) {
function removeAvatar() {
router.delete('/profil/bild', {
preserveScroll: true,
onSuccess: () => notify('Profilbild entfernt.'),
onSuccess: () => toast.success('Profilbild entfernt'),
});
}
@ -83,74 +89,93 @@ function savePassword() {
errorBag: 'updatePassword',
onSuccess: () => {
passwordForm.reset();
notify('Passwort geändert.');
toast.success('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>
<h1 class="mb-6 text-2xl font-semibold tracking-tight">Profil bearbeiten</h1>
<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 class="grid gap-6 lg:grid-cols-12">
<div class="lg:col-span-4">
<Panel title="Profilbild">
<div class="flex flex-col items-center text-center">
<PersonAvatar :person="profile" class="size-32 text-3xl" />
<input ref="avatarInput" type="file" accept="image/jpeg,image/png,image/webp" class="hidden" @change="uploadAvatar" />
<div class="mt-5 flex flex-wrap justify-center gap-2">
<Button variant="outline" :disabled="avatarForm.processing" @click="avatarInput?.click()">
<LoaderCircle v-if="avatarForm.processing" class="animate-spin" />
<Camera v-else />
{{ profile.avatar_url ? 'Bild ändern' : 'Bild hochladen' }}
</Button>
<Button v-if="profile.avatar_url" variant="ghost" class="text-destructive hover:text-destructive" @click="removeAvatar">
<Trash2 /> Entfernen
</Button>
</div>
<p v-if="avatarForm.errors.avatar" class="mt-3 text-[13px] text-destructive">{{ avatarForm.errors.avatar }}</p>
<p class="mt-3 text-[13px] text-muted-foreground">JPG, PNG oder WebP, höchstens 8 MB. Das Bild wird quadratisch zugeschnitten.</p>
</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>
</Panel>
</div>
<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>
<div class="grid content-start gap-6 lg:col-span-8">
<Panel title="Persönliche Angaben">
<form class="grid gap-5" @submit.prevent="saveProfile">
<div class="grid gap-5 sm:grid-cols-2">
<FormField
v-for="field in fields"
:id="field.key"
:key="field.key"
:label="field.label"
:error="form.errors[field.key]"
:class="{ 'sm:col-span-2': field.wide }"
>
<Input
:id="field.key"
v-model="form[field.key]"
:type="field.type ?? 'text'"
:autocomplete="field.autocomplete"
:aria-invalid="!!form.errors[field.key]"
/>
</FormField>
<FormField id="about" label="Über mich" :error="form.errors.about" hint="Aufgaben, Themen, bei denen man Sie ansprechen kann." class="sm:col-span-2">
<Textarea id="about" v-model="form.about" rows="4" maxlength="2000" />
</FormField>
</div>
<div class="flex justify-end border-t pt-5">
<Button type="submit" :disabled="form.processing || !form.isDirty">
<LoaderCircle v-if="form.processing" class="animate-spin" />
Speichern
</Button>
</div>
</form>
</Panel>
<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>
<Panel v-if="profile.has_password" title="Passwort ändern">
<form class="grid gap-5" @submit.prevent="savePassword">
<FormField id="current_password" label="Aktuelles Passwort" :error="passwordForm.errors.current_password" class="sm:max-w-sm">
<Input id="current_password" v-model="passwordForm.current_password" type="password" autocomplete="current-password" />
</FormField>
<div class="grid gap-5 sm:grid-cols-2">
<FormField id="password" label="Neues Passwort" :error="passwordForm.errors.password" hint="Mindestens 10 Zeichen, mit Buchstaben und Ziffern.">
<Input id="password" v-model="passwordForm.password" type="password" autocomplete="new-password" />
</FormField>
<FormField id="password_confirmation" label="Neues Passwort wiederholen">
<Input id="password_confirmation" v-model="passwordForm.password_confirmation" type="password" autocomplete="new-password" />
</FormField>
</div>
<div class="flex justify-end border-t pt-5">
<Button type="submit" :disabled="passwordForm.processing">
<LoaderCircle v-if="passwordForm.processing" class="animate-spin" />
Passwort ändern
</Button>
</div>
</form>
</Panel>
</div>
</div>
</AppLayout>
</template>