From ca115f880e1e78d6ba6fad80af9dab426558d476 Mon Sep 17 00:00:00 2001 From: tree Date: Sat, 30 Apr 2022 04:05:11 +0200 Subject: [PATCH] Update --- src/routes/specialni-vstupenky.svelte | 30 ++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) 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} +