mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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
This commit is contained in:
committed by
Bo-Yi Wu
parent
976c2a05fa
commit
62f600cf1c
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user