Skip to content

Commit 2f0a1eb

Browse files
authored
Do not add links to Posters or Assignees with ID < 0 (#20577) (#21037)
Backport #20577 There are several places in templates/repo/issue/view_content/comments.tmpl where links are made to Posters or Assignees who are Ghosts or have IDs <0. Fix #20559 Signed-off-by: Andrew Thornton <[email protected]> Signed-off-by: Andrew Thornton <[email protected]>
1 parent e3697ef commit 2f0a1eb

File tree

7 files changed

+76
-128
lines changed

7 files changed

+76
-128
lines changed

templates/org/team/teams.tmpl

+1-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
</div>
3333
<div class="ui attached segment members">
3434
{{range .Members}}
35-
<a href="{{.HomeLink}}" title="{{.Name}}">
36-
{{avatar .}}
37-
</a>
35+
{{template "shared/user/avatarlink" .}}
3836
{{end}}
3937
</div>
4038
<div class="ui bottom attached header">

templates/repo/diff/comments.tmpl

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
{{if .OriginalAuthor }}
66
<span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
77
{{else}}
8-
<a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
9-
{{avatar .Poster}}
10-
</a>
8+
{{template "shared/user/avatarlink" .Poster}}
119
{{end}}
1210
<div class="content comment-container">
1311
<div class="ui top attached header comment-header df ac sb">
@@ -27,9 +25,7 @@
2725
</span>
2826
{{else}}
2927
<span class="text grey">
30-
<a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
31-
{{.Poster.GetDisplayName}}
32-
</a>
28+
{{template "shared/user/namelink" .Poster}}
3329
{{$.root.i18n.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
3430
</span>
3531
{{end}}

templates/repo/issue/new_form.tmpl

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
<div class="twelve wide column">
99
<div class="ui comments">
1010
<div class="comment">
11-
<a class="avatar" href="{{.SignedUser.HomeLink}}">
12-
{{avatar .SignedUser}}
13-
</a>
11+
{{template "shared/user/avatarlink" .SignedUser}}
1412
<div class="ui segment content">
1513
<div class="field">
1614
<input name="title" id="issue_title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" tabindex="3" autofocus required maxlength="255" autocomplete="off">

0 commit comments

Comments
 (0)