-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' of https://github.com/20041540MichaelKelly…
…/tutors into feat/toc-companions-walls-cypress-test#393
- Loading branch information
Showing
13 changed files
with
65 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
app/src/lib/ui/legacy/Molecules/Breadcrumbs/Breadcrumbs.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,44 @@ | ||
<script lang="ts"> | ||
import { onMount } from "svelte"; | ||
import { currentCourse } from "$lib/stores"; | ||
import { Card } from "$lib/ui/legacy"; | ||
import type { Lo } from "$lib/services/models/lo-types"; | ||
export let los: Lo[] = []; | ||
export let border: boolean = false; | ||
export let disableSort = false; | ||
let orderedLos = los; | ||
let unOrderedLos: Lo[] = []; | ||
if (!disableSort) { | ||
orderedLos = los.filter((lo) => lo?.frontMatter?.order); | ||
unOrderedLos = los.filter((lo) => !lo?.frontMatter?.order); | ||
orderedLos.sort((a, b) => Number(a.frontMatter?.order) - Number(b.frontMatter?.order)); | ||
} | ||
let bordered = "border-[1px] border-surface-200-700-token"; | ||
let unbordered = ""; | ||
let pinBuffer = ""; | ||
let ignorePin = ""; | ||
let refresh = true; | ||
function keypressInput(e: { key: string }) { | ||
pinBuffer = pinBuffer.concat(e.key); | ||
if (pinBuffer === ignorePin) { | ||
los.forEach((lo) => { | ||
lo.hide = false; | ||
}); | ||
refresh = !refresh; | ||
} | ||
} | ||
onMount(async () => { | ||
if ($currentCourse?.properties.ignorepin) { | ||
ignorePin = $currentCourse.properties.ignorepin.toString(); | ||
window.addEventListener("keydown", keypressInput); | ||
} | ||
}); | ||
</script> | ||
|
||
{#if los.length > 0} | ||
<div class="bg-surface-100-800-token mx-auto mb-2 place-items-center overflow-hidden rounded-xl p-4 {border ? bordered : unbordered}"> | ||
<div class="flex flex-wrap justify-center"> | ||
{#each orderedLos as lo} | ||
<Card {lo} /> | ||
{/each} | ||
{#each unOrderedLos as lo} | ||
<Card {lo} /> | ||
<div class="bg-surface-100-800-token mx-auto mb-2 place-items-center overflow-hidden rounded-xl p-4 {border ? bordered : unbordered}"> | ||
<div class="flex flex-wrap justify-center"> | ||
{#key refresh} | ||
{#each los as lo} | ||
{#if !lo.hide} | ||
<Card {lo} /> | ||
{/if} | ||
{/each} | ||
</div> | ||
{/key} | ||
</div> | ||
{/if} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters