diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-07-26 02:28:04 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-07-26 02:28:04 -0400 |
commit | 5c4bc3c848fb4bd46ad5ceeacd82cdfa8f2b5635 (patch) | |
tree | 213666141efaf773c4411d41482387f1250068f8 /routers/user | |
parent | 3f38ff6c09f0497980ad13fda9803907cee6d612 (diff) | |
download | gitea-5c4bc3c848fb4bd46ad5ceeacd82cdfa8f2b5635.tar.gz gitea-5c4bc3c848fb4bd46ad5ceeacd82cdfa8f2b5635.zip |
Huge updates!!!!! Be careful to merge!!!!
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/home.go | 23 | ||||
-rw-r--r-- | routers/user/setting.go | 8 |
2 files changed, 21 insertions, 10 deletions
diff --git a/routers/user/home.go b/routers/user/home.go index 16e88a9427..b5a789ae0e 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -28,11 +28,11 @@ func Dashboard(ctx *middleware.Context) { ctx.Data["PageIsDashboard"] = true ctx.Data["PageIsNews"] = true - // if err := ctx.User.GetOrganizations(); err != nil { - // ctx.Handle(500, "home.Dashboard(GetOrganizations)", err) - // return - // } - // ctx.Data["Orgs"] = ctx.User.Orgs + if err := ctx.User.GetOrganizations(); err != nil { + ctx.Handle(500, "home.Dashboard(GetOrganizations)", err) + return + } + ctx.Data["Orgs"] = ctx.User.Orgs ctx.Data["ContextUser"] = ctx.User repos, err := models.GetRepositories(ctx.User.Id, true) @@ -40,13 +40,16 @@ func Dashboard(ctx *middleware.Context) { ctx.Handle(500, "GetRepositories", err) return } + for _, repo := range repos { + repo.Owner = ctx.User + } ctx.Data["Repos"] = repos - // ctx.Data["CollaborativeRepos"], err = models.GetCollaborativeRepos(ctx.User.Name) - // if err != nil { - // ctx.Handle(500, "home.Dashboard(GetCollaborativeRepos)", err) - // return - // } + ctx.Data["CollaborativeRepos"], err = models.GetCollaborativeRepos(ctx.User.Name) + if err != nil { + ctx.Handle(500, "GetCollaborativeRepos", err) + return + } actions, err := models.GetFeeds(ctx.User.Id, 0, true) if err != nil { diff --git a/routers/user/setting.go b/routers/user/setting.go index e4d6ff9ce7..761052144f 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -19,6 +19,7 @@ const ( SETTINGS_PASSWORD base.TplName = "user/settings/password" SETTINGS_SSH_KEYS base.TplName = "user/settings/sshkeys" SETTINGS_SOCIAL base.TplName = "user/settings/social" + SETTINGS_ORGS base.TplName = "user/settings/orgs" SETTINGS_DELETE base.TplName = "user/settings/delete" NOTIFICATION base.TplName = "user/notification" SECURITY base.TplName = "user/security" @@ -232,6 +233,13 @@ func SettingsSocial(ctx *middleware.Context) { ctx.HTML(200, SETTINGS_SOCIAL) } +func SettingsOrgs(ctx *middleware.Context) { + ctx.Data["Title"] = ctx.Tr("settings") + ctx.Data["PageIsUserSettings"] = true + ctx.Data["PageIsSettingsOrgs"] = true + ctx.HTML(200, SETTINGS_ORGS) +} + func SettingsDelete(ctx *middleware.Context) { ctx.Data["Title"] = ctx.Tr("settings") ctx.Data["PageIsUserSettings"] = true |