Skip to content

Commit 854b52c

Browse files
committed
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.
1 parent 01d9466 commit 854b52c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

templates/user/profile.tmpl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,17 @@
3030
{{if .Owner.Location}}
3131
<li>{{svg "octicon-location"}} {{.Owner.Location}}</li>
3232
{{end}}
33-
{{if .ShowUserEmail}}
34-
<li>
35-
{{svg "octicon-mail"}}
36-
<a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a>
37-
</li>
38-
{{end}}
33+
<li>
34+
{{svg "octicon-mail"}}
35+
{{if (eq .SignedUserName .Owner.Name)}}
36+
{{if .Owner.KeepEmailPrivate}}
37+
{{svg "octicon-lock"}}
38+
{{else}}
39+
{{svg "octicon-globe"}}
40+
{{end}}
41+
{{end}}
42+
<a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a>
43+
</li>
3944
{{if .Owner.Website}}
4045
<li>
4146
{{svg "octicon-link"}}

0 commit comments

Comments
 (0)