Gemeinsam: Handy-Ansicht als Liste
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m43s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m35s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m0s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m56s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m39s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m37s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m34s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m26s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m11s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m43s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m35s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m0s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m56s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m39s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m37s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m34s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m26s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m11s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7a1c164030
commit
9d3f9fa4ea
108 changed files with 480 additions and 446 deletions
|
|
@ -47,6 +47,12 @@ function value(entry, key, section) {
|
|||
return entry[key] || '–';
|
||||
}
|
||||
|
||||
// Handy-Liste: weitere Spalten als „Bezeichnung: Wert“ (Datum steht rechts oben)
|
||||
const details = (entry, section) => columns[section.key]
|
||||
.filter(([key]) => key !== 'date')
|
||||
.map(([key, label]) => [label, key === 'lifespan' ? value(entry, key, section.key) : entry[key]])
|
||||
.filter(([, text]) => text && text !== '–');
|
||||
|
||||
const visible = computed(() => props.sections.filter((s) => s.entries.length || (props.canManage && !s.automatic)));
|
||||
const empty = computed(() => props.sections.every((s) => !s.entries.length));
|
||||
|
||||
|
|
@ -72,11 +78,11 @@ function remove(entry) {
|
|||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<div v-if="visible.length && !(empty && !canManage)" class="grid gap-6">
|
||||
<div v-if="visible.length && !(empty && !canManage)" class="grid grid-cols-1 gap-6">
|
||||
<section
|
||||
v-for="section in visible"
|
||||
:key="section.key"
|
||||
class="overflow-hidden rounded-lg border bg-card"
|
||||
class="min-w-0 overflow-hidden rounded-lg border bg-card"
|
||||
:class="section.key === 'memoriam' ? 'border-t-4 border-t-foreground/70' : 'border-t-4 border-t-brand'"
|
||||
>
|
||||
<header class="flex items-center justify-between gap-3 border-b px-5 py-3">
|
||||
|
|
@ -88,7 +94,31 @@ function remove(entry) {
|
|||
<span v-else-if="section.automatic && canManage" class="text-xs text-muted-foreground">aus dem Geburtstagskalender</span>
|
||||
</header>
|
||||
|
||||
<div v-if="section.entries.length" class="overflow-x-auto">
|
||||
<!-- Handy: Liste statt Tabelle -->
|
||||
<ul v-if="section.entries.length" class="divide-y sm:hidden">
|
||||
<li v-for="entry in section.entries" :key="entry.id" class="px-4 py-3">
|
||||
<div class="flex items-start gap-2">
|
||||
<div class="min-w-0 flex-1"><PersonCell :entry="entry" :muted="section.key === 'memoriam'" /></div>
|
||||
<span v-if="entry.date && section.key !== 'memoriam'" class="shrink-0 pt-1 text-xs text-muted-foreground tabular-nums">{{ format(entry.date, section.key) }}</span>
|
||||
<DropdownMenu v-if="canManage && !section.automatic">
|
||||
<DropdownMenuTrigger as-child><Button variant="ghost" size="icon" class="-mt-1 -mr-2 size-8 text-muted-foreground" :aria-label="`Aktionen für ${entry.name}`"><EllipsisVertical /></Button></DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem @select="edit(section, entry)"><PencilLine /> Bearbeiten</DropdownMenuItem>
|
||||
<DropdownMenuItem class="text-destructive" @select="remove(entry)"><Trash2 /> Entfernen</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
<dl v-if="details(entry, section).length" class="mt-1.5 flex flex-wrap gap-x-4 gap-y-0.5 pl-11 text-[13px]">
|
||||
<div v-for="[label, text] in details(entry, section)" :key="label" class="flex gap-1">
|
||||
<dt class="text-muted-foreground">{{ label }}:</dt>
|
||||
<dd>{{ text }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p v-if="entry.text" class="mt-1.5 pl-11 text-[13px] text-muted-foreground" :class="{ italic: section.key === 'memoriam' }">{{ entry.text }}</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div v-if="section.entries.length" class="hidden overflow-x-auto sm:block">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-muted/40 text-left text-xs text-muted-foreground">
|
||||
<tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue