1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Show email if the authenticated user owns the profile page being requested for (#4981)

* Show email if the authenticated user owns the profile page being
requested for.

Also removed `setting.UI.ShowUserEmail` as it's documentation says it
only controls the email setting on the explore page

* fix current user check... This prevents a panic as a user must be signed in before ctx.User is called

* fix panic in tests

* try to fix tests

* Update year

* Test CI fail

* Revert change

* User 3 is not allowed to authorize

* Set user2 email to be private

* Change to user4 in explore page as user2 now has private email option set
This commit is contained in:
Lanre Adelowo
2019-02-19 15:11:50 +01:00
committed by techknowlogick
parent ff2be17e3f
commit 094263db4d
4 changed files with 17 additions and 5 deletions

View File

@@ -22,7 +22,7 @@
{{if .Owner.Location}}
<li><i class="octicon octicon-location"></i> {{.Owner.Location}}</li>
{{end}}
{{if and $.ShowUserEmail .Owner.Email .IsSigned (not .Owner.KeepEmailPrivate)}}
{{if .ShowUserEmail }}
<li>
<i class="octicon octicon-mail"></i>
<a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a>