feat: sites and authors integration into existing screens (& formated all frontend files kinda accidentally)

This commit is contained in:
Florian Sylvain committed 2026-10-15 05:25:44 +02:00
1 parent 3d81d2c717
commit 6b8990c55e
239 files changed
+9194 -1354

No files matched your search

+17 -4
View File
@@ -274,7 +274,10 @@ function replaceItem(author: Author) {
...result.value,
items: result.value.items.map((item) =>
item.id === author.id
? { ...author, user_email: author.user_email ?? item.user_email }
? {
...author,
user_email: author.user_email ?? item.user_email,
}
: item,
),
}
@@ -285,7 +288,11 @@ function removeItem(id: number) {
return
}
const remaining = result.value.items.filter((item) => item.id !== id)
result.value = { ...result.value, items: remaining, total: Math.max(0, result.value.total - 1) }
result.value = {
...result.value,
items: remaining,
total: Math.max(0, result.value.total - 1),
}
if (remaining.length === 0 && result.value.total > 0) {
load(query.value)
}
@@ -463,7 +470,11 @@ function confirmDelete() {
async function creditedCount(target: Author) {
try {
const found = await listAuthors({ q: target.slug, page: 1, size: LOOKUP_SIZE })
const found = await listAuthors({
q: target.slug,
page: 1,
size: LOOKUP_SIZE,
})
return (
found.items.find((item) => item.id === target.id)?.article_count || target.article_count
)
@@ -548,7 +559,9 @@ const noResultsTitle = computed(() => t('No authors match "{0}"', [query.value.q
<div class="flex flex-col gap-4">
<div class="flex flex-wrap items-end gap-4">
<div class="flex min-w-50 flex-1 flex-col gap-0.5">
<h1 class="text-xl font-semibold text-highlighted">{{ t('Authors') }}</h1>
<h1 class="text-xl font-semibold text-highlighted">
{{ t('Authors') }}
</h1>
<p class="text-muted">{{ description }}</p>
</div>
<DirectoryAddButton v-if="isDesktop && canManage" @click="openAdd">