aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2015-12-26 10:41:42 (UTC)
committerjan <jan@ruken.pw>2015-12-26 10:41:42 (UTC)
commit6fabf512767b458a44b4b2547a7b07e9db71c00a (patch)
treea40522cc0a735d09fd79cca00c8133f41963b7ef /modules
parentfb0424cea33e1c48f940c485bff1f4d0aac31dc4 (diff)
default data im renderer, damit wir später krasse sachen machen können. es gibt jetzt eine globale navbar, damit man nicht mehr den zurückknopf drücken muss, um bis zur startseite zu kommen. ich habe einen großen D.
Diffstat (limited to 'modules')
-rw-r--r--modules/grils/grils.go9
-rw-r--r--modules/lists/lists.go9
2 files changed, 6 insertions, 12 deletions
diff --git a/modules/grils/grils.go b/modules/grils/grils.go
index fbe57e3..3663c7f 100644
--- a/modules/grils/grils.go
+++ b/modules/grils/grils.go
@@ -73,10 +73,7 @@ func (m *GrilsModule) FromID(id int) (*Gril, error) {
73} 73}
74 74
75func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprouter.Params) { 75func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
76 loggedIn := false 76 user, _ := m.g.Charakterin.GetUserFromRequest(r)
77 if user, _ := m.g.Charakterin.GetUserFromRequest(r); user != nil {
78 loggedIn = true
79 }
80 sid := p.ByName("id") 77 sid := p.ByName("id")
81 78
82 id, err := strconv.Atoi(sid) 79 id, err := strconv.Atoi(sid)
@@ -91,8 +88,8 @@ func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprou
91 return 88 return
92 } 89 }
93 90
94 data := make(map[string]interface{}) 91 data := m.g.Renderer.DefaultData()
95 data["loggedIn"] = loggedIn 92 data["user"] = user
96 data["gril"] = gril 93 data["gril"] = gril
97 94
98 m.g.Renderer.RenderPage("gril", w, data) 95 m.g.Renderer.RenderPage("gril", w, data)
diff --git a/modules/lists/lists.go b/modules/lists/lists.go
index 519bb36..970b15b 100644
--- a/modules/lists/lists.go
+++ b/modules/lists/lists.go
@@ -207,10 +207,7 @@ func (m *Module) ProvideDashboardData(user *charakterin.User) []grilist.Dashboar
207} 207}
208 208
209func (m *Module) viewList(w http.ResponseWriter, r *http.Request, p httprouter.Params) { 209func (m *Module) viewList(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
210 loggedIn := false 210 user, _ := m.g.Charakterin.GetUserFromRequest(r)
211 if user, _ := m.g.Charakterin.GetUserFromRequest(r); user != nil {
212 loggedIn = true
213 }
214 sid := p.ByName("id") 211 sid := p.ByName("id")
215 212
216 id, err := strconv.Atoi(sid) 213 id, err := strconv.Atoi(sid)
@@ -225,8 +222,8 @@ func (m *Module) viewList(w http.ResponseWriter, r *http.Request, p httprouter.P
225 return 222 return
226 } 223 }
227 224
228 data := make(map[string]interface{}) 225 data := m.g.Renderer.DefaultData()
229 data["loggedIn"] = loggedIn 226 data["user"] = user
230 data["list"] = list 227 data["list"] = list
231 228
232 m.g.Renderer.RenderPage("list", w, data) 229 m.g.Renderer.RenderPage("list", w, data)