Expand website and game trackers
Some checks failed
Test and deploy staging / staging (push) Failing after 5m29s

This commit is contained in:
2026-09-25 22:43:04 +00:00
parent f6b34150d4
commit c2ba8febb4
4076 changed files with 97237 additions and 1453 deletions

View File

@@ -1,4 +1,11 @@
<script lang="ts">
import { onMount } from 'svelte';
let hydrated = $state(false);
onMount(() => {
hydrated = true;
});
import { NativeSelect } from '$lib/components/ui/native-select/index.js';
import * as Dialog from '$lib/components/ui/dialog/index.js';
import { enhance } from '$app/forms';
import { resolve } from '$app/paths';
import ProgressBar from '$lib/components/ProgressBar.svelte';
@@ -45,30 +52,44 @@
<div class="mx-auto max-w-6xl px-4 py-12 sm:px-6 sm:py-16">
<div class="mb-10 flex flex-wrap items-center justify-between gap-4">
<h1 class="text-4xl font-semibold tracking-tight sm:text-5xl">lists</h1>
{#if data.isAdmin}<details class="relative">
<summary class="cursor-pointer text-base underline underline-offset-4">new list</summary>
<form
method="POST"
action="?/newList"
enctype="multipart/form-data"
use:enhance={uploadPicture}
class="absolute top-full right-0 z-10 mt-3 w-80 max-w-[calc(100vw-2rem)] space-y-3 rounded-lg border border-[var(--site-border)] bg-[var(--site-surface)] p-4 shadow-lg"
{#if data.isAdmin}<Dialog.Root>
<Dialog.Trigger disabled={!hydrated} class="underline underline-offset-4"
>new list</Dialog.Trigger
>
<label class="block"
>name<Input name="name" required maxlength={200} class="mt-2" /></label
<Dialog.Content
><Dialog.Header
><Dialog.Title>new list</Dialog.Title><Dialog.Description
>Create a collection or track progress through a list.</Dialog.Description
></Dialog.Header
>
<label class="block"
>type<select
name="type"
class="mt-2 w-full rounded border border-[var(--site-border)] bg-[var(--site-bg)] px-3 py-2"
><option value="normal">normal</option><option value="progress">progress</option
></select
></label
{#if form?.message}<p role="alert" class="text-destructive">
{form.message}
</p>{/if}{#if uploadError}<p role="alert" class="text-destructive">
{uploadError}
</p>{/if}
<form
method="POST"
action="?/newList"
enctype="multipart/form-data"
use:enhance={uploadPicture}
class="space-y-4"
>
<ListPictureDropzone label="List picture (optional)" />
<Button type="submit" disabled={uploading}>create list</Button>
</form>
</details>{/if}
<label class="block"
>name<Input name="name" required maxlength={200} class="mt-2" /></label
>
<label class="block"
>type<NativeSelect
name="type"
class="mt-2 w-full rounded border border-[var(--site-border)] bg-[var(--site-bg)] px-3 py-2"
><option value="normal">normal</option><option value="progress">progress</option
></NativeSelect
></label
>
<ListPictureDropzone label="List picture (optional)" />
<Button type="submit" disabled={uploading}>create list</Button>
</form>
</Dialog.Content></Dialog.Root
>{/if}
</div>
{#if form?.message}<p role="alert" class="mb-5 text-red-500">{form.message}</p>{/if}
{#if uploadError}<p role="alert" class="mb-5 text-red-500">{uploadError}</p>{/if}