admin: Add /exercices pages to get all exercices of a theme

This commit is contained in:
nemunaire 2016-01-22 17:35:29 +01:00
parent c9e4d3e27c
commit ad6199269b

View File

@ -84,7 +84,15 @@ func listTheme(args []string, body []byte) (interface{}, error) {
}
}
} else if len(args) == 2 {
return getExercice(args)
if args[1] == "exercices" {
if theme, err := getTheme(args); err != nil {
return nil, err
} else {
return theme.GetExercices()
}
} else {
return getExercice(args)
}
} else if len(args) == 1 {
if args[0] == "themes.json" {
return exportThemes()