diff options
author | qwerty287 <80460567+qwerty287@users.noreply.github.com> | 2021-10-27 17:40:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-27 23:40:08 +0800 |
commit | 01fc24c78c6108540a3267b41ac113fd8bde23e1 (patch) | |
tree | 5bd1117f2bba15d2465a75168017b09e1c2ef7b7 /services/forms | |
parent | 89beceeb9ace8b61223d55b389541bba19578b42 (diff) | |
download | gitea-01fc24c78c6108540a3267b41ac113fd8bde23e1.tar.gz gitea-01fc24c78c6108540a3267b41ac113fd8bde23e1.zip |
Add appearance section in settings (#17433)
* Add appearance section in settings
* Fix lint
* Fix lint
* Apply suggestions from code review
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'services/forms')
-rw-r--r-- | services/forms/user_form.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/services/forms/user_form.go b/services/forms/user_form.go index 241ebdc0d9..9f86bf6166 100644 --- a/services/forms/user_form.go +++ b/services/forms/user_form.go @@ -240,7 +240,6 @@ type UpdateProfileForm struct { KeepEmailPrivate bool Website string `binding:"ValidSiteUrl;MaxSize(255)"` Location string `binding:"MaxSize(50)"` - Language string Description string `binding:"MaxSize(255)"` Visibility structs.VisibleType KeepActivityPrivate bool @@ -252,6 +251,17 @@ func (f *UpdateProfileForm) Validate(req *http.Request, errs binding.Errors) bin return middleware.Validate(errs, ctx.Data, f, ctx.Locale) } +// UpdateLanguageForm form for updating profile +type UpdateLanguageForm struct { + Language string +} + +// Validate validates the fields +func (f *UpdateLanguageForm) Validate(req *http.Request, errs binding.Errors) binding.Errors { + ctx := context.GetContext(req) + return middleware.Validate(errs, ctx.Data, f, ctx.Locale) +} + // Avatar types const ( AvatarLocal string = "local" |