diff options
author | slene <vslene@gmail.com> | 2014-03-15 15:28:06 +0800 |
---|---|---|
committer | slene <vslene@gmail.com> | 2014-03-15 15:28:06 +0800 |
commit | 06deed820d9f48ecf972c8716b17ad58b91ab9b9 (patch) | |
tree | fc94500dd1dd607d1c6470f89abadcba84bbc285 /routers/user | |
parent | e251b9bbca35e01060ac3b2ee0bd836dc7719c19 (diff) | |
download | gitea-06deed820d9f48ecf972c8716b17ad58b91ab9b9.tar.gz gitea-06deed820d9f48ecf972c8716b17ad58b91ab9b9.zip |
Add HomeLink and AvatarLink to User model. Please use .SignedUser in template.
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/user.go | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/routers/user/user.go b/routers/user/user.go index 4dd9abe52a..680055f661 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -29,7 +29,7 @@ func Dashboard(r render.Render, data base.TmplData, session sessions.Session) { r.HTML(200, "user/dashboard", data) } -func Profile(params martini.Params, r render.Render, data base.TmplData, session sessions.Session) { +func Profile(params martini.Params, r render.Render, req *http.Request, data base.TmplData, session sessions.Session) { data["Title"] = "Profile" // TODO: Need to check view self or others. @@ -40,12 +40,23 @@ func Profile(params martini.Params, r render.Render, data base.TmplData, session } data["Owner"] = user - feeds, err := models.GetFeeds(user.Id, 0, true) - if err != nil { - log.Handle(200, "user.Profile", data, r, err) - return + + req.ParseForm() + tab := req.Form.Get("tab") + data["TabName"] = tab + + switch tab { + case "activity": + feeds, err := models.GetFeeds(user.Id, 0, true) + if err != nil { + log.Handle(200, "user.Profile", data, r, err) + return + } + data["Feeds"] = feeds + default: + } - data["Feeds"] = feeds + r.HTML(200, "user/profile", data) } |