Trying a different approach to providing frontend settings

This commit is contained in:
Torkel Ödegaard
2014-12-28 18:37:39 +01:00
parent a55a606a55
commit f3132b4513
4 changed files with 72 additions and 3 deletions

View File

@ -54,7 +54,14 @@ func Register(m *macaron.Macaron) {
}
func Index(ctx *middleware.Context) {
ctx.Data["User"] = dtos.NewCurrentUser(ctx.UserAccount)
settings, err := getFrontendSettings(ctx.GetAccountId())
if err != nil {
ctx.Handle(500, "Failed to get settings", err)
return
}
ctx.Data["user"] = dtos.NewCurrentUser(ctx.UserAccount)
ctx.Data["settings"] = settings
ctx.HTML(200, "index")
}