diff options
| author | rtz12 <koenig@fagott.pw> | 2015-12-22 21:30:55 (UTC) |
|---|---|---|
| committer | rtz12 <koenig@fagott.pw> | 2015-12-22 21:30:55 (UTC) |
| commit | 213a8d2e3ba4fcaff0b750bd493bf8f94f21dd31 (patch) | |
| tree | 16e02d775af1052d40f4658bd8865daff9097180 /dashboard.go | |
| parent | 9907271d4fddee0bafbba0d534a2c041156034a8 (diff) | |
| parent | 9e6b06475dc6c878dee0c116fc48b9f8130d3ae1 (diff) | |
Merge branch 'master' of projekte.fagott.pw:grilist
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 | } |
