Titelbild im Profil, durchsuchbare Baum-Auswahl im IT-Ticket (0.20.1)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m47s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m8s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m6s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m25s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m23s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m39s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m40s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m47s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m8s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m6s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m25s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m23s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m39s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m40s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2f03597b89
commit
05b4b79cb3
146 changed files with 1051 additions and 495 deletions
|
|
@ -2,13 +2,14 @@
|
|||
import { pluginComponent } from '@/lib/pluginComponents';
|
||||
import { defineAsyncComponent, ref } from 'vue';
|
||||
import { router, useForm } from '@inertiajs/vue3';
|
||||
import { Camera, LoaderCircle, Trash2 } from '@lucide/vue';
|
||||
import { Camera, Image as ImageIcon, 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 CoverBanner from '@/components/CoverBanner.vue';
|
||||
import PersonAvatar from '@/components/PersonAvatar.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
|
|
@ -103,6 +104,33 @@ function removeAvatar() {
|
|||
});
|
||||
}
|
||||
|
||||
// Titelbild
|
||||
const coverInput = ref(null);
|
||||
const coverForm = useForm({ cover: null });
|
||||
|
||||
function uploadCover(event) {
|
||||
const file = event.target.files?.[0];
|
||||
|
||||
if (!file) return;
|
||||
|
||||
coverForm.cover = file;
|
||||
coverForm.post('/profil/titelbild', {
|
||||
preserveScroll: true,
|
||||
forceFormData: true,
|
||||
onSuccess: () => toast.success('Titelbild aktualisiert'),
|
||||
onFinish: () => {
|
||||
event.target.value = '';
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function removeCover() {
|
||||
router.delete('/profil/titelbild', {
|
||||
preserveScroll: true,
|
||||
onSuccess: () => toast.success('Titelbild entfernt – es gilt wieder das Standardbild'),
|
||||
});
|
||||
}
|
||||
|
||||
// Passwort
|
||||
const passwordForm = useForm({
|
||||
current_password: '',
|
||||
|
|
@ -146,6 +174,23 @@ function savePassword() {
|
|||
<p class="mt-3 text-[13px] text-muted-foreground">JPG, PNG oder WebP, höchstens 8 MB. Das Bild wird quadratisch zugeschnitten.</p>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<Panel title="Titelbild" class="mt-6">
|
||||
<CoverBanner :image="profile.cover_url" class="h-24 rounded-md" />
|
||||
<input ref="coverInput" type="file" accept="image/jpeg,image/png,image/webp" class="hidden" @change="uploadCover" />
|
||||
<div class="mt-4 flex flex-wrap gap-2">
|
||||
<Button variant="outline" :disabled="coverForm.processing" @click="coverInput?.click()">
|
||||
<LoaderCircle v-if="coverForm.processing" class="animate-spin" />
|
||||
<ImageIcon v-else />
|
||||
{{ profile.cover_url ? 'Bild ändern' : 'Bild hochladen' }}
|
||||
</Button>
|
||||
<Button v-if="profile.cover_url" variant="ghost" class="text-destructive hover:text-destructive" @click="removeCover">
|
||||
<Trash2 /> Entfernen
|
||||
</Button>
|
||||
</div>
|
||||
<p v-if="coverForm.errors.cover" class="mt-3 text-[13px] text-destructive">{{ coverForm.errors.cover }}</p>
|
||||
<p class="mt-3 text-[13px] text-muted-foreground">Erscheint oben in Ihrem Profil und in der Begrüßung auf der Startseite – mit einer Fläche in der Hausfarbe darüber. Querformat, höchstens 8 MB.</p>
|
||||
</Panel>
|
||||
</div>
|
||||
|
||||
<div class="grid content-start gap-6 lg:col-span-8">
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { Link } from '@inertiajs/vue3';
|
|||
import { Building2, Mail, MapPin, Phone, Smartphone, UserRoundPen } from '@lucide/vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import Panel from '@/components/Panel.vue';
|
||||
import CoverBanner from '@/components/CoverBanner.vue';
|
||||
import PersonAvatar from '@/components/PersonAvatar.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ function fieldHref(field) {
|
|||
<template>
|
||||
<AppLayout :title="person.name">
|
||||
<section class="overflow-hidden rounded-lg border bg-card">
|
||||
<div class="h-28 bg-brand sm:h-32" style="background-image: linear-gradient(120deg, transparent 40%, rgb(255 255 255 / 0.08))" />
|
||||
<CoverBanner :image="person.cover_url" class="h-28 sm:h-40" />
|
||||
<div class="flex flex-col gap-4 px-6 pb-6 sm:flex-row sm:items-end sm:justify-between">
|
||||
<div class="flex flex-col gap-4 sm:flex-row sm:items-end">
|
||||
<PersonAvatar :person="person" class="-mt-14 size-28 text-2xl ring-4 ring-card" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue