diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 9148d57a27..009be75dd7 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -676,7 +676,6 @@ unblock = Unblock user_bio = Biography disabled_public_activity = This user has disabled the public visibility of the activity. email_visibility.limited = Your email address is visible to all authenticated users -email_visibility.private = Your email address is only visible to you and administrators show_on_map = Show this place on a map settings = User settings diff --git a/templates/shared/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl index 95277e2f78..a173424eb1 100644 --- a/templates/shared/user/profile_big_avatar.tmpl +++ b/templates/shared/user/profile_big_avatar.tmpl @@ -38,29 +38,18 @@ {{end}} {{end}} - {{if (eq .SignedUserID .ContextUser.ID)}} -
  • - {{svg "octicon-mail"}} - {{.ContextUser.Email}} - - {{if .ShowUserEmail}} - - {{svg "octicon-unlock"}} - - {{else}} - - {{svg "octicon-lock"}} - - {{end}} - -
  • - {{else}} - {{if .ShowUserEmail}} + {{if .ShowUserEmail}}
  • {{svg "octicon-mail"}} - {{.ContextUser.Email}} + {{.ContextUser.Email}} + {{if (eq .SignedUserID .ContextUser.ID)}} + + + {{svg "octicon-unlock"}} + + + {{end}}
  • - {{end}} {{end}} {{if .ContextUser.Website}}
  • diff --git a/tests/integration/setting_test.go b/tests/integration/setting_test.go index 283070ec8e..a82a8afef1 100644 --- a/tests/integration/setting_test.go +++ b/tests/integration/setting_test.go @@ -75,21 +75,21 @@ func TestSettingShowUserEmailProfile(t *testing.T) { htmlDoc = NewHTMLParser(t, resp.Body) assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com") - // user2 can see own hidden email + // user2 cannot see own hidden email session = loginUser(t, "user2") req = NewRequest(t, "GET", "/user2") resp = session.MakeRequest(t, req, http.StatusOK) htmlDoc = NewHTMLParser(t, resp.Body) - assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com") + assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com") setting.UI.ShowUserEmail = false - // user1 can see own (now hidden) email + // user1 cannot see own (now hidden) email session = loginUser(t, "user1") req = NewRequest(t, "GET", "/user1") resp = session.MakeRequest(t, req, http.StatusOK) htmlDoc = NewHTMLParser(t, resp.Body) - assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com") + assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com") setting.UI.ShowUserEmail = showUserEmail }