diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-11 14:17:05 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-11 14:17:05 +0800 |
commit | b5cc4078a9c3f11f37f4d01f77428a5dc226baa4 (patch) | |
tree | 81010e14074f24336fe7b8ba7bc69933a9cc4a33 /routers | |
parent | fdc4151ff3f97df69788c69f8136b1c1be49b29f (diff) | |
download | gitea-b5cc4078a9c3f11f37f4d01f77428a5dc226baa4.tar.gz gitea-b5cc4078a9c3f11f37f4d01f77428a5dc226baa4.zip |
add repo list of dashboard
Diffstat (limited to 'routers')
-rw-r--r-- | routers/user/user.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/routers/user/user.go b/routers/user/user.go index ca9dddaecd..7a58ba57fb 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -20,6 +20,14 @@ import ( func Dashboard(r render.Render, data base.TmplData, session sessions.Session) { data["Title"] = "Dashboard" data["PageIsUserDashboard"] = true + repos, err := models.GetRepositories(&models.User{Id: auth.SignedInId(session)}) + if err != nil { + data["ErrorMsg"] = err + log.Error("dashboard: %v", err) + r.HTML(200, "base/error", data) + return + } + data["MyRepos"] = repos r.HTML(200, "user/dashboard", data) } @@ -133,7 +141,7 @@ func SignUp(form auth.RegisterForm, data base.TmplData, req *http.Request, r ren } // TODO: unfinished -func Delete(data base.TmplData, req *http.Request, r render.Render) { +func Delete(data base.TmplData, req *http.Request, session sessions.Session, r render.Render) { data["Title"] = "Delete Account" if req.Method == "GET" { @@ -141,7 +149,8 @@ func Delete(data base.TmplData, req *http.Request, r render.Render) { return } - u := &models.User{} + id := auth.SignedInId(session) + u := &models.User{Id: id} err := models.DeleteUser(u) data["ErrorMsg"] = err log.Error("user.Delete: %v", data) |