ui: Almost all interface done with Svelte
This commit is contained in:
parent
9fa1ede69c
commit
7e13cf28bd
54 changed files with 2809 additions and 16 deletions
59
frontend/ui/src/components/ThemeNav.svelte
Normal file
59
frontend/ui/src/components/ThemeNav.svelte
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<script>
|
||||
import {
|
||||
Breadcrumb,
|
||||
BreadcrumbItem,
|
||||
Card,
|
||||
Icon,
|
||||
} from 'sveltestrap';
|
||||
|
||||
import { my } from '../stores/my.js';
|
||||
|
||||
export let theme = {};
|
||||
export let exercice = {};
|
||||
</script>
|
||||
|
||||
<Card body class="mb-3" color="dark">
|
||||
<Breadcrumb listClassName="mb-0">
|
||||
{#each Object.keys(theme.exercices) as k, index}
|
||||
<BreadcrumbItem active={k == exercice.id}>
|
||||
{#if k == exercice.id}
|
||||
<strong class="text-info">
|
||||
{theme.exercices[k].title}
|
||||
{#if theme.exercices[k].curcoeff > 1.0}
|
||||
<Icon name="gift" aria-hidden="true" />
|
||||
{/if}
|
||||
{#if $my && $my.team_id && $my.exercices[k] && $my.exercices[k].solved}
|
||||
<Icon name="check" class="text-success" aria-hidden="true" />
|
||||
{/if}
|
||||
</strong>
|
||||
{:else if $my && $my.exercices[k]}
|
||||
<a href="/{theme.urlid}/{theme.exercices[k].urlid}" class:text-success={$my.exercices[k].solved}>
|
||||
{theme.exercices[k].title}
|
||||
{#if theme.exercices[k].curcoeff > 1.0}
|
||||
<Icon name="gift" aria-hidden="true" />
|
||||
{/if}
|
||||
{#if $my.team_id && $my.exercices[k].solved}
|
||||
<Icon name="check" class="text-success" aria-hidden="true" />
|
||||
{/if}
|
||||
</a>
|
||||
{:else}
|
||||
<span class="text-muted">
|
||||
{theme.exercices[k].title}
|
||||
{#if theme.exercices[k].curcoeff > 1.0}
|
||||
<Icon name="gift" aria-hidden="true" />
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</BreadcrumbItem>
|
||||
{/each}
|
||||
</Breadcrumb>
|
||||
</Card>
|
||||
|
||||
<style>
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
a[href]:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
Reference in a new issue