diff --git a/src/routes/specialni-vstupenky.svelte b/src/routes/specialni-vstupenky.svelte new file mode 100644 index 0000000..b9d7567 --- /dev/null +++ b/src/routes/specialni-vstupenky.svelte @@ -0,0 +1,71 @@ + + + + + + Speciální vstupenky | {$bundle ? $bundle.name : "UTXO.22"} + + +
+

Speciální vstupenky

+ {#if data} +
+ Celkem: {data.length}, vyzvednuto: {data.filter((x) => x.claimed) + .length}/{data.length} +
+
+ + + + + + + + + + + {#each data as claim} + + + + + + + {/each} + +
TypOdkazVytvořenoVyzvednuto
{claim.type}{claim.link.type}:{claim.link.id}{fdate(claim.created)} + {#if claim.claimed}{fdate(claim.claimedOn)} | + {claim.ticketId}{:else}-{/if} +
+
+ {:else} +
Načítám ..
+ {/if} +
diff --git a/src/routes/vyzvednuti-vstupenky.svelte b/src/routes/vyzvednuti-vstupenky.svelte index d490b48..ef00172 100644 --- a/src/routes/vyzvednuti-vstupenky.svelte +++ b/src/routes/vyzvednuti-vstupenky.svelte @@ -29,6 +29,9 @@ if (link.type === "speaker") { return $bundle.spec.speakers.find((s) => s.id === link.id); } + if (link.type === "partner") { + return $bundle.spec.partners.find((s) => s.id === link.id); + } return null; } @@ -43,7 +46,12 @@ if (!claim) { goto("/"); } - if ($bundle && claim.link && claim.link.type === "speaker") { + if ( + $bundle && + claim.type === "speaker" && + claim.link && + claim.link.type === "speaker" + ) { const sp = $bundle.spec.speakers.find((s) => s.id === claim.link.id); if (sp) { form.name = sp.name || ""; @@ -53,12 +61,40 @@ } }); - const linkTypes = { + const ticketTypes = { speaker: { title: "Přednášející", + hostTitle: "Host přednášejícího", + col: "speakers", }, + organizator: { + title: "Organizátor", + hostTitle: "Host organizátora", + col: "speakers", + }, + partner: { title: "Partner", hostTitle: "Host partnera", col: "partners" }, + host: { title: "Host" }, }; + function makeTicketTypeInfo(c) { + if (!c) { + return null; + } + const out = { title: null, col: null }; + if (c.type === "host") { + const tt = ticketTypes[c.link.type]; + out.title = tt.hostTitle; + out.col = tt.col; + } else { + const tt = ticketTypes[c.type]; + out.title = tt.title; + out.col = tt.col; + } + return out; + } + + $: ticketTypeInfo = makeTicketTypeInfo(claim); + function processErrors(error) { if (typeof error === "string") { return { title: error }; @@ -146,10 +182,15 @@
Typ vstupenky
- {linkTypes[claim.link.type].title} + {ticketTypeInfo ? ticketTypeInfo.title : ""} {#if target} - - - {target.name} + ( + {target.name}) {/if}
@@ -192,7 +233,9 @@ maxlength="25" class="border border-blue-web rounded-md p-2 w-full text-blue-web" bind:value={form.name} - placeholder={faker.name.findName()} + placeholder={claim.type !== "speaker" + ? faker.name.findName() + : ""} /> @@ -204,7 +247,9 @@ maxlength="25" class="border border-blue-web rounded-md p-2 w-full text-blue-web" bind:value={form.org} - placeholder={faker.company.companyName()} + placeholder={claim.type !== "speaker" + ? faker.company.companyName() + : ""} /> @@ -216,7 +261,9 @@ maxlength="25" class="border border-blue-web rounded-md p-2 w-full text-blue-web" bind:value={form.twitter} - placeholder="@{faker.internet.userName()}" + placeholder={claim.type !== "speaker" + ? faker.internet.userName() + : ""} />