This commit is contained in:
tree 2022-04-09 16:32:21 +02:00
rodič cdc0fc58cb
revize c2212dad26
5 změnil soubory, kde provedl 35 přidání a 10 odebrání

Zobrazit soubor

@ -44,7 +44,7 @@
<div class="transition-all mb-4 border px-3 py-2 rounded-md shadow {$userData.favoriteEvents.includes(e.id) ? 'bg-yellow-100' : '' }" >
<div class="float-right"><i class="fa-star {$userData.favoriteEvents.includes(e.id) ? 'fa-solid' : 'fa-regular'} cursor-pointer" utxo-event-id="{e.id}" on:click={handleFavorite}></i></div>
<div class="text-lg font-semibold"><a href="/udalosti?id={e.id}">{e.name}</a></div>
<div class="text-lg font-semibold"><a href="/udalosti/{e.id}">{e.name}</a></div>
{#if e.speakers && e.speakers.length > 0}
<div class="mt-1 mb-2 flex flex-wrap gap-2">
{#each speakersMap(e.speakers) as s}
@ -65,7 +65,7 @@
<div class="flex flex-wrap gap-2" cellpadding="5">
{#each getParents(e) as pe}
<div class="border rounded py-1.5 px-2.5 bg-gray-100 text-sm">
<div class="font-bold"><a href="/udalosti?id={pe.id}">{pe.name}</a></div>
<div class="font-bold"><a href="/udalosti/{pe.id}">{pe.name}</a></div>
<div class="mt-1">
{#if pe.speakers.length === 0}
<div>TBA</div>

Zobrazit soubor

@ -8,7 +8,7 @@
import { goto } from '$app/navigation';
import Avatar from '$lib/Avatar.svelte';
import Event from '$lib/Event.svelte';
import { onMount } from 'svelte';
import { onMount, beforeUpdate } from 'svelte';
import { page } from '$app/stores';
import { bundle } from '$lib/stores.js';
@ -18,12 +18,16 @@
$: s = $bundle ? $bundle.spec.speakers.find(s => s.id === id) : null
$: events = s ? $bundle.spec.events.filter(ev => ev.speakers && ev.speakers.includes(s.id)) : []
onMount(() => {
function loadItem () {
const searchParams = new URLSearchParams($page.url.search)
id = searchParams.get('id')
if (!$bundle.spec.speakers.find(s => s.id === id)) {
goto('/')
}
}
onMount(() => {
loadItem()
})
function trackRender (trackId) {
@ -41,6 +45,10 @@
</script>
<svelte:head>
<title>{s ? s.name : ''} | Lidé | {$bundle ? $bundle.name : 'UTXO.22'}</title>
</svelte:head>
<section class="relative mx-auto py-6 sm:py-10 px-6 max-w-6xl text-blue-web">
{#if $bundle && s}
<div class="sm:flex gap-10 mt-4">

Zobrazit soubor

@ -15,13 +15,16 @@
let id = null
$: e = $bundle ? $bundle.spec.events.find(ev => ev.id === id) : null
onMount(() => {
const searchParams = new URLSearchParams($page.url.search)
id = searchParams.get('id')
function loadItem () {
id = $page.params.id
if (!$bundle.spec.events.find(ev => ev.id === id)) {
goto('/program')
}
}
onMount(() => {
loadItem()
})
function speakersMap (arr) {
@ -38,6 +41,10 @@
</script>
<svelte:head>
<title>{e ? e.name : ''} | Události | {$bundle ? $bundle.name : 'UTXO.22'}</title>
</svelte:head>
<section class="relative mx-auto py-6 sm:py-10 px-6 max-w-6xl text-blue-web">
{#if $bundle && e}
<div class="mb-6 flex flex-wrap gap-4">

Zobrazit soubor

@ -246,7 +246,7 @@
<div class="w-11 h-11 rounded-md" style="background-image: url({makeBlockie(ticket.avatarHash)}); background-size: 100% 100%;"></div>
<div class="w-auto">
<div class="no-flex">
<span class="font-bold px-2 py-1 bg-gray-200 rounded w-auto">#{ticket.id}</span>
<span class="px-2 py-1 bg-blue-web text-white rounded w-auto">#{ticket.id}</span>
</div>
<div class="mt-1.5">Běžná vstupenka</div>
</div>

Zobrazit soubor

@ -1,5 +1,8 @@
import adapter from '@sveltejs/adapter-static'
import bundle from './src/lib/bundle.json' assert {type: "json"}
const entries = []
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
@ -8,7 +11,14 @@ const config = {
// Override http methods in the Todo forms
methodOverride: {
allowed: ['PATCH', 'DELETE']
}
},
prerender: {
crawl: true,
entries: [
'*',
...entries
]
}
}
};