From 854b52c01dd4b2f850bd117dff5d9aecc31f3091 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Mon, 3 Apr 2023 18:25:20 +0200 Subject: [PATCH 01/16] Show visibility status of email in own profile I've heard many reports of users getting scared when they see their own email address for their own profile, as they believe that the email field is also visible to other users. Currently, using Incognito mode or going over the Settings is the only "reasonable" way to verify this from the perspective of the user. A lock indicator should be enough to indicate otherwise. A globe icon is used if the email address is public. --- templates/user/profile.tmpl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index d4a0f4a3ac8ed..1beb42cfabeca 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -30,12 +30,17 @@ {{if .Owner.Location}}
  • {{svg "octicon-location"}} {{.Owner.Location}}
  • {{end}} - {{if .ShowUserEmail}} -
  • - {{svg "octicon-mail"}} - {{.Owner.Email}} -
  • - {{end}} +
  • + {{svg "octicon-mail"}} + {{if (eq .SignedUserName .Owner.Name)}} + {{if .Owner.KeepEmailPrivate}} + {{svg "octicon-lock"}} + {{else}} + {{svg "octicon-globe"}} + {{end}} + {{end}} + {{.Owner.Email}} +
  • {{if .Owner.Website}}
  • {{svg "octicon-link"}} From 0b896bce8c99d234b987342dcde67822aa3e7b64 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Mon, 3 Apr 2023 21:13:12 +0200 Subject: [PATCH 02/16] Move icon to the right side of email address --- templates/user/profile.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 1beb42cfabeca..4e7a5c0548c92 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -32,6 +32,7 @@ {{end}}
  • {{svg "octicon-mail"}} + {{.Owner.Email}} {{if (eq .SignedUserName .Owner.Name)}} {{if .Owner.KeepEmailPrivate}} {{svg "octicon-lock"}} @@ -39,7 +40,6 @@ {{svg "octicon-globe"}} {{end}} {{end}} - {{.Owner.Email}}
  • {{if .Owner.Website}}
  • From 11e5e087f62a38c06b1f78a19d96abbdd5ebec8e Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Mon, 3 Apr 2023 23:10:31 +0200 Subject: [PATCH 03/16] Fix logic errors (?), add hints, add hyperlink --- options/locale/locale_en-US.ini | 2 ++ templates/user/profile.tmpl | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 5834703556c29..ef30c31c8c695 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -548,6 +548,8 @@ unfollow = Unfollow heatmap.loading = Loading Heatmap… user_bio = Biography disabled_public_activity = This user has disabled the public visibility of the activity. +email_visibility.public = Your email address is visible to everyone. +email_visibility.private = Your email address is only visible to you and your instance's administrators. form.name_reserved = The username '%s' is reserved. form.name_pattern_not_allowed = The pattern '%s' is not allowed in a username. diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 4e7a5c0548c92..1ade497b51635 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -31,13 +31,24 @@
  • {{svg "octicon-location"}} {{.Owner.Location}}
  • {{end}}
  • - {{svg "octicon-mail"}} - {{.Owner.Email}} {{if (eq .SignedUserName .Owner.Name)}} - {{if .Owner.KeepEmailPrivate}} - {{svg "octicon-lock"}} - {{else}} - {{svg "octicon-globe"}} + {{svg "octicon-mail"}} + {{.Owner.Email}} + + {{if .Owner.KeepEmailPrivate}} + + {{svg "octicon-lock"}} + + {{else}} + + {{svg "octicon-globe"}} + + {{end}} + + {{else}} + {{if .ShowUserEmail}} + {{svg "octicon-mail"}} + {{.Owner.Email}} {{end}} {{end}}
  • From 3ab86d7c8d4d17fa82c5e8ff6008fea4e03bf308 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Mon, 3 Apr 2023 23:16:11 +0200 Subject: [PATCH 04/16] Improve English --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index ef30c31c8c695..0a8fef1a756e9 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -548,7 +548,7 @@ unfollow = Unfollow heatmap.loading = Loading Heatmap… user_bio = Biography disabled_public_activity = This user has disabled the public visibility of the activity. -email_visibility.public = Your email address is visible to everyone. +email_visibility.public = Your email address is publicly visible. email_visibility.private = Your email address is only visible to you and your instance's administrators. form.name_reserved = The username '%s' is reserved. From 581ba7c2714dc54837666b5a84f4ebdb346a8ce8 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Mon, 3 Apr 2023 23:35:05 +0200 Subject: [PATCH 05/16] Formatting changes --- templates/user/profile.tmpl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 1ade497b51635..41cd2a8b5a35c 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -30,8 +30,8 @@ {{if .Owner.Location}}
  • {{svg "octicon-location"}} {{.Owner.Location}}
  • {{end}} -
  • - {{if (eq .SignedUserName .Owner.Name)}} + {{if (eq .SignedUserName .Owner.Name)}} +
  • {{svg "octicon-mail"}} {{.Owner.Email}} @@ -45,13 +45,15 @@ {{end}} - {{else}} - {{if .ShowUserEmail}} +
  • + {{else}} + {{if .ShowUserEmail}} +
  • {{svg "octicon-mail"}} {{.Owner.Email}} - {{end}} +
  • {{end}} - + {{end}} {{if .Owner.Website}}
  • {{svg "octicon-link"}} From 209302198cb202c33fc8cb59adb74a7863ed4570 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Tue, 4 Apr 2023 00:07:04 +0200 Subject: [PATCH 06/16] Make hints more consistent with user setting hints --- options/locale/locale_en-US.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 0a8fef1a756e9..e4c385c200cf2 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -548,8 +548,8 @@ unfollow = Unfollow heatmap.loading = Loading Heatmap… user_bio = Biography disabled_public_activity = This user has disabled the public visibility of the activity. -email_visibility.public = Your email address is publicly visible. -email_visibility.private = Your email address is only visible to you and your instance's administrators. +email_visibility.public = Your email address is publicly visible +email_visibility.private = Your email address is only visible for you and the admins form.name_reserved = The username '%s' is reserved. form.name_pattern_not_allowed = The pattern '%s' is not allowed in a username. From 16f85da01a9113deff5ebf40328d25eee5728f72 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Tue, 4 Apr 2023 00:08:40 +0200 Subject: [PATCH 07/16] Extra: Make hint in Profile Settings more consistent --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index e4c385c200cf2..a3f034879853c 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -663,7 +663,7 @@ add_email_success = The new email address has been added. email_preference_set_success = Email preference has been set successfully. add_openid_success = The new OpenID address has been added. keep_email_private = Hide Email Address -keep_email_private_popup = Your email address will be hidden from other users. +keep_email_private_popup = Makes your email address visible only for you and the admins openid_desc = OpenID lets you delegate authentication to an external provider. manage_ssh_keys = Manage SSH Keys From fbfc9c600e7519ff7b967bd772721b36ca30a36c Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Tue, 4 Apr 2023 00:23:52 +0200 Subject: [PATCH 08/16] Use .ShowUserEmail consistently --- templates/user/profile.tmpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 41cd2a8b5a35c..1ae53be228b88 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -35,14 +35,14 @@ {{svg "octicon-mail"}} {{.Owner.Email}} - {{if .Owner.KeepEmailPrivate}} - - {{svg "octicon-lock"}} - - {{else}} + {{if .ShowUserEmail}} {{svg "octicon-globe"}} + {{else}} + + {{svg "octicon-lock"}} + {{end}}
  • From 62365600eb8b5d5a7d3bdb2e82a1a89f80913707 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Tue, 4 Apr 2023 00:42:17 +0200 Subject: [PATCH 09/16] Make string more accurate --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index a3f034879853c..b389c8b42b1a1 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -548,7 +548,7 @@ unfollow = Unfollow heatmap.loading = Loading Heatmap… user_bio = Biography disabled_public_activity = This user has disabled the public visibility of the activity. -email_visibility.public = Your email address is publicly visible +email_visibility.public = Your email address is visible to all users email_visibility.private = Your email address is only visible for you and the admins form.name_reserved = The username '%s' is reserved. From 8dadb818b42aa40965a3b408b660b12045e8015c Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Tue, 4 Apr 2023 00:46:47 +0200 Subject: [PATCH 10/16] Make icon right-aligned Based on feedback from a very nice friend --- templates/user/profile.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 1ae53be228b88..b43b5e83c2605 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -36,11 +36,11 @@ {{.Owner.Email}} {{if .ShowUserEmail}} - + {{svg "octicon-globe"}} {{else}} - + {{svg "octicon-lock"}} {{end}} From f2b17e84cc5527f9559600a1687b52ddcddd09e0 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Tue, 4 Apr 2023 00:53:03 +0200 Subject: [PATCH 11/16] Replace Globe with Unlock icon --- options/locale/locale_en-US.ini | 2 +- templates/user/profile.tmpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index b389c8b42b1a1..95c5ff1d2cfa7 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -548,7 +548,7 @@ unfollow = Unfollow heatmap.loading = Loading Heatmap… user_bio = Biography disabled_public_activity = This user has disabled the public visibility of the activity. -email_visibility.public = Your email address is visible to all users +email_visibility.all_users = Your email address is visible to all users email_visibility.private = Your email address is only visible for you and the admins form.name_reserved = The username '%s' is reserved. diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index b43b5e83c2605..15c49608e037b 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -36,8 +36,8 @@ {{.Owner.Email}} {{if .ShowUserEmail}} - - {{svg "octicon-globe"}} + + {{svg "octicon-unlock"}} {{else}} From bcb84c3bf978b014699bc37e47876909cabb18fe Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Tue, 4 Apr 2023 00:57:00 +0200 Subject: [PATCH 12/16] Use 'Limited' keyword consistently --- templates/user/profile.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 15c49608e037b..e0e05575fa03b 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -36,7 +36,7 @@ {{.Owner.Email}} {{if .ShowUserEmail}} - + {{svg "octicon-unlock"}} {{else}} From 0fda639f880a871d38fbe2445e9a451167748a9f Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Tue, 4 Apr 2023 01:12:08 +0200 Subject: [PATCH 13/16] Prefer 'authenticated' over 'logged in' --- options/locale/locale_en-US.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 95c5ff1d2cfa7..f79f5bcbe46e7 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -548,7 +548,7 @@ unfollow = Unfollow heatmap.loading = Loading Heatmap… user_bio = Biography disabled_public_activity = This user has disabled the public visibility of the activity. -email_visibility.all_users = Your email address is visible to all users +email_visibility.limited = Your email address is visible to all authenticated users email_visibility.private = Your email address is only visible for you and the admins form.name_reserved = The username '%s' is reserved. @@ -844,9 +844,9 @@ email_notifications.andyourown = And Your Own Notifications visibility = User visibility visibility.public = Public -visibility.public_tooltip = Visible to all users +visibility.public_tooltip = Visible to everyone visibility.limited = Limited -visibility.limited_tooltip = Visible to logged in users only +visibility.limited_tooltip = Visible to authenticated users only visibility.private = Private visibility.private_tooltip = Visible only to organization members @@ -2421,7 +2421,7 @@ settings.permission = Permissions settings.repoadminchangeteam = Repository admin can add and remove access for teams settings.visibility = Visibility settings.visibility.public = Public -settings.visibility.limited = Limited (Visible to logged in users only) +settings.visibility.limited = Limited (Visible to authenticated users only) settings.visibility.limited_shortname = Limited settings.visibility.private = Private (Visible only to organization members) settings.visibility.private_shortname = Private From a47057f9b8b71e2b0f4337bb4c70eb4ee9e489f4 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 6 Apr 2023 09:23:06 +0200 Subject: [PATCH 14/16] Update options/locale/locale_en-US.ini --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index f79f5bcbe46e7..b501f21754009 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -663,7 +663,7 @@ add_email_success = The new email address has been added. email_preference_set_success = Email preference has been set successfully. add_openid_success = The new OpenID address has been added. keep_email_private = Hide Email Address -keep_email_private_popup = Makes your email address visible only for you and the admins +keep_email_private_popup = Your email address will only be visible to you and the administrators openid_desc = OpenID lets you delegate authentication to an external provider. manage_ssh_keys = Manage SSH Keys From d4f24a9d40818c8d4599576b5ad34c5f2d75bcdb Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Fri, 7 Apr 2023 09:34:34 +0200 Subject: [PATCH 15/16] Fix tests (?), improve comments --- tests/integration/setting_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/integration/setting_test.go b/tests/integration/setting_test.go index 54819c5b7d788..1941559ba87d2 100644 --- a/tests/integration/setting_test.go +++ b/tests/integration/setting_test.go @@ -50,42 +50,42 @@ func TestSettingShowUserEmailProfile(t *testing.T) { setting.UI.ShowUserEmail = true - // user1 can see self + // user1 can see own visible 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") - // user1 can not see user2 + // user1 can not see user2's hidden email req = NewRequest(t, "GET", "/user2") resp = session.MakeRequest(t, req, http.StatusOK) htmlDoc = NewHTMLParser(t, resp.Body) - // Should not contain even if the user visits their own profile page + // Should only contain if the user visits their own profile page assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com") - // user2 can see user1 + // user2 can see user1's visible email session = loginUser(t, "user2") 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") - // user2 can not see self + // user2 can 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.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com") + assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com") setting.UI.ShowUserEmail = false - // user1 can not see self + // user1 can 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.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com") + assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com") setting.UI.ShowUserEmail = showUserEmail } From 81174623d134315a97193b432da48971e62f8379 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 8 Apr 2023 11:17:37 +0200 Subject: [PATCH 16/16] Update options/locale/locale_en-US.ini --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 9ae742cc19c05..d8693ee9dfa29 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -549,7 +549,7 @@ heatmap.loading = Loading Heatmap… 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 for you and the admins +email_visibility.private = Your email address is only visible to you and administrators form.name_reserved = The username '%s' is reserved. form.name_pattern_not_allowed = The pattern '%s' is not allowed in a username.