Able to sync and export standalone exercices
This commit is contained in:
parent
76f830b332
commit
adb0e36dd4
15 changed files with 159 additions and 31 deletions
|
|
@ -113,13 +113,17 @@ func ExerciceHandler(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
theme, err = exercice.GetTheme()
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Unable to find the attached theme."})
|
||||
return
|
||||
}
|
||||
if exercice.IdTheme != nil {
|
||||
theme, err = exercice.GetTheme()
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Unable to find the attached theme."})
|
||||
return
|
||||
}
|
||||
|
||||
c.Set("theme", theme)
|
||||
c.Set("theme", theme)
|
||||
} else {
|
||||
c.Set("theme", &fic.Theme{Path: sync.StandaloneExercicesDirectory})
|
||||
}
|
||||
}
|
||||
|
||||
c.Set("exercice", exercice)
|
||||
|
|
|
|||
Reference in a new issue