ui: Handle exercice authors

This commit is contained in:
nemunaire 2023-06-14 20:53:09 +02:00
commit 60243dd486
2 changed files with 11 additions and 1 deletions

View file

@ -11,14 +11,22 @@
import { current_theme } from '$lib/stores/themes';
let heading_image = "";
let current_authors = "";
$: if ($current_theme) {
if ($current_exercice && $current_exercice.image) {
heading_image = $current_exercice.image;
} else {
heading_image = $current_theme.image;
}
if ($current_exercice && $current_exercice.authors) {
current_authors = $current_exercice.authors;
} else {
current_authors = $current_theme.authors;
}
} else {
heading_image = "";
current_authors = "";
}
</script>
@ -44,7 +52,7 @@
<h1 class="display-2">
<a href="{$current_theme.urlid}">{$current_theme.name}</a>
</h1>
<h2>{@html $current_theme.authors}</h2>
<h2>{@html current_authors}</h2>
</Container>
<div class="headerfade"></div>
</div>