frontend: beautiful URLs

This commit is contained in:
nemunaire 2018-01-18 11:07:50 +01:00 committed by nemunaire
commit 0c540a39eb
13 changed files with 54 additions and 31 deletions

View file

@ -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,