From d1d654ebac2d51e3841675faeb56480e440f622f Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Tue, 5 Mar 2024 18:08:09 +0100 Subject: Initial commit --- frontend/src/routes/archives/+page.svelte | 119 +++++++++++++++++++++++++ frontend/src/routes/archives/+page.ts | 12 +++ frontend/src/routes/archives/[id]/+page.svelte | 99 ++++++++++++++++++++ frontend/src/routes/archives/[id]/+page.ts | 5 ++ 4 files changed, 235 insertions(+) create mode 100644 frontend/src/routes/archives/+page.svelte create mode 100644 frontend/src/routes/archives/+page.ts create mode 100644 frontend/src/routes/archives/[id]/+page.svelte create mode 100644 frontend/src/routes/archives/[id]/+page.ts (limited to 'frontend/src/routes/archives') diff --git a/frontend/src/routes/archives/+page.svelte b/frontend/src/routes/archives/+page.svelte new file mode 100644 index 0000000..545058a --- /dev/null +++ b/frontend/src/routes/archives/+page.svelte @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + {#if archives} + +
+ + {#each archives.edges as { id, name, cover, size, pageCount }, index (id)} + + + +
+ + + + + + +
+
+
+ {:else} + + {/each} +
+
+ + {:else} + + {/if} +
diff --git a/frontend/src/routes/archives/+page.ts b/frontend/src/routes/archives/+page.ts new file mode 100644 index 0000000..88acade --- /dev/null +++ b/frontend/src/routes/archives/+page.ts @@ -0,0 +1,12 @@ +import { ArchiveSort, type ArchiveFilterInput } from '$gql/graphql'; +import { parseFilter, parsePaginationData, parseSortData } from '$lib/Navigation'; + +export const trailingSlash = 'always'; + +export function load({ url }: { url: URL; params: Record }) { + return { + sort: parseSortData(url.searchParams, ArchiveSort.Path), + filter: parseFilter(url.searchParams), + pagination: parsePaginationData(url.searchParams, 24) + }; +} diff --git a/frontend/src/routes/archives/[id]/+page.svelte b/frontend/src/routes/archives/[id]/+page.svelte new file mode 100644 index 0000000..50a2940 --- /dev/null +++ b/frontend/src/routes/archives/[id]/+page.svelte @@ -0,0 +1,99 @@ + + + + +{#if archive} + +
+ +
+ + + +
+ ($reader = $reader.open(e.detail))} + on:cover={updateCover} + /> +
+
+{:else} + +{/if} + + + + diff --git a/frontend/src/routes/archives/[id]/+page.ts b/frontend/src/routes/archives/[id]/+page.ts new file mode 100644 index 0000000..d872ba2 --- /dev/null +++ b/frontend/src/routes/archives/[id]/+page.ts @@ -0,0 +1,5 @@ +export function load({ params }: { params: Record }) { + return { + id: +params.id + }; +} -- cgit v1.2.3-2-gb3c3