aboutsummaryrefslogtreecommitdiff
path: root/dashboard.go
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2015-12-21 22:29:10 (UTC)
committerjan <jan@ruken.pw>2015-12-21 22:29:10 (UTC)
commit4254929eea29a42896fd57185d6f52fdc3efdca4 (patch)
tree9e8dc1f456ef20c4308d193be5db4114e976577a /dashboard.go
parentc3e905c2698f6eb44e291eeb6b180b13755b7705 (diff)
dashboard. FUCKING DASHBOARD!
Diffstat (limited to 'dashboard.go')
-rw-r--r--dashboard.go28
1 files changed, 27 insertions, 1 deletions
diff --git a/dashboard.go b/dashboard.go
index 221e923..aa6405c 100644
--- a/dashboard.go
+++ b/dashboard.go
@@ -1,3 +1,29 @@
1package main 1package main
2 2
3import () 3import (
4 "net/http"
5 "fagott.pw/grilist/grilist"
6 "github.com/julienschmidt/httprouter"
7)
8
9func viewDashboard(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
10 user, err := app.Charakterin.GetUserFromRequest(r)
11 if err != nil {
12 http.Redirect(w, r, "/", 302)
13 return
14 }
15
16 var categories []grilist.DashboardCategory
17
18 for _, module := range app.Modules {
19 category := module.ProvideDashboardData(user)
20
21 if len(category.Cards) > 0 {
22 categories = append(categories, category)
23 }
24 }
25
26 data := make(map[string]interface{})
27 data["categories"] = categories
28 app.Renderer.RenderPage("dashboard", w, data)
29} \ No newline at end of file