diff options
author | Rémy Boulanouar <rboulanouar@gmail.com> | 2017-06-02 10:43:44 +0200 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-06-02 03:43:44 -0500 |
commit | 62f600cf1ca5ffe029e470644839ea39283bf023 (patch) | |
tree | b2de4dda4c42354b2f0452c17c00084f89fd8912 /routers/user | |
parent | 976c2a05fafcecc454634206f9072f3ae23bc055 (diff) | |
download | gitea-62f600cf1ca5ffe029e470644839ea39283bf023.tar.gz gitea-62f600cf1ca5ffe029e470644839ea39283bf023.zip |
Display all organization from user settings (#1739)
* Display all organization from user settings
* fix Tab selection
* Update locale_en-US.ini
* Add a condition for display Create organization button
* Remove french translation
* Remove unnecessary admin flag
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/setting.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go index 8fa9834167..f0cb9e7843 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -38,6 +38,7 @@ const ( tplSettingsTwofa base.TplName = "user/settings/twofa" tplSettingsTwofaEnroll base.TplName = "user/settings/twofa_enroll" tplSettingsAccountLink base.TplName = "user/settings/account_link" + tplSettingsOrganization base.TplName = "user/settings/organization" tplSettingsDelete base.TplName = "user/settings/delete" tplSecurity base.TplName = "user/security" ) @@ -771,3 +772,16 @@ func SettingsDelete(ctx *context.Context) { ctx.HTML(200, tplSettingsDelete) } + +// SettingsOrganization render all the organization of the user +func SettingsOrganization(ctx *context.Context) { + ctx.Data["Title"] = ctx.Tr("settings") + ctx.Data["PageIsSettingsOrganization"] = true + orgs, err := models.GetOrgsByUserID(ctx.User.ID, ctx.IsSigned) + if err != nil { + ctx.Handle(500, "GetOrgsByUserID", err) + return + } + ctx.Data["Orgs"] = orgs + ctx.HTML(200, tplSettingsOrganization) +} |