frontend: beautiful URLs
This commit is contained in:
parent
bd75157a79
commit
0c540a39eb
13 changed files with 54 additions and 31 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
type ExportedExercice struct {
|
||||
Title string `json:"title"`
|
||||
URLId string `json:"urlid"`
|
||||
Gain int64 `json:"gain"`
|
||||
Coeff float64 `json:"curcoeff"`
|
||||
Solved int64 `json:"solved"`
|
||||
|
|
@ -14,6 +15,7 @@ type ExportedExercice struct {
|
|||
|
||||
type exportedTheme struct {
|
||||
Name string `json:"name"`
|
||||
URLId string `json:"urlid"`
|
||||
Authors string `json:"authors"`
|
||||
Intro string `json:"intro"`
|
||||
Exercices map[string]ExportedExercice `json:"exercices"`
|
||||
|
|
@ -32,6 +34,7 @@ func ExportThemes() (interface{}, error) {
|
|||
for _, exercice := range exercices {
|
||||
exos[fmt.Sprintf("%d", exercice.Id)] = ExportedExercice{
|
||||
exercice.Title,
|
||||
exercice.URLId,
|
||||
exercice.Gain,
|
||||
exercice.Coefficient,
|
||||
exercice.SolvedCount(),
|
||||
|
|
@ -40,6 +43,7 @@ func ExportThemes() (interface{}, error) {
|
|||
}
|
||||
ret[fmt.Sprintf("%d", theme.Id)] = exportedTheme{
|
||||
theme.Name,
|
||||
theme.URLId,
|
||||
theme.Authors,
|
||||
theme.Intro,
|
||||
exos,
|
||||
|
|
|
|||
Reference in a new issue