This commit is contained in:
tree 2023-01-24 06:47:19 +01:00
rodič 64516ed221
revize 7346dda1f4
6 změnil soubory, kde provedl 90 přidání a 9 odebrání

54
package-lock.json vygenerováno
Zobrazit soubor

@ -7,6 +7,9 @@
"": {
"name": "pbw-inspect",
"version": "0.1.0",
"dependencies": {
"svelte-markdown": "^0.2.3"
},
"devDependencies": {
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-auto": "^1.0.0",
@ -576,6 +579,11 @@
"integrity": "sha512-COUnqfB2+ckwXXSFInsFdOAWQzCCx+a5hq2ruyj+Vjund94RJQd4LG2u9hnvJrTgunKAaax7ancBYlDrNYxA0g==",
"dev": true
},
"node_modules/@types/marked": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.0.8.tgz",
"integrity": "sha512-HVNzMT5QlWCOdeuBsgXP8EZzKUf0+AXzN+sLmjvaB3ZlLqO+e4u0uXrdw9ub69wBKFs+c6/pA4r9sy6cCDvImw=="
},
"node_modules/@types/node": {
"version": "18.11.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz",
@ -1781,6 +1789,17 @@
"node": ">=12"
}
},
"node_modules/marked": {
"version": "4.2.12",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz",
"integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==",
"bin": {
"marked": "bin/marked.js"
},
"engines": {
"node": ">= 12"
}
},
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@ -2499,7 +2518,6 @@
"version": "3.55.0",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.55.0.tgz",
"integrity": "sha512-uGu2FVMlOuey4JoKHKrpZFkoYyj0VLjJdz47zX5+gVK5odxHM40RVhar9/iK2YFRVxvfg9FkhfVlR0sjeIrOiA==",
"dev": true,
"engines": {
"node": ">= 8"
}
@ -2516,6 +2534,18 @@
"svelte": ">=3.19.0"
}
},
"node_modules/svelte-markdown": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/svelte-markdown/-/svelte-markdown-0.2.3.tgz",
"integrity": "sha512-2h680NzTXnAD0CXhxe3GeHl6W+ayG4iKQRl+BIDRw+R0mUE0OiNxP1Vt8Rn+aWevB/LBiBIPCAwvL+0BkG057A==",
"dependencies": {
"@types/marked": "^4.0.1",
"marked": "^4.0.10"
},
"peerDependencies": {
"svelte": "^3.0.0"
}
},
"node_modules/tailwindcss": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz",
@ -3095,6 +3125,11 @@
"integrity": "sha512-COUnqfB2+ckwXXSFInsFdOAWQzCCx+a5hq2ruyj+Vjund94RJQd4LG2u9hnvJrTgunKAaax7ancBYlDrNYxA0g==",
"dev": true
},
"@types/marked": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.0.8.tgz",
"integrity": "sha512-HVNzMT5QlWCOdeuBsgXP8EZzKUf0+AXzN+sLmjvaB3ZlLqO+e4u0uXrdw9ub69wBKFs+c6/pA4r9sy6cCDvImw=="
},
"@types/node": {
"version": "18.11.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz",
@ -3966,6 +4001,11 @@
"@jridgewell/sourcemap-codec": "^1.4.13"
}
},
"marked": {
"version": "4.2.12",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz",
"integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw=="
},
"merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@ -4418,8 +4458,7 @@
"svelte": {
"version": "3.55.0",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.55.0.tgz",
"integrity": "sha512-uGu2FVMlOuey4JoKHKrpZFkoYyj0VLjJdz47zX5+gVK5odxHM40RVhar9/iK2YFRVxvfg9FkhfVlR0sjeIrOiA==",
"dev": true
"integrity": "sha512-uGu2FVMlOuey4JoKHKrpZFkoYyj0VLjJdz47zX5+gVK5odxHM40RVhar9/iK2YFRVxvfg9FkhfVlR0sjeIrOiA=="
},
"svelte-hmr": {
"version": "0.15.1",
@ -4428,6 +4467,15 @@
"dev": true,
"requires": {}
},
"svelte-markdown": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/svelte-markdown/-/svelte-markdown-0.2.3.tgz",
"integrity": "sha512-2h680NzTXnAD0CXhxe3GeHl6W+ayG4iKQRl+BIDRw+R0mUE0OiNxP1Vt8Rn+aWevB/LBiBIPCAwvL+0BkG057A==",
"requires": {
"@types/marked": "^4.0.1",
"marked": "^4.0.10"
}
},
"tailwindcss": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz",

Zobrazit soubor

@ -27,5 +27,8 @@
"tailwindcss": "^3.2.4",
"vite": "^4.0.0"
},
"type": "module"
"type": "module",
"dependencies": {
"svelte-markdown": "^0.2.3"
}
}

Zobrazit soubor

@ -6,6 +6,7 @@
export let aspect = "aspect-square";
import { format, addDays } from 'date-fns';
import SvelteMarkdown from 'svelte-markdown';
function formateItemDate (item) {
let dt = format(new Date(item.date), "MMMM d")
@ -28,11 +29,18 @@
<h3 class=" text-pbw-red"><a href={_url(col, item)}>{item.shortname || item.name}</a></h3>
{#if col === "event"}
<div class="text-xl text-gray-500 my-2">
<span class="font-bold">{formateItemDate(item)}</span><br />{item.attendees}+ ppl
<span class="font-bold">{formateItemDate(item)}</span>
{#if item.attendees}<br />{item.attendees}+ ppl{/if}
</div>
{/if}
{#if col === "media-partner"}
{#if col === "media-partner" && item.description}
<div class="text-base text-gray-500 my-2">{item.description}</div>
{/if}
{#if col === "speaker" && (item.bio || item.orgs)}
<div class="text-base text-gray-500 my-2"><SvelteMarkdown source={item.orgs || item.bio} /></div>
{/if}
{#if col === "union" && item.description}
<div class="text-base text-gray-500 my-2"><SvelteMarkdown source={item.description} /></div>
{/if}
</div>
{/each}

Zobrazit soubor

@ -10,6 +10,8 @@ export async function load(entry = "23", host = null) {
);
data = await resp.json();
}
data.events.sort((a, b) => (a.attendees || 0) < (b.attendees || 0) ? 1 : -1)
//console.log(data.events)
data.speakers = [];
for (const event of data.events) {
if (!event.speakers) continue;

Zobrazit soubor

@ -1,4 +1,3 @@
<script>
import CollectionList from '$lib/CollectionList.svelte';
import { page } from '$app/stores';
@ -7,10 +6,14 @@
$: entry = $page.params.entry
</script>
<svelte:head>
<title>PBW Inspector</title>
</svelte:head>
<div class="w-full px-6 xl:mx-0">
<div class="max-w-7xl mx-auto pt-2 md:pt-7">
<h2 class="text-2xl uppercase font-bold text-gray-500">Unions ({data.bundle.unions.length})</h2>
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-6 my-6 text-center text-4xl">
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 my-6 text-center text-4xl">
<CollectionList arr={data.bundle.unions} img="logo" col="union" entry={entry} />
</div>
<h2 class="text-2xl uppercase font-bold text-gray-500">Events ({data.bundle.events.length})</h2>

Zobrazit soubor

@ -2,6 +2,7 @@
export let data;
import { page } from '$app/stores';
import CollectionList from '$lib/CollectionList.svelte';
import SvelteMarkdown from 'svelte-markdown';
const colsDef = {
union: "unions",
@ -18,6 +19,10 @@
let showSource = false;
</script>
<svelte:head>
<title>{item.name} | PBW Inspector</title>
</svelte:head>
<div class="w-full mx-6 xl:mx-0">
<div class="max-w-7xl mx-auto pt-5 md:pt-10">
<div class="flex gap-8">
@ -44,7 +49,13 @@
{item[key]?.join(", ")}
{#if defs.properties[key].items?.enum}
<div class="text-base">Available choices: {defs.properties[key].items.enum.join(", ")}</div>
{/if}
{/if}
{:else if defs.properties[key].type === 'string' && defs.properties[key].__markdown}
{#if item[key]}
<div class="md"><SvelteMarkdown source={item[key]} /></div>
{:else}
{/if}
{:else}
{item[key] || "❌"}
{/if}
@ -68,6 +79,12 @@
<div class="my-4">No speakers yet.</div>
{/if}
{/if}
{#if col === "union"}
<h2 class="text-2xl uppercase font-bold mt-10 text-gray-500">Events</h2>
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-6 mt-4 text-2xl text-center">
<CollectionList arr={data.bundle.events.filter(e => e.union === item.id)} col="event" img="logo" />
</div>
{/if}
<h2 class="text-2xl uppercase font-bold mt-10 text-gray-500 mb-4">Source code / Edit</h2>
<div>