mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 02:41:35 +01:00
Sort blog articles by date and increase image preview size
This commit is contained in:
@@ -15,6 +15,12 @@
|
||||
isLegalPage: boolean;
|
||||
websiteUrl: string;
|
||||
} = $props();
|
||||
|
||||
const sortedArticles = websiteOverview.article.sort((a, b) => {
|
||||
if (!a.publication_date) return 1;
|
||||
if (!b.publication_date) return -1;
|
||||
return new Date(b.publication_date).getTime() - new Date(a.publication_date).getTime();
|
||||
});
|
||||
</script>
|
||||
|
||||
<Head
|
||||
@@ -49,7 +55,7 @@
|
||||
</h2>
|
||||
|
||||
<ul class="unpadded">
|
||||
{#each websiteOverview.article as article}
|
||||
{#each sortedArticles as article}
|
||||
<li>
|
||||
{#if article.publication_date}
|
||||
<p>{article.publication_date}</p>
|
||||
|
||||
@@ -83,7 +83,11 @@
|
||||
<input type="file" name="favicon" accept={ALLOWED_MIME_TYPES.join(", ")} />
|
||||
</label>
|
||||
{#if data.globalSettings.favicon_image}
|
||||
<Modal id="preview-favicon-global-{data.globalSettings.website_id}" text="Preview">
|
||||
<Modal
|
||||
id="preview-favicon-global-{data.globalSettings.website_id}"
|
||||
text="Preview"
|
||||
isWider={true}
|
||||
>
|
||||
<img
|
||||
src={`${data.API_BASE_PREFIX}/rpc/retrieve_file?id=${data.globalSettings.favicon_image}`}
|
||||
alt=""
|
||||
@@ -130,7 +134,7 @@
|
||||
<input type="file" name="logo-image" accept={ALLOWED_MIME_TYPES.join(", ")} />
|
||||
</label>
|
||||
{#if data.header.logo_image}
|
||||
<Modal id="preview-logo-header-{data.header.website_id}" text="Preview">
|
||||
<Modal id="preview-logo-header-{data.header.website_id}" text="Preview" isWider={true}>
|
||||
<img
|
||||
src={`${data.API_BASE_PREFIX}/rpc/retrieve_file?id=${data.header.logo_image}`}
|
||||
alt=""
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<input type="file" name="cover-image" accept={ALLOWED_MIME_TYPES.join(", ")} />
|
||||
</label>
|
||||
{#if data.article.cover_image}
|
||||
<Modal id="preview-cover-article-{data.article.id}" text="Preview">
|
||||
<Modal id="preview-cover-article-{data.article.id}" text="Preview" isWider={true}>
|
||||
<img
|
||||
src={`${data.API_BASE_PREFIX}/rpc/retrieve_file?id=${data.article.cover_image}`}
|
||||
alt=""
|
||||
|
||||
Reference in New Issue
Block a user