diff --git a/apps/manacore/apps/web/src/lib/components/workbench/app-registry.ts b/apps/manacore/apps/web/src/lib/components/workbench/app-registry.ts index c2faeb3c3..137c56440 100644 --- a/apps/manacore/apps/web/src/lib/components/workbench/app-registry.ts +++ b/apps/manacore/apps/web/src/lib/components/workbench/app-registry.ts @@ -75,6 +75,10 @@ export const APP_REGISTRY: AppEntry[] = [ name: 'Cards', color: '#EF4444', load: () => import('$lib/modules/cards/AppView.svelte'), + views: { + list: { load: () => import('$lib/modules/cards/AppView.svelte') }, + detail: { load: () => import('$lib/modules/cards/views/DetailView.svelte') }, + }, }, { id: 'picture', @@ -103,6 +107,10 @@ export const APP_REGISTRY: AppEntry[] = [ name: 'Storage', color: '#6B7280', load: () => import('$lib/modules/storage/AppView.svelte'), + views: { + list: { load: () => import('$lib/modules/storage/AppView.svelte') }, + detail: { load: () => import('$lib/modules/storage/views/DetailView.svelte') }, + }, }, { id: 'nutriphi', @@ -125,6 +133,10 @@ export const APP_REGISTRY: AppEntry[] = [ name: 'Presi', color: '#A855F7', load: () => import('$lib/modules/presi/AppView.svelte'), + views: { + list: { load: () => import('$lib/modules/presi/AppView.svelte') }, + detail: { load: () => import('$lib/modules/presi/views/DetailView.svelte') }, + }, }, { id: 'inventar', diff --git a/apps/manacore/apps/web/src/lib/modules/cards/AppView.svelte b/apps/manacore/apps/web/src/lib/modules/cards/AppView.svelte index e07ec4dd7..bb003cb68 100644 --- a/apps/manacore/apps/web/src/lib/modules/cards/AppView.svelte +++ b/apps/manacore/apps/web/src/lib/modules/cards/AppView.svelte @@ -6,6 +6,9 @@ import { liveQuery } from 'dexie'; import { db } from '$lib/data/database'; import type { LocalDeck, LocalCard } from './types'; + import type { ViewProps } from '$lib/components/workbench/nav-stack'; + + let { navigate, goBack, params }: ViewProps = $props(); let decks = $state([]); let cards = $state([]); @@ -52,8 +55,14 @@
{#each decks as deck (deck.id)} -
+ navigate('detail', { + deckId: deck.id, + _siblingIds: decks.map((d) => d.id), + _siblingKey: 'deckId', + })} + class="mb-2 w-full rounded-md border border-white/10 px-3 py-2.5 text-left transition-colors hover:bg-white/5" >
@@ -63,7 +72,7 @@ {#if deck.description}

{deck.description}

{/if} -
+ {/each} {#if decks.length === 0} diff --git a/apps/manacore/apps/web/src/lib/modules/cards/views/DetailView.svelte b/apps/manacore/apps/web/src/lib/modules/cards/views/DetailView.svelte new file mode 100644 index 000000000..6bc96ed1c --- /dev/null +++ b/apps/manacore/apps/web/src/lib/modules/cards/views/DetailView.svelte @@ -0,0 +1,376 @@ + + + +
+ {#if !deck} +

Deck nicht gefunden

+ {:else} + + (focused = true)} + onblur={saveField} + placeholder="Deck-Name..." + /> + + +
+
+ Farbe + (focused = true)} + onblur={saveField} + /> +
+ +
+ Öffentlich + +
+ +
+ Karten + {cardCount} +
+ + {#if deck.lastStudied} +
+ Zuletzt gelernt + {new Date(deck.lastStudied).toLocaleDateString('de')} +
+ {/if} +
+ + +
+ + +
+ + +
+ Erstellt: {new Date(deck.createdAt ?? '').toLocaleDateString('de')} + {#if deck.updatedAt} + Bearbeitet: {new Date(deck.updatedAt).toLocaleDateString('de')} + {/if} +
+ + +
+ {#if confirmDelete} +

Deck wirklich löschen?

+
+ + +
+ {:else} + + {/if} +
+ {/if} +
+ + diff --git a/apps/manacore/apps/web/src/lib/modules/presi/AppView.svelte b/apps/manacore/apps/web/src/lib/modules/presi/AppView.svelte index 2e1a30dae..16628b0c1 100644 --- a/apps/manacore/apps/web/src/lib/modules/presi/AppView.svelte +++ b/apps/manacore/apps/web/src/lib/modules/presi/AppView.svelte @@ -6,6 +6,9 @@ import { liveQuery } from 'dexie'; import { db } from '$lib/data/database'; import type { LocalDeck, LocalSlide } from './types'; + import type { ViewProps } from '$lib/components/workbench/nav-stack'; + + let { navigate, goBack, params }: ViewProps = $props(); let decks = $state([]); let slides = $state([]); @@ -44,8 +47,14 @@
{#each decks as deck (deck.id)} -
+ navigate('detail', { + deckId: deck.id, + _siblingIds: decks.map((d) => d.id), + _siblingKey: 'deckId', + })} + class="mb-2 w-full rounded-md border border-white/10 px-3 py-2.5 text-left transition-colors hover:bg-white/5" >

{deck.title}

@@ -57,7 +66,7 @@ {#if deck.description}

{deck.description}

{/if} -
+ {/each} {#if decks.length === 0} diff --git a/apps/manacore/apps/web/src/lib/modules/presi/views/DetailView.svelte b/apps/manacore/apps/web/src/lib/modules/presi/views/DetailView.svelte new file mode 100644 index 000000000..0770e8843 --- /dev/null +++ b/apps/manacore/apps/web/src/lib/modules/presi/views/DetailView.svelte @@ -0,0 +1,336 @@ + + + +
+ {#if !deck} +

Präsentation nicht gefunden

+ {:else} + + (focused = true)} + onblur={saveField} + placeholder="Titel..." + /> + + +
+
+ Öffentlich + +
+ +
+ Folien + {slideCount} +
+
+ + +
+ + +
+ + +
+ Erstellt: {new Date(deck.createdAt ?? '').toLocaleDateString('de')} + {#if deck.updatedAt} + Bearbeitet: {new Date(deck.updatedAt).toLocaleDateString('de')} + {/if} +
+ + +
+ {#if confirmDelete} +

Präsentation wirklich löschen?

+
+ + +
+ {:else} + + {/if} +
+ {/if} +
+ + diff --git a/apps/manacore/apps/web/src/lib/modules/storage/AppView.svelte b/apps/manacore/apps/web/src/lib/modules/storage/AppView.svelte index 3ebce74ce..c790a05a1 100644 --- a/apps/manacore/apps/web/src/lib/modules/storage/AppView.svelte +++ b/apps/manacore/apps/web/src/lib/modules/storage/AppView.svelte @@ -6,6 +6,9 @@ import { liveQuery } from 'dexie'; import { db } from '$lib/data/database'; import type { LocalFile, LocalFolder } from './types'; + import type { ViewProps } from '$lib/components/workbench/nav-stack'; + + let { navigate, goBack, params }: ViewProps = $props(); let files = $state([]); let folders = $state([]); @@ -76,13 +79,19 @@

Zuletzt

{#each recentFiles as file (file.id)} -
+ navigate('detail', { + fileId: file.id, + _siblingIds: recentFiles.map((f) => f.id), + _siblingKey: 'fileId', + })} + class="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-white/5" > {@html fileIcon(file.mimeType)} {file.name} {formatSize(file.size)} -
+ {/each} {#if recentFiles.length === 0} diff --git a/apps/manacore/apps/web/src/lib/modules/storage/views/DetailView.svelte b/apps/manacore/apps/web/src/lib/modules/storage/views/DetailView.svelte new file mode 100644 index 000000000..287014c8a --- /dev/null +++ b/apps/manacore/apps/web/src/lib/modules/storage/views/DetailView.svelte @@ -0,0 +1,281 @@ + + + +
+ {#if !file} +

Datei nicht gefunden

+ {:else} + + (focused = true)} + onblur={saveField} + placeholder="Dateiname..." + /> + + +
+
+ Originalname + {file.originalName} +
+ +
+ Typ + {file.mimeType} +
+ +
+ Größe + {formatSize(file.size)} +
+ +
+ Favorit + +
+ + {#if file.checksum} +
+ Prüfsumme + {file.checksum.slice(0, 16)}... +
+ {/if} +
+ + +
+ Erstellt: {new Date(file.createdAt ?? '').toLocaleDateString('de')} + {#if file.updatedAt} + Bearbeitet: {new Date(file.updatedAt).toLocaleDateString('de')} + {/if} +
+ + +
+ {#if confirmDelete} +

Datei wirklich löschen?

+
+ + +
+ {:else} + + {/if} +
+ {/if} +
+ +