This commit is contained in:
tree 2022-04-26 06:02:39 +02:00
rodič 2e276b2afe
revize fafa38863f
3 změnil soubory, kde provedl 31 přidání a 3 odebrání

Zobrazit soubor

@ -3,12 +3,29 @@
import Avatar from "$lib/Avatar.svelte";
import Tooltip from "$lib/Tooltip.svelte";
import SvelteMarkdown from "svelte-markdown";
import EventTypeLabel from "$lib/EventTypeLabel.svelte";
import { bundle, userData } from "$lib/stores.js";
import { calcDuration, addFavorite } from "$lib/events.js";
import Link from "$lib/Link.svelte";
const renderers = { link: Link };
$: e = event;
$: duration = calcDuration(e, $bundle);
$: spoiler = makeSpoiler(e)
function makeSpoiler (_e) {
if (!_e.description) {
return {}
}
const parts = _e.description.split("\n\n")
const stripped = parts.length > 1
return {
md: parts[0], // + ` ([Zobrazit celý popis](/udalosti?id=${_e.id}))`,
stripped
}
}
function speakersMap(arr) {
if (!arr) return;
@ -71,6 +88,16 @@
{/if}
</div>
</div>
{#if e.description}
<div class="mt-2">
<SvelteMarkdown source={spoiler.md} {renderers} />
{#if spoiler.stripped}
<div class="text-sm text-blue-web/60">
(<a href="/udalosti?id={e.id}">Zobrazit celý popis</a>)
</div>
{/if}
</div>
{/if}
{#if getChildrens(e).length > 0}
<div class="mt-4 w-auto mb-2">
<div class="flex flex-wrap gap-2" cellpadding="5">
@ -108,4 +135,5 @@
</div>
</div>
{/if}
</div>

Zobrazit soubor

@ -112,8 +112,8 @@
bundle.subscribe(bd => {
fuse = new Fuse(bd.spec.events, {
includeScore: true,
minMatchCharLength: 1,
//includeScore: true,
//minMatchCharLength: 1,
threshold: 0.4,
keys: [
{ name: 'name', weight: 10 },

Zobrazit soubor

@ -64,7 +64,7 @@
<div class="text-sm my-auto">{duration}m</div>
{/if}
{#if e.track}
<div class="text-md my-auto">{trackRender(e.track)}</div>
<div class="text-md my-auto"><a href="/program?track={e.track}">{trackRender(e.track)}</a></div>
{/if}
{#if e.tags}
<div class="flex text-xs gap-1 my-auto text-blue-web/60">