update blog index page ui
This commit is contained in:
@@ -46,18 +46,22 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#each data.blogArticles as article (article.slug)}
|
<div class="flex flex-col items-center gap-2">
|
||||||
<div class="flex gap-2 px-4">
|
{#each data.blogArticles as article (article.slug)}
|
||||||
<a href={resolve('/blog/[slug]', { slug: article.slug })}>{article.title}</a>
|
<a href={resolve('/blog/[slug]', { slug: article.slug })}>
|
||||||
{#if data.isAdmin && article.status === 'draft'}
|
<div class="flex gap-2 py-2 px-4 border rounded min-w-100">
|
||||||
<span class="text-xs uppercase text-orange-500">draft</span>
|
<p class="font-bold text-md">{article.title}</p>
|
||||||
<a href={resolve('/blog/[slug]/edit', { slug: article.slug })} class="text-xs underline"
|
{#if data.isAdmin && article.status === 'draft'}
|
||||||
>edit</a
|
<span class="text-xs uppercase text-orange-500">draft</span>
|
||||||
>
|
<a href={resolve('/blog/[slug]/edit', { slug: article.slug })} class="text-xs underline"
|
||||||
{/if}
|
>edit</a
|
||||||
<p>{article.createdAt?.toDateString()}</p>
|
>
|
||||||
</div>
|
{/if}
|
||||||
{/each}
|
<p>{article.createdAt?.toDateString()}</p>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
|
||||||
{#if createNewArticlePopup}
|
{#if createNewArticlePopup}
|
||||||
<div class="fixed inset-0 flex items-center justify-center bg-black/40">
|
<div class="fixed inset-0 flex items-center justify-center bg-black/40">
|
||||||
|
|||||||
Reference in New Issue
Block a user