ui: Handle exercice image
This commit is contained in:
parent
ab23ef8f71
commit
1a8ebcb8bf
2 changed files with 20 additions and 1 deletions
|
|
@ -7,7 +7,19 @@
|
|||
} from 'sveltestrap';
|
||||
|
||||
import { challengeInfo } from '$lib/stores/challengeinfo';
|
||||
import { current_exercice } from '$lib/stores/exercices';
|
||||
import { current_theme } from '$lib/stores/themes';
|
||||
|
||||
let heading_image = "";
|
||||
$: if ($current_theme) {
|
||||
if ($current_exercice && $current_exercice.image) {
|
||||
heading_image = $current_exercice.image;
|
||||
} else {
|
||||
heading_image = $current_theme.image;
|
||||
}
|
||||
} else {
|
||||
heading_image = "";
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
|
@ -27,7 +39,7 @@
|
|||
</Alert>
|
||||
</Container>
|
||||
{:else}
|
||||
<div style="background-image: url({$current_theme.image})" class="page-header">
|
||||
<div style="background-image: url({heading_image})" class="page-header">
|
||||
<Container class="text-primary">
|
||||
<h1 class="display-2">
|
||||
<a href="{$current_theme.urlid}">{$current_theme.name}</a>
|
||||
|
|
|
|||
Reference in a new issue