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;
|
isLegalPage: boolean;
|
||||||
websiteUrl: string;
|
websiteUrl: string;
|
||||||
} = $props();
|
} = $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>
|
</script>
|
||||||
|
|
||||||
<Head
|
<Head
|
||||||
@@ -49,7 +55,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<ul class="unpadded">
|
<ul class="unpadded">
|
||||||
{#each websiteOverview.article as article}
|
{#each sortedArticles as article}
|
||||||
<li>
|
<li>
|
||||||
{#if article.publication_date}
|
{#if article.publication_date}
|
||||||
<p>{article.publication_date}</p>
|
<p>{article.publication_date}</p>
|
||||||
|
|||||||
@@ -83,7 +83,11 @@
|
|||||||
<input type="file" name="favicon" accept={ALLOWED_MIME_TYPES.join(", ")} />
|
<input type="file" name="favicon" accept={ALLOWED_MIME_TYPES.join(", ")} />
|
||||||
</label>
|
</label>
|
||||||
{#if data.globalSettings.favicon_image}
|
{#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
|
<img
|
||||||
src={`${data.API_BASE_PREFIX}/rpc/retrieve_file?id=${data.globalSettings.favicon_image}`}
|
src={`${data.API_BASE_PREFIX}/rpc/retrieve_file?id=${data.globalSettings.favicon_image}`}
|
||||||
alt=""
|
alt=""
|
||||||
@@ -130,7 +134,7 @@
|
|||||||
<input type="file" name="logo-image" accept={ALLOWED_MIME_TYPES.join(", ")} />
|
<input type="file" name="logo-image" accept={ALLOWED_MIME_TYPES.join(", ")} />
|
||||||
</label>
|
</label>
|
||||||
{#if data.header.logo_image}
|
{#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
|
<img
|
||||||
src={`${data.API_BASE_PREFIX}/rpc/retrieve_file?id=${data.header.logo_image}`}
|
src={`${data.API_BASE_PREFIX}/rpc/retrieve_file?id=${data.header.logo_image}`}
|
||||||
alt=""
|
alt=""
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
<input type="file" name="cover-image" accept={ALLOWED_MIME_TYPES.join(", ")} />
|
<input type="file" name="cover-image" accept={ALLOWED_MIME_TYPES.join(", ")} />
|
||||||
</label>
|
</label>
|
||||||
{#if data.article.cover_image}
|
{#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
|
<img
|
||||||
src={`${data.API_BASE_PREFIX}/rpc/retrieve_file?id=${data.article.cover_image}`}
|
src={`${data.API_BASE_PREFIX}/rpc/retrieve_file?id=${data.article.cover_image}`}
|
||||||
alt=""
|
alt=""
|
||||||
|
|||||||
Reference in New Issue
Block a user