|
|
|
@ -17,6 +17,7 @@ import ( |
|
|
|
|
"code.gitea.io/gitea/models/db" |
|
|
|
|
"code.gitea.io/gitea/models/organization" |
|
|
|
|
repo_model "code.gitea.io/gitea/models/repo" |
|
|
|
|
system_model "code.gitea.io/gitea/models/system" |
|
|
|
|
user_model "code.gitea.io/gitea/models/user" |
|
|
|
|
"code.gitea.io/gitea/modules/base" |
|
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
@ -43,6 +44,7 @@ func Profile(ctx *context.Context) { |
|
|
|
|
ctx.Data["Title"] = ctx.Tr("settings.profile") |
|
|
|
|
ctx.Data["PageIsSettingsProfile"] = true |
|
|
|
|
ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice() |
|
|
|
|
ctx.Data["DisableGravatar"] = system_model.GetSettingWithCacheBool(ctx, system_model.KeyPictureDisableGravatar) |
|
|
|
|
|
|
|
|
|
ctx.HTML(http.StatusOK, tplSettingsProfile) |
|
|
|
|
} |
|
|
|
@ -83,6 +85,8 @@ func ProfilePost(ctx *context.Context) { |
|
|
|
|
form := web.GetForm(ctx).(*forms.UpdateProfileForm) |
|
|
|
|
ctx.Data["Title"] = ctx.Tr("settings") |
|
|
|
|
ctx.Data["PageIsSettingsProfile"] = true |
|
|
|
|
ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice() |
|
|
|
|
ctx.Data["DisableGravatar"] = system_model.GetSettingWithCacheBool(ctx, system_model.KeyPictureDisableGravatar) |
|
|
|
|
|
|
|
|
|
if ctx.HasError() { |
|
|
|
|
ctx.HTML(http.StatusOK, tplSettingsProfile) |
|
|
|
|