mirror of
1
Fork 0

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 <art27@cantab.net>

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2022-09-03 13:51:10 +01:00 committed by GitHub
parent e3697efbb0
commit 2f0a1eb0d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 76 additions and 128 deletions

View File

@ -32,9 +32,7 @@
</div> </div>
<div class="ui attached segment members"> <div class="ui attached segment members">
{{range .Members}} {{range .Members}}
<a href="{{.HomeLink}}" title="{{.Name}}"> {{template "shared/user/avatarlink" .}}
{{avatar .}}
</a>
{{end}} {{end}}
</div> </div>
<div class="ui bottom attached header"> <div class="ui bottom attached header">

View File

@ -5,9 +5,7 @@
{{if .OriginalAuthor }} {{if .OriginalAuthor }}
<span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span> <span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
{{else}} {{else}}
<a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
{{end}} {{end}}
<div class="content comment-container"> <div class="content comment-container">
<div class="ui top attached header comment-header df ac sb"> <div class="ui top attached header comment-header df ac sb">
@ -27,9 +25,7 @@
</span> </span>
{{else}} {{else}}
<span class="text grey"> <span class="text grey">
<a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}> {{template "shared/user/namelink" .Poster}}
{{.Poster.GetDisplayName}}
</a>
{{$.root.i18n.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{$.root.i18n.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
</span> </span>
{{end}} {{end}}

View File

@ -8,9 +8,7 @@
<div class="twelve wide column"> <div class="twelve wide column">
<div class="ui comments"> <div class="ui comments">
<div class="comment"> <div class="comment">
<a class="avatar" href="{{.SignedUser.HomeLink}}"> {{template "shared/user/avatarlink" .SignedUser}}
{{avatar .SignedUser}}
</a>
<div class="ui segment content"> <div class="ui segment content">
<div class="field"> <div class="field">
<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"> <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">

View File

@ -17,7 +17,7 @@
{{if .OriginalAuthor }} {{if .OriginalAuthor }}
<span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span> <span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
{{else}} {{else}}
<a class="timeline-avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}> <a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
{{avatar .Poster}} {{avatar .Poster}}
</a> </a>
{{end}} {{end}}
@ -96,11 +96,9 @@
{{else if eq .Type 1}} {{else if eq .Type 1}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge bg-green text-white">{{svg "octicon-dot-fill"}}</span> <span class="badge bg-green text-white">{{svg "octicon-dot-fill"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{if .Issue.IsPull }} {{if .Issue.IsPull }}
{{$.i18n.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}} {{$.i18n.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}}
{{else}} {{else}}
@ -111,11 +109,9 @@
{{else if eq .Type 2}} {{else if eq .Type 2}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge bg-red text-white">{{svg "octicon-circle-slash"}}</span> <span class="badge bg-red text-white">{{svg "octicon-circle-slash"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{if .Issue.IsPull }} {{if .Issue.IsPull }}
{{$.i18n.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}} {{$.i18n.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}}
{{else}} {{else}}
@ -126,11 +122,9 @@
{{else if eq .Type 28}} {{else if eq .Type 28}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge bg-purple text-white">{{svg "octicon-git-merge"}}</span> <span class="badge bg-purple text-white">{{svg "octicon-git-merge"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$link := printf "%s/commit/%s" $.Repository.HTMLURL ($.Issue.PullRequest.MergedCommitID|PathEscape)}} {{$link := printf "%s/commit/%s" $.Repository.HTMLURL ($.Issue.PullRequest.MergedCommitID|PathEscape)}}
{{if eq $.Issue.PullRequest.Status 3}} {{if eq $.Issue.PullRequest.Status 3}}
{{$.i18n.Tr "repo.issues.manually_pull_merged_at" ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID) ($.BaseTarget|Escape) $createdStr | Str2html}} {{$.i18n.Tr "repo.issues.manually_pull_merged_at" ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID) ($.BaseTarget|Escape) $createdStr | Str2html}}
@ -155,12 +149,10 @@
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.i18n.Lang }} {{ $createdStr:= TimeSinceUnix .CreatedUnix $.i18n.Lang }}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-bookmark"}}</span> <span class="badge">{{svg "octicon-bookmark"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
{{if eq .RefAction 3}}<del>{{end}} {{if eq .RefAction 3}}<del>{{end}}
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentHTMLURL|Escape) $refFrom | Safe}} {{$.i18n.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentHTMLURL|Escape) $refFrom | Safe}}
</span> </span>
{{if eq .RefAction 3}}</del>{{end}} {{if eq .RefAction 3}}</del>{{end}}
@ -172,11 +164,9 @@
{{else if eq .Type 4}} {{else if eq .Type 4}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-bookmark"}}</span> <span class="badge">{{svg "octicon-bookmark"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}} {{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}
</span> </span>
<div class="detail"> <div class="detail">
@ -188,11 +178,9 @@
{{if or .AddedLabels .RemovedLabels}} {{if or .AddedLabels .RemovedLabels}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-tag"}}</span> <span class="badge">{{svg "octicon-tag"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{if and .AddedLabels (not .RemovedLabels)}} {{if and .AddedLabels (not .RemovedLabels)}}
{{$.i18n.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels .AddedLabels) $createdStr | Safe}} {{$.i18n.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels .AddedLabels) $createdStr | Safe}}
{{else if and (not .AddedLabels) .RemovedLabels}} {{else if and (not .AddedLabels) .RemovedLabels}}
@ -206,11 +194,9 @@
{{else if eq .Type 8}} {{else if eq .Type 8}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-milestone"}}</span> <span class="badge">{{svg "octicon-milestone"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}} {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}
</span> </span>
</div> </div>
@ -219,11 +205,9 @@
<span class="badge">{{svg "octicon-person"}}</span> <span class="badge">{{svg "octicon-person"}}</span>
{{if gt .AssigneeID 0}} {{if gt .AssigneeID 0}}
{{if .RemovedAssignee}} {{if .RemovedAssignee}}
<a href="{{.Assignee.HomeLink}}"> {{template "shared/user/avatarlink" .Assignee}}
{{avatar .Assignee}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a> <a class="author" {{if gt .Assignee.ID 0}}href="{{.Assignee.HomeLink}}"{{end}}>{{.Assignee.GetDisplayName}}</a>
{{ if eq .Poster.ID .Assignee.ID }} {{ if eq .Poster.ID .Assignee.ID }}
{{$.i18n.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
{{ else }} {{ else }}
@ -231,11 +215,9 @@
{{ end }} {{ end }}
</span> </span>
{{else}} {{else}}
<a href="{{.Assignee.HomeLink}}"> {{template "shared/user/avatarlink" .Assignee}}
{{avatar .Assignee}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a> {{template "shared/user/authorlink" .Assignee}}
{{if eq .Poster.ID .AssigneeID}} {{if eq .Poster.ID .AssigneeID}}
{{$.i18n.Tr "repo.issues.self_assign_at" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.self_assign_at" $createdStr | Safe}}
{{else}} {{else}}
@ -248,44 +230,36 @@
{{else if eq .Type 10}} {{else if eq .Type 10}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-pencil"}}</span> <span class="badge">{{svg "octicon-pencil"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji) (.NewTitle|RenderEmoji) $createdStr | Safe}} {{$.i18n.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji) (.NewTitle|RenderEmoji) $createdStr | Safe}}
</span> </span>
</div> </div>
{{else if eq .Type 11}} {{else if eq .Type 11}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-git-branch"}}</span> <span class="badge">{{svg "octicon-git-branch"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}} {{$.i18n.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}}
</span> </span>
</div> </div>
{{else if eq .Type 12}} {{else if eq .Type 12}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.start_tracking_history" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.start_tracking_history" $createdStr | Safe}}
</span> </span>
</div> </div>
{{else if eq .Type 13}} {{else if eq .Type 13}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}}
</span> </span>
{{ template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" . }} {{ template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" . }}
@ -297,11 +271,9 @@
{{else if eq .Type 14}} {{else if eq .Type 14}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.add_time_history" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.add_time_history" $createdStr | Safe}}
</span> </span>
{{ template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" . }} {{ template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" . }}
@ -313,33 +285,27 @@
{{else if eq .Type 15}} {{else if eq .Type 15}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}
</span> </span>
</div> </div>
{{else if eq .Type 16}} {{else if eq .Type 16}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.due_date_added" .Content $createdStr | Safe}} {{$.i18n.Tr "repo.issues.due_date_added" .Content $createdStr | Safe}}
</span> </span>
</div> </div>
{{else if eq .Type 17}} {{else if eq .Type 17}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$parsedDeadline := .Content | ParseDeadline}} {{$parsedDeadline := .Content | ParseDeadline}}
{{$.i18n.Tr "repo.issues.due_date_modified" (index $parsedDeadline 0) (index $parsedDeadline 1) $createdStr | Safe}} {{$.i18n.Tr "repo.issues.due_date_modified" (index $parsedDeadline 0) (index $parsedDeadline 1) $createdStr | Safe}}
</span> </span>
@ -347,22 +313,18 @@
{{else if eq .Type 18}} {{else if eq .Type 18}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.due_date_remove" .Content $createdStr | Safe}} {{$.i18n.Tr "repo.issues.due_date_remove" .Content $createdStr | Safe}}
</span> </span>
</div> </div>
{{else if eq .Type 19}} {{else if eq .Type 19}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-package-dependents"}}</span> <span class="badge">{{svg "octicon-package-dependents"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}}
</span> </span>
{{if .DependentIssue}} {{if .DependentIssue}}
@ -383,11 +345,9 @@
{{else if eq .Type 20}} {{else if eq .Type 20}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-package-dependents"}}</span> <span class="badge">{{svg "octicon-package-dependents"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}}
</span> </span>
{{if .DependentIssue}} {{if .DependentIssue}}
@ -424,7 +384,7 @@
<span class="text grey"> {{if $.Repository.OriginalURL}}</span> <span class="text grey"> {{if $.Repository.OriginalURL}}</span>
<span class="text migrate">({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span> <span class="text migrate">({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span>
{{else}} {{else}}
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{end}} {{end}}
{{if eq .Review.Type 1}} {{if eq .Review.Type 1}}
@ -455,7 +415,7 @@
<span class="text grey"> {{if $.Repository.OriginalURL}}</span> <span class="text grey"> {{if $.Repository.OriginalURL}}</span>
<span class="text migrate">({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span> <span class="text migrate">({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span>
{{else}} {{else}}
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{end}} {{end}}
{{$.i18n.Tr "repo.issues.review.left_comment" | Safe}} {{$.i18n.Tr "repo.issues.review.left_comment" | Safe}}
@ -583,7 +543,7 @@
<span class="text grey"> {{if $.Repository.OriginalURL}}</span> <span class="text grey"> {{if $.Repository.OriginalURL}}</span>
<span class="text migrate">({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span> <span class="text migrate">({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span>
{{else}} {{else}}
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{end}} {{end}}
{{$.i18n.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdSubStr | Safe}} {{$.i18n.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdSubStr | Safe}}
</span> </span>
@ -668,17 +628,15 @@
{{else if eq .Type 23}} {{else if eq .Type 23}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-lock"}}</span> <span class="badge">{{svg "octicon-lock"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
{{ if .Content }} {{ if .Content }}
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}} {{$.i18n.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}}
</span> </span>
{{ else }} {{ else }}
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.lock_no_reason" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.lock_no_reason" $createdStr | Safe}}
</span> </span>
{{ end }} {{ end }}
@ -686,33 +644,28 @@
{{else if eq .Type 24}} {{else if eq .Type 24}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-key"}}</span> <span class="badge">{{svg "octicon-key"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.unlock_comment" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.unlock_comment" $createdStr | Safe}}
</span> </span>
</div> </div>
{{else if eq .Type 25}} {{else if eq .Type 25}}
<div class="timeline-item event"> <div class="timeline-item event">
<span class="badge">{{svg "octicon-git-branch"}}</span> <span class="badge">{{svg "octicon-git-branch"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> <a{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a>
{{$.i18n.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}} {{$.i18n.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
</span> </span>
</div> </div>
{{else if eq .Type 26}} {{else if eq .Type 26}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$.i18n.Tr "repo.issues.del_time_history" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.del_time_history" $createdStr | Safe}}
</span> </span>
<div class="detail"> <div class="detail">
@ -723,11 +676,9 @@
{{else if eq .Type 27}} {{else if eq .Type 27}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-eye"}}</span> <span class="badge">{{svg "octicon-eye"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{if (gt .AssigneeID 0)}} {{if (gt .AssigneeID 0)}}
{{if .RemovedAssignee}} {{if .RemovedAssignee}}
{{if eq .PosterID .AssigneeID}} {{if eq .PosterID .AssigneeID}}
@ -751,7 +702,7 @@
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-repo-push"}}</span> <span class="badge">{{svg "octicon-repo-push"}}</span>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{ if .IsForcePush }} {{ if .IsForcePush }}
{{$.i18n.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape) (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr | Safe}} {{$.i18n.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape) (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr | Safe}}
{{else}} {{else}}
@ -766,11 +717,9 @@
{{if not $.UnitProjectsGlobalDisabled}} {{if not $.UnitProjectsGlobalDisabled}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-project"}}</span> <span class="badge">{{svg "octicon-project"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{if gt .OldProjectID 0}} {{if gt .OldProjectID 0}}
{{if gt .ProjectID 0}} {{if gt .ProjectID 0}}
{{$.i18n.Tr "repo.issues.change_project_at" (.OldProject.Title|Escape) (.Project.Title|Escape) $createdStr | Safe}} {{$.i18n.Tr "repo.issues.change_project_at" (.OldProject.Title|Escape) (.Project.Title|Escape) $createdStr | Safe}}
@ -791,7 +740,7 @@
</a> </a>
<span class="badge grey">{{svg "octicon-x" 16}}</span> <span class="badge grey">{{svg "octicon-x" 16}}</span>
<span class="text grey"> <span class="text grey">
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{$reviewerName := ""}} {{$reviewerName := ""}}
{{if eq .Review.OriginalAuthor ""}} {{if eq .Review.OriginalAuthor ""}}
{{$reviewerName = .Review.Reviewer.Name}} {{$reviewerName = .Review.Reviewer.Name}}
@ -825,11 +774,9 @@
{{else if eq .Type 33}} {{else if eq .Type 33}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-git-branch"}}</span> <span class="badge">{{svg "octicon-git-branch"}}</span>
<a href="{{.Poster.HomeLink}}"> {{template "shared/user/avatarlink" .Poster}}
{{avatar .Poster}}
</a>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{if and .OldRef .NewRef}} {{if and .OldRef .NewRef}}
{{$.i18n.Tr "repo.issues.change_ref_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}} {{$.i18n.Tr "repo.issues.change_ref_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
{{else if .OldRef}} {{else if .OldRef}}
@ -843,7 +790,7 @@
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-git-merge" 16}}</span> <span class="badge">{{svg "octicon-git-merge" 16}}</span>
<span class="text grey"> <span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{template "shared/user/authorlink" .Poster}}
{{if eq .Type 34}}{{$.i18n.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr | Safe}} {{if eq .Type 34}}{{$.i18n.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr | Safe}}
{{else}}{{$.i18n.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr | Safe}}{{end}} {{else}}{{$.i18n.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr | Safe}}{{end}}
</span> </span>

View File

@ -0,0 +1,3 @@
<a class="author"{{if gt .ID 0}} href="{{.HomeLink}}"{{end}}>
{{.GetDisplayName}}
</a>

View File

@ -0,0 +1,3 @@
<a class="avatar"{{if gt .ID 0}} href="{{.HomeLink}}"{{end}}>
{{avatar .}}
</a>

View File

@ -0,0 +1,3 @@
<a{{if gt .ID 0}} href="{{.HomeLink}}"{{end}}>
{{.GetDisplayName}}
</a>