refactor: align article author with VideoModel, streamline selects, fix flyout inert
- Remove ArticleAuthor type; article.author now reuses VideoModel (id, artist_name, slug, avatar) - updateArticle accepts authorId; author selectable in admin article edit page - Article edit: single Select with bind:value + $derived selectedAuthor display - Video edit: replace pill toggles with Select type="multiple" bind:value for models - Video table: replace inline badge spans with Badge component - Magazine: display artist_name throughout, author bio links to model profile - Fix flyout aria-hidden warning: replace with inert attribute Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
const matchesSearch =
|
||||
article.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||
article.excerpt?.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||
article.author?.first_name?.toLowerCase().includes(searchQuery.toLowerCase());
|
||||
article.author?.artist_name?.toLowerCase().includes(searchQuery.toLowerCase());
|
||||
const matchesCategory = categoryFilter === "all" || article.category === categoryFilter;
|
||||
return matchesSearch && matchesCategory;
|
||||
})
|
||||
@@ -190,11 +190,11 @@
|
||||
<div class="flex items-center gap-3">
|
||||
<img
|
||||
src={getAssetUrl(featuredArticle.author?.avatar, "mini")}
|
||||
alt={featuredArticle.author?.first_name}
|
||||
alt={featuredArticle.author?.artist_name}
|
||||
class="w-10 h-10 rounded-full object-cover"
|
||||
/>
|
||||
<div>
|
||||
<p class="font-medium">{featuredArticle.author?.first_name}</p>
|
||||
<p class="font-medium">{featuredArticle.author?.artist_name}</p>
|
||||
<div class="flex items-center gap-3 text-sm text-muted-foreground">
|
||||
<span>{timeAgo.format(new Date(featuredArticle.publish_date))}</span>
|
||||
<span>•</span>
|
||||
@@ -288,11 +288,11 @@
|
||||
<div class="flex items-center gap-2">
|
||||
<img
|
||||
src={getAssetUrl(article.author?.avatar, "mini")}
|
||||
alt={article.author?.first_name}
|
||||
alt={article.author?.artist_name}
|
||||
class="w-8 h-8 rounded-full object-cover"
|
||||
/>
|
||||
<div>
|
||||
<p class="text-sm font-medium">{article.author?.first_name}</p>
|
||||
<p class="text-sm font-medium">{article.author?.artist_name}</p>
|
||||
<div class="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<span class="icon-[ri--calendar-line] w-4 h-4"></span>
|
||||
{timeAgo.format(new Date(article.publish_date))}
|
||||
|
||||
@@ -141,32 +141,21 @@
|
||||
|
||||
<!-- Author Bio -->
|
||||
{#if data.article.author}
|
||||
{@const author = data.article.author}
|
||||
<Card class="p-0 bg-gradient-to-r from-card/50 to-card">
|
||||
<CardContent class="p-6">
|
||||
<div class="flex items-start gap-4">
|
||||
<img
|
||||
src={getAssetUrl(data.article.author.avatar, "mini")}
|
||||
alt={data.article.author.first_name}
|
||||
src={getAssetUrl(author.avatar, "mini")}
|
||||
alt={author.artist_name}
|
||||
class="w-16 h-16 rounded-full object-cover ring-2 ring-primary/20"
|
||||
/>
|
||||
<div class="flex-1">
|
||||
<h3 class="font-semibold text-lg mb-2">
|
||||
About {data.article.author.first_name}
|
||||
</h3>
|
||||
{#if data.article.author.description}
|
||||
<p class="text-muted-foreground mb-4">
|
||||
{data.article.author.description}
|
||||
</p>
|
||||
{/if}
|
||||
{#if data.article.author.website}
|
||||
<div class="flex gap-4 text-sm">
|
||||
<a
|
||||
href={"https://" + data.article.author.website}
|
||||
class="text-primary hover:underline"
|
||||
>
|
||||
{data.article.author.website}
|
||||
</a>
|
||||
</div>
|
||||
<h3 class="font-semibold text-lg mb-2">About {author.artist_name}</h3>
|
||||
{#if author.slug}
|
||||
<a href="/models/{author.slug}" class="text-sm text-primary hover:underline">
|
||||
View profile
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user