diff --git a/src/routes/specialni-vstupenky.svelte b/src/routes/specialni-vstupenky.svelte index 446b47d..3f16182 100644 --- a/src/routes/specialni-vstupenky.svelte +++ b/src/routes/specialni-vstupenky.svelte @@ -11,9 +11,12 @@ let lastUpdate = null; let data = null; + let speakersWithoutTicket = null; async function loadData() { data = await api.apiCall("claims"); + speakersWithoutTicket = speakersWithoutTicketGen() + lastUpdate = new Date(); } @@ -49,6 +52,19 @@ return arr; } + function speakersWithoutTicketGen () { + if (!data) { + return null + } + const wt = [] + $bundle.spec.speakers.forEach(sp => { + if (!data.find(i => i.link.type === 'speaker' && i.link.id === sp.id)) { + wt.push(sp) + } + }) + return wt + } + onMount(() => { loadData(); }); @@ -65,7 +81,18 @@ Celkem: {data.length}, vyzvednuto: {data.filter((x) => x.claimed) .length}/{data.length} -
+ {#if speakersWithoutTicket} +
+

Přednášející bez kódu ({speakersWithoutTicket.length})

+
+ {#each speakersWithoutTicket as sp} +
 {sp.name}
+ {/each} +
+
+ {/if} +
+

Seznam všech speciálních vstupenek ({data.length})

@@ -131,3 +158,4 @@
Načítám ..
{/if} +