diff options
| author | jan <jan@ruken.pw> | 2015-12-22 18:01:08 (UTC) |
|---|---|---|
| committer | jan <jan@ruken.pw> | 2015-12-22 18:01:08 (UTC) |
| commit | f239fc2678f2f4e458cf10a4ab30d54acc5b92c2 (patch) | |
| tree | 059c8593e91257eeb39a049a7b8e47df8ba4638d /dashboard.go | |
| parent | 50d50d37809fef22b08c0b260302a5e96ad35694 (diff) | |
mehr cleanup, neue Listen anzeigen auf dem Dashboard
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 | } |
