diff options
author | oscar.lofwenhamn <44643697+oscarlofwenhamn@users.noreply.github.com> | 2019-03-27 23:22:39 +0100 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-03-27 18:22:39 -0400 |
commit | 2019983e77895b4e41724bfa3297f5dd730ff37d (patch) | |
tree | 92d6d24812cd150f34d44425551d51bd1a9cc815 /templates | |
parent | ee0d3eeadc7d563e4ffe87d51becf5a2e6be4e69 (diff) | |
download | gitea-2019983e77895b4e41724bfa3297f5dd730ff37d.tar.gz gitea-2019983e77895b4e41724bfa3297f5dd730ff37d.zip |
Make "Ghost" not link to 404 page (#6410)
* Make Ghost not link to 404 page
* Make correct localization label show
* Create and use GetLastEventLabelFake for when a Ghost user has made the action, thus not linking to a user profile
* Add corresponding _fake entries to locale_en-US
* Make Ghost avatar not link to 404 page
* Make Ghost on milestone_issues not link to 404 page
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/list.tmpl | 7 | ||||
-rw-r--r-- | templates/repo/issue/milestone_issues.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 2 | ||||
-rw-r--r-- | templates/user/dashboard/feeds.tmpl | 6 | ||||
-rw-r--r-- | templates/user/dashboard/issues.tmpl | 6 |
5 files changed, 22 insertions, 5 deletions
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index deed251cda..78352acb50 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -220,7 +220,12 @@ <p class="desc"> {{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.Lang }} - {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.Name | Safe}} + + {{if gt .Poster.ID 0}} + {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.Name | Safe}} + {{else}} + {{$.i18n.Tr .GetLastEventLabelFake $timeStr .Poster.Name | Safe}} + {{end}} {{$tasks := .GetTasks}} {{if gt $tasks 0}} diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index f2298dfdab..c81f6adf8b 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -203,7 +203,11 @@ {{end}} <p class="desc"> - {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}} + {{if gt .Poster.ID 0}} + {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.Name | Safe}} + {{else}} + {{$.i18n.Tr .GetLastEventLabelFake $timeStr .Poster.Name | Safe}} + {{end}} {{$tasks := .GetTasks}} {{if gt $tasks 0}} {{$tasksDone := .GetTasksDone}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 47bf67f903..1f5481530a 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -112,7 +112,7 @@ <span class="text"><strong>{{.i18n.Tr "repo.issues.num_participants" .NumParticipants}}</strong></span> <div> {{range .Participants}} - <a href="{{.HomeLink}}"> + <a {{if gt .ID 0}}href="{{.HomeLink}}"{{end}}> <img class="ui avatar image poping up" src="{{.RelAvatarLink}}" data-content="{{.DisplayName}}" data-position="top center" data-variation="small inverted"> </a> {{end}} diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 849ad7fb2f..ffc0db3317 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -7,7 +7,11 @@ <div class="ui fourteen wide column"> <div class="{{if or (eq .GetOpType 5) (eq .GetOpType 18)}}push news{{end}}"> <p> - <a href="{{AppSubUrl}}/{{.GetActUserName}}" title="{{.GetActFullName}}">{{.ShortActUserName}}</a> + {{if gt .ActUser.ID 0}} + <a href="{{AppSubUrl}}/{{.GetActUserName}}" title="{{.GetActFullName}}">{{.ShortActUserName}}</a> + {{else}} + {{.ShortActUserName}} + {{end}} {{if eq .GetOpType 1}} {{$.i18n.Tr "action.create_repo" .GetRepoLink .ShortRepoPath | Str2html}} {{else if eq .GetOpType 2}} diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index b5990e61e0..93286df578 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -86,7 +86,11 @@ {{end}} <p class="desc"> - {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}} + {{if gt .Poster.ID 0}} + {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.Name | Safe}} + {{else}} + {{$.i18n.Tr .GetLastEventLabelFake $timeStr .Poster.Name | Safe}} + {{end}} {{if .Assignee}} <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center"> <img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}"> |