Implement and display headlines in interface
This commit is contained in:
parent
abd7fc6bef
commit
8c95782eff
13 changed files with 85 additions and 58 deletions
|
@ -7,13 +7,14 @@ import (
|
|||
|
||||
// exportedExercice is a structure representing a challenge, as exposed to players.
|
||||
type exportedExercice struct {
|
||||
Title string `json:"title"`
|
||||
URLId string `json:"urlid"`
|
||||
Tags []string `json:"tags"`
|
||||
Gain int64 `json:"gain"`
|
||||
Coeff float64 `json:"curcoeff"`
|
||||
Solved int64 `json:"solved"`
|
||||
Tried int64 `json:"tried"`
|
||||
Title string `json:"title"`
|
||||
Headline string `json:"headline,omitempty"`
|
||||
URLId string `json:"urlid"`
|
||||
Tags []string `json:"tags"`
|
||||
Gain int64 `json:"gain"`
|
||||
Coeff float64 `json:"curcoeff"`
|
||||
Solved int64 `json:"solved"`
|
||||
Tried int64 `json:"tried"`
|
||||
}
|
||||
|
||||
// exportedTheme is a structure representing a Theme, as exposed to players.
|
||||
|
@ -21,6 +22,7 @@ type exportedTheme struct {
|
|||
Name string `json:"name"`
|
||||
URLId string `json:"urlid"`
|
||||
Authors string `json:"authors"`
|
||||
Headline string `json:"headline,omitempty"`
|
||||
Intro string `json:"intro"`
|
||||
Image string `json:"image,omitempty"`
|
||||
Exercices map[string]exportedExercice `json:"exercices"`
|
||||
|
@ -41,6 +43,7 @@ func ExportThemes() (interface{}, error) {
|
|||
tags, _ := exercice.GetTags()
|
||||
exos[fmt.Sprintf("%d", exercice.Id)] = exportedExercice{
|
||||
exercice.Title,
|
||||
exercice.Headline,
|
||||
exercice.URLId,
|
||||
tags,
|
||||
exercice.Gain,
|
||||
|
@ -59,6 +62,7 @@ func ExportThemes() (interface{}, error) {
|
|||
theme.Name,
|
||||
theme.URLId,
|
||||
theme.Authors,
|
||||
theme.Headline,
|
||||
theme.Intro,
|
||||
imgpath,
|
||||
exos,
|
||||
|
|
Reference in a new issue