Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
foxyseta committed Oct 6, 2023
1 parent d0505ee commit 89f1172
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 50 deletions.
82 changes: 41 additions & 41 deletions src/routes/build/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import type { PageData } from './$types';
import type { Course, Teaching } from '$lib/teachings';
import { onMount } from 'svelte';
import type { Teaching } from '$lib/teachings';
import TEACHINGS from '$lib/teachings';
const WORKFLOW_NAMES = ['filenames', 'build-and-deploy'];
Expand All @@ -14,45 +15,44 @@
activeYears = (await data.streaming?.activeCourses) ?? [];
});
</script>

<main class="md:container md:m-auto p-4">
<nav class="navbar flex bg-base-200 text-neutral-content rounded-box shadow-sm px-5 mb-5">
<div class="navbar-start">
<h1 class="text-xl font-semibold text-base-content">
Stato delle raccolte
</h1>
</div>
<div class="navbar-end">
<a class="btn btn-square btn-ghost" title="Indietro" href="/"> ⬆️ </a>
</div>
</nav>
<div class="m-8">
{#each TEACHINGS as course, i}
{#if i > 0}
<hr class="my-8 border-primary" />
{/if}
<h2 class="text-center text-2xl">{course.name}</h2>
{#each course.years as years}
<h3 class="text-center text-xl font-bold my-4">{years.year}</h3>
<div class="grid grid-cols-4 gap-4">
{#each years.teachings as teaching}
{@const enabled = activeYears.includes(teaching)}
<div>
<h4 class="font-bold">{teaching.name}</h4>
{#if enabled}
<div class="flex gap-2">
{#each WORKFLOW_NAMES as workflow}
{@const href = WORKFLOW_URL(teaching.url, workflow)}
{@const src = `${href}/badge.svg`}
<a {href}>
<img {src} alt="Not found" />
</a>
{/each}
</div>
{/if}
</div>
{/each}
</div>
{/each}
{/each}
</div>
<nav class="navbar flex bg-base-200 text-neutral-content rounded-box shadow-sm px-5 mb-5">
<div class="navbar-start">
<h1 class="text-xl font-semibold text-base-content">Stato delle raccolte</h1>
</div>
<div class="navbar-end">
<a class="btn btn-square btn-ghost" title="Indietro" href="/"> ⬆️ </a>
</div>
</nav>
<div class="m-8">
{#each TEACHINGS as course, i}
{#if i > 0}
<hr class="my-8 border-primary" />
{/if}
<h2 class="text-center text-2xl">{course.name}</h2>
{#each course.years as years}
<h3 class="text-center text-xl font-bold my-4">{years.year}</h3>
<div class="grid grid-cols-4 gap-4">
{#each years.teachings as teaching}
{@const enabled = activeYears.includes(teaching)}
<div>
<h4 class="font-bold">{teaching.name}</h4>
{#if enabled}
<div class="flex gap-2">
{#each WORKFLOW_NAMES as workflow}
{@const href = WORKFLOW_URL(teaching.url, workflow)}
{@const src = `${href}/badge.svg`}
<a {href}>
<img {src} alt="Not found" />
</a>
{/each}
</div>
{/if}
</div>
{/each}
</div>
{/each}
{/each}
</div>
</main>
14 changes: 6 additions & 8 deletions src/routes/build/+page.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import type { PageLoad } from './$types';
import type { getActiveCourse } from
'$lib/teachings';
import { getActiveCourse } from '$lib/teachings';
import TEACHINGS from '$lib/teachings';

export const load = (async ({ fetch, params }) =>
{
streaming: {
activeCourses: TEACHINGS.filter(t => getActiveCourse(fetch, t));
}
}) satisfies PageLoad;
export const load = (async ({ fetch, params }) => {
streaming: {
activeCourses: TEACHINGS.filter((t) => getActiveCourse(fetch, t));
}
}) satisfies PageLoad;
2 changes: 1 addition & 1 deletion src/routes/dash/[course]/+page.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PageLoad } from './$types';
import type { getActiveCourses } from '$lib/teachings';
import { getActiveCourses } from '$lib/teachings';
import TEACHINGS from '$lib/teachings';
import { error } from '@sveltejs/kit';

Expand Down

0 comments on commit 89f1172

Please sign in to comment.