ui: Handle exercice authors
This commit is contained in:
parent
28ad0fa791
commit
60243dd486
@ -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>
|
||||
|
@ -12,6 +12,7 @@ var GlobalScoreCoefficient float64 = 1
|
||||
type exportedExercice struct {
|
||||
Id int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Authors string `json:"authors,omitempty"`
|
||||
Headline string `json:"headline,omitempty"`
|
||||
Image string `json:"image,omitempty"`
|
||||
URLId string `json:"urlid"`
|
||||
@ -63,6 +64,7 @@ func ExportThemes() (interface{}, error) {
|
||||
exos = append(exos, exportedExercice{
|
||||
exercice.Id,
|
||||
exercice.Title,
|
||||
exercice.Authors,
|
||||
exercice.Headline,
|
||||
exoimgpath,
|
||||
exercice.URLId,
|
||||
|
Loading…
x
Reference in New Issue
Block a user