Skip to content

Commit

Permalink
modularize textzeugenselector
Browse files Browse the repository at this point in the history
  • Loading branch information
flicksolutions committed Jun 11, 2024
1 parent 3267d60 commit 4989c13
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
26 changes: 17 additions & 9 deletions src/lib/components/TextzeugenSelector.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<script>
import { codices, fragments } from '$lib/sigla.json';
import VerseSelector from '$lib/components/VerseSelector.svelte';
export let value = '';
let selectedSigla = ['', ''];
</script>

<label>
Textzeugen: <select class="select my-2" bind:value>
<option value="">Textzeuge 1</option>
{#each [...codices, ...fragments] as { sigil, handle }}
<option value={handle}>{sigil}</option>
{/each}
</select>
</label>
<div class="flex gap-1 my-3">
{#each Array.from({ length: 2 }) as _, i}
<label>
Textzeugen: <select class="select my-2" bind:value={selectedSigla[i]}>
<option value="">Textzeuge 1</option>
{#each [...codices, ...fragments] as { sigil, handle }}
<option value={handle}>{sigil}</option>
{/each}
</select>
</label>
{/each}
</div>
<div class="flex max-w-full items-baseline gap-1 my-3">
<VerseSelector targetPath={`/textzeugen/${selectedSigla.join('-')}`} />
</div>
8 changes: 1 addition & 7 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@
danach die Zahl des Verses.
</p>
<div>
<div class="flex gap-1 my-3">
<TextzeugenSelector bind:value={selectedSigla[0]} />
<TextzeugenSelector bind:value={selectedSigla[1]} />
</div>
<div class="flex max-w-full items-baseline gap-1 my-3">
<VerseSelector targetPath={`/textzeugen/${selectedSigla.join('-')}`} />
</div>
<TextzeugenSelector />
</div>
</section>
<section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { onMount } from 'svelte';
import { assets } from '$app/paths';
import { teipb } from '$lib/constants';
import TextzeugenSelector from '$lib/components/TextzeugenSelector.svelte';
/** @type {import('./$types').PageData} */
export let data;
Expand Down Expand Up @@ -116,6 +117,7 @@
<section class="w-full">
<h1 class="h1">Textzeugen</h1>
<p>Textzeugenansicht, Einstellungen</p>
<TextzeugenSelector />
</section>
{#if data.sigla}
{#each data.sigla as witnes}
Expand Down

0 comments on commit 4989c13

Please sign in to comment.