summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/routes/routes.go1
-rw-r--r--routers/user/setting.go14
2 files changed, 15 insertions, 0 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index 0781aef89d..ecb95e3785 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -223,6 +223,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/applications/delete", user.SettingsDeleteApplication)
m.Route("/delete", "GET,POST", user.SettingsDelete)
m.Combo("/account_link").Get(user.SettingsAccountLinks).Post(user.SettingsDeleteAccountLink)
+ m.Get("/organization", user.SettingsOrganization)
m.Group("/two_factor", func() {
m.Get("", user.SettingsTwoFactor)
m.Post("/regenerate_scratch", user.SettingsTwoFactorRegenerateScratch)
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)
+}