Skip to content

Commit c004052

Browse files
committed
allow users to hide/show email address (closes gogs#3358)
* add ShowEmail bool to User model * add show/hide email checkbox on user profile settings form * add show/hide email checkbox on admin edit user form * add ShowEmail to user profile settings post handler * add ShowEmail to admin edit user post handler * show/hide emails on user profile and users directory per User.ShowEmail * add en/US translation for 'show_email'
1 parent cb5b836 commit c004052

File tree

8 files changed

+715
-930
lines changed

8 files changed

+715
-930
lines changed

modules/auth/admin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type AdminEditUserForm struct {
2828
LoginName string
2929
FullName string `binding:"MaxSize(100)"`
3030
Email string `binding:"Required;Email;MaxSize(254)"`
31+
ShowEmail bool
3132
Password string `binding:"MaxSize(255)"`
3233
Website string `binding:"MaxSize(50)"`
3334
Location string `binding:"MaxSize(50)"`

modules/auth/user_form.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ type UpdateProfileForm struct {
9191
Name string `binding:"OmitEmpty;MaxSize(35)"`
9292
FullName string `binding:"MaxSize(100)"`
9393
Email string `binding:"Required;Email;MaxSize(254)"`
94-
ShowEmail bool `form:"showemail"`
94+
ShowEmail bool
9595
Website string `binding:"Url;MaxSize(100)"`
9696
Location string `binding:"MaxSize(50)"`
9797
Gravatar string `binding:"OmitEmpty;Email;MaxSize(254)"`

0 commit comments

Comments
 (0)