Skip to content

Commit

Permalink
Comment out
Browse files Browse the repository at this point in the history
  • Loading branch information
foxyseta committed Oct 6, 2023
1 parent 89f1172 commit 175f897
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/lib/teachings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type Course = {
years: TeachingYear[];
};

export async function getActiveCourse(fetch: typeof window.fetch, teaching:
async function getActiveCourse(fetch: typeof window.fetch, teaching:
Teaching) {
try {
await getManifest(fetch, teaching.url);
Expand Down
28 changes: 15 additions & 13 deletions src/routes/build/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
`https://github.com/csunibo/${project}/actions/workflows/${workflow}.yml`;
export let data: PageData;
let activeYears: Teaching[] = [];
let activeYears: Teaching[][] = [];
onMount(async () => {
activeYears = (await data.streaming?.activeCourses) ?? [];
console.log(data);
});
</script>

Expand All @@ -31,24 +32,25 @@
<hr class="my-8 border-primary" />
{/if}
<h2 class="text-center text-2xl">{course.name}</h2>
<!-- {@const activeTeachings = activeYears[i]} -->
{#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)}
<!-- {@const enabled = activeTeachings.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}
<!-- {#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>
Expand Down
6 changes: 3 additions & 3 deletions src/routes/build/+page.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { PageLoad } from './$types';
import { getActiveCourse } from '$lib/teachings';
import { getActiveCourses } from '$lib/teachings';
import TEACHINGS from '$lib/teachings';

export const load = (async ({ fetch, params }) => {
export const load = (async ({ fetch, _ }) => {
streaming: {
activeCourses: TEACHINGS.filter((t) => getActiveCourse(fetch, t));
activeCourses: TEACHINGS.map((c) => getActiveCourses(fetch, c));
}
}) satisfies PageLoad;

0 comments on commit 175f897

Please sign in to comment.