diff options
Diffstat (limited to 'dashboard.go')
-rw-r--r-- | dashboard.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dashboard.go b/dashboard.go index aa6405c..6e81d6b 100644 --- a/dashboard.go +++ b/dashboard.go | |||
@@ -1,9 +1,9 @@ | |||
1 | package main | 1 | package main |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "net/http" | ||
5 | "fagott.pw/grilist/grilist" | 4 | "fagott.pw/grilist/grilist" |
6 | "github.com/julienschmidt/httprouter" | 5 | "github.com/julienschmidt/httprouter" |
6 | "net/http" | ||
7 | ) | 7 | ) |
8 | 8 | ||
9 | func viewDashboard(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { | 9 | func viewDashboard(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { |
@@ -12,18 +12,18 @@ func viewDashboard(w http.ResponseWriter, r *http.Request, _ httprouter.Params) | |||
12 | http.Redirect(w, r, "/", 302) | 12 | http.Redirect(w, r, "/", 302) |
13 | return | 13 | return |
14 | } | 14 | } |
15 | 15 | ||
16 | var categories []grilist.DashboardCategory | 16 | var categories []grilist.DashboardCategory |
17 | 17 | ||
18 | for _, module := range app.Modules { | 18 | for _, module := range app.Modules { |
19 | category := module.ProvideDashboardData(user) | 19 | for _, category := range module.ProvideDashboardData(user) { |
20 | 20 | if len(category.Cards) > 0 { | |
21 | if len(category.Cards) > 0 { | 21 | categories = append(categories, category) |
22 | categories = append(categories, category) | 22 | } |
23 | } | 23 | } |
24 | } | 24 | } |
25 | 25 | ||
26 | data := make(map[string]interface{}) | 26 | data := make(map[string]interface{}) |
27 | data["categories"] = categories | 27 | data["categories"] = categories |
28 | app.Renderer.RenderPage("dashboard", w, data) | 28 | app.Renderer.RenderPage("dashboard", w, data) |
29 | } \ No newline at end of file | 29 | } |