mirror of
https://github.com/go-gitea/gitea
synced 2024-11-09 19:54:25 +00:00
821570c0b0
* bug: fix comment update permision check No the ui only allow poster to update or delet comment, which is not reasonable and different with handle logic, this pr change it to allow poster of comment do it ref code:e8955173a9/routers/repo/issue.go (L1636)
e8955173a9/routers/repo/issue.go (L1681)
fix #11663 Signed-off-by: a1012112796 <1012112796@qq.com> * simplify code * fix sign in Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
599 lines
25 KiB
Cheetah
599 lines
25 KiB
Cheetah
{{ template "base/alert" }}
|
|
{{range .Issue.Comments}}
|
|
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }}
|
|
|
|
<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF,
|
|
5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING,
|
|
13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE,
|
|
18 = REMOVED_DEADLINE, 19 = ADD_DEPENDENCY, 20 = REMOVE_DEPENDENCY, 21 = CODE,
|
|
22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED, 25 = TARGET_BRANCH_CHANGED,
|
|
26 = DELETE_TIME_MANUAL, 27 = REVIEW_REQUEST, 28 = MERGE_PULL_REQUEST -->
|
|
{{if eq .Type 0}}
|
|
<div class="timeline-item comment" id="{{.HashTag}}">
|
|
{{if .OriginalAuthor }}
|
|
<span class="timeline-avatar"><img src="/img/avatar_default.png"></span>
|
|
{{else}}
|
|
<a class="timeline-avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
{{end}}
|
|
<div class="content">
|
|
<div class="ui top attached header">
|
|
{{if .OriginalAuthor }}
|
|
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{$.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}} {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
|
|
{{else}}
|
|
<span class="text grey"><a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
|
|
{{end}}
|
|
{{if not $.Repository.IsArchived}}
|
|
<div class="ui right actions">
|
|
{{if gt .ShowTag 0}}
|
|
<div class="item tag">
|
|
{{if eq .ShowTag 1}}
|
|
{{$.i18n.Tr "repo.issues.poster"}}
|
|
{{else if eq .ShowTag 2}}
|
|
{{$.i18n.Tr "repo.issues.collaborator"}}
|
|
{{else if eq .ShowTag 3}}
|
|
{{$.i18n.Tr "repo.issues.owner"}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
|
|
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
<div class="ui attached segment">
|
|
<div class="render-content markdown">
|
|
{{if .RenderedContent}}
|
|
{{.RenderedContent|Str2html}}
|
|
{{else}}
|
|
<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
|
|
{{end}}
|
|
</div>
|
|
<div id="comment-{{.ID}}" class="raw-content hide">{{.Content}}</div>
|
|
<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
|
|
{{if .Attachments}}
|
|
<div class="ui clearing divider"></div>
|
|
<div class="ui middle aligned padded grid">
|
|
{{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{$reactions := .Reactions.GroupByType}}
|
|
{{if $reactions}}
|
|
<div class="ui attached segment reactions">
|
|
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{else if eq .Type 1}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-primitive-dot" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{if .Issue.IsPull }}
|
|
{{$.i18n.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}}
|
|
{{else}}
|
|
{{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 2}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-circle-slash" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{if .Issue.IsPull }}
|
|
{{$.i18n.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}}
|
|
{{else}}
|
|
{{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 28}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge purple">{{svg "octicon-git-merge" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$link := printf "%s/commit/%s" $.Repository.HTMLURL $.Issue.PullRequest.MergedCommitID}}
|
|
{{$.i18n.Tr "repo.issues.pull_merged_at" $link (ShortSha $.Issue.PullRequest.MergedCommitID) $.BaseTarget $createdStr | Str2html}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 3 5 6}}
|
|
{{ $refFrom:= "" }}
|
|
{{if ne .RefRepoID .Issue.RepoID}}
|
|
{{ $refFrom = $.i18n.Tr "repo.issues.ref_from" .RefRepo.FullName }}
|
|
{{end}}
|
|
{{ $refTr := "repo.issues.ref_issue_from" }}
|
|
{{if .Issue.IsPull}}
|
|
{{ $refTr = "repo.issues.ref_pull_from" }}
|
|
{{else if eq .RefAction 1 }}
|
|
{{ $refTr = "repo.issues.ref_closing_from" }}
|
|
{{else if eq .RefAction 2 }}
|
|
{{ $refTr = "repo.issues.ref_reopening_from" }}
|
|
{{end}}
|
|
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-bookmark" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
{{if eq .RefAction 3}}<del>{{end}}
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr $refTr .EventTag $createdStr .RefCommentHTMLURL $refFrom | Safe}}
|
|
</span>
|
|
{{if eq .RefAction 3}}</del>{{end}}
|
|
|
|
<div class="detail">
|
|
<span class="text grey"><a href="{{.RefIssueHTMLURL}}"><b>{{.RefIssueTitle | Str2html}}</b> {{.RefIssueIdent | Str2html}}</a></span>
|
|
</div>
|
|
</div>
|
|
{{else if eq .Type 4}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-bookmark" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}
|
|
</span>
|
|
<div class="detail">
|
|
{{svg "octicon-git-commit" 16}}
|
|
<span class="text grey">{{.Content | Str2html}}</span>
|
|
</div>
|
|
</div>
|
|
{{else if eq .Type 7}}
|
|
{{if .Label}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-tag" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape|RenderEmoji) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape|RenderEmoji) $createdStr | Safe}}{{end}}
|
|
</span>
|
|
</div>
|
|
{{end}}
|
|
{{else if eq .Type 8}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-milestone" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{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>
|
|
</div>
|
|
{{else if eq .Type 9}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-person" 16}}</span>
|
|
{{if gt .AssigneeID 0}}
|
|
{{if .RemovedAssignee}}
|
|
<a class="ui avatar image" href="{{.Assignee.HomeLink}}">
|
|
<img src="{{.Assignee.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a>
|
|
{{ if eq .Poster.ID .Assignee.ID }}
|
|
{{$.i18n.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
|
|
{{ else }}
|
|
{{$.i18n.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
|
|
{{ end }}
|
|
</span>
|
|
{{else}}
|
|
<a class="ui avatar image" href="{{.Assignee.HomeLink}}">
|
|
<img src="{{.Assignee.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a>
|
|
{{if eq .Poster.ID .AssigneeID}}
|
|
{{$.i18n.Tr "repo.issues.self_assign_at" $createdStr | Safe}}
|
|
{{else}}
|
|
{{$.i18n.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
|
|
{{end}}
|
|
</span>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{else if eq .Type 10}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-pencil" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.change_title_at" (.OldTitle|Escape) (.NewTitle|Escape) $createdStr | Safe}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 11}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-git-branch" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.delete_branch_at" (.CommitSHA|Escape) $createdStr | Safe}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 12}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-clock" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.start_tracking_history" $createdStr | Safe}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 13}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-clock" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}}
|
|
</span>
|
|
<div class="detail">
|
|
{{svg "octicon-clock" 16}}
|
|
<span class="text grey">{{.Content}}</span>
|
|
</div>
|
|
</div>
|
|
{{else if eq .Type 14}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-clock" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.add_time_history" $createdStr | Safe}}
|
|
</span>
|
|
<div class="detail">
|
|
{{svg "octicon-clock" 16}}
|
|
<span class="text grey">{{.Content}}</span>
|
|
</div>
|
|
</div>
|
|
{{else if eq .Type 15}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-clock" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 16}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-clock" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.due_date_added" .Content $createdStr | Safe}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 17}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-clock" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.due_date_modified" (.Content | ParseDeadline) $createdStr | Safe}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 18}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-clock" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.due_date_remove" .Content $createdStr | Safe}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 19}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-dependent" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}}
|
|
</span>
|
|
{{if .DependentIssue}}
|
|
<div class="detail">
|
|
{{svg "octicon-plus" 16}}
|
|
<span class="text grey">
|
|
<a href="{{.DependentIssue.HTMLURL}}">
|
|
{{if eq .DependentIssue.RepoID .Issue.RepoID}}
|
|
#{{.DependentIssue.Index}} {{.DependentIssue.Title}}
|
|
{{else}}
|
|
{{.DependentIssue.Repo.FullName}}#{{.DependentIssue.Index}} - {{.DependentIssue.Title}}
|
|
{{end}}
|
|
</a>
|
|
</span>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else if eq .Type 20}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-dependent" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}}
|
|
</span>
|
|
{{if .DependentIssue}}
|
|
<div class="detail">
|
|
<span class="text grey">{{svg "octicon-trashcan" 16}}</span>
|
|
<span class="text grey">
|
|
<a href="{{.DependentIssue.HTMLURL}}">
|
|
{{if eq .DependentIssue.RepoID .Issue.RepoID}}
|
|
#{{.DependentIssue.Index}} {{.DependentIssue.Title}}
|
|
{{else}}
|
|
{{.DependentIssue.Repo.FullName}}#{{.DependentIssue.Index}} - {{.DependentIssue.Title}}
|
|
{{end}}
|
|
</a>
|
|
</span>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else if eq .Type 22}}
|
|
<div class="timeline-item-group">
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
{{if .OriginalAuthor }}
|
|
{{else}}
|
|
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
{{end}}
|
|
<span class="badge {{if eq .Review.Type 1}}green
|
|
{{- else if eq .Review.Type 2}}grey
|
|
{{- else if eq .Review.Type 3}}red
|
|
{{- else}}grey{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon) 16}}</span>
|
|
<span class="text grey">
|
|
{{if .OriginalAuthor }}
|
|
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
|
|
{{else}}
|
|
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
|
|
{{end}}
|
|
|
|
{{if eq .Review.Type 1}}
|
|
{{$.i18n.Tr "repo.issues.review.approve" $createdStr | Safe}}
|
|
{{else if eq .Review.Type 2}}
|
|
{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
|
|
{{else if eq .Review.Type 3}}
|
|
{{$.i18n.Tr "repo.issues.review.reject" $createdStr | Safe}}
|
|
{{else}}
|
|
{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
{{if .Content}}
|
|
<div class="timeline-item comment">
|
|
<div class="content">
|
|
<div class="ui top attached header arrow-top">
|
|
<span class="text grey">
|
|
{{if .OriginalAuthor }}
|
|
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
|
|
{{else}}
|
|
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
|
|
{{end}}
|
|
|
|
{{$.i18n.Tr "repo.issues.review.left_comment" | Safe}}
|
|
</span>
|
|
</div>
|
|
<div class="ui attached segment">
|
|
<div class="render-content markdown">
|
|
{{if .RenderedContent}}
|
|
{{.RenderedContent|Str2html}}
|
|
{{else}}
|
|
<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if .Review.CodeComments}}
|
|
<div class="timeline-item event">
|
|
{{ range $filename, $lines := .Review.CodeComments}}
|
|
{{range $line, $comms := $lines}}
|
|
<div class="ui segments">
|
|
<div class="ui segment">
|
|
{{$invalid := (index $comms 0).Invalidated}}
|
|
{{$resolved := (index $comms 0).IsResolved}}
|
|
{{$resolveDoer := (index $comms 0).ResolveDoer}}
|
|
{{$isNotPending := (not (eq (index $comms 0).Review.Type 0))}}
|
|
{{if or $invalid $resolved}}
|
|
<button id="show-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="ui compact right labeled button show-outdated">
|
|
{{svg "octicon-unfold" 16}}
|
|
{{if $invalid }}
|
|
{{$.i18n.Tr "repo.issues.review.show_outdated"}}
|
|
{{else}}
|
|
{{$.i18n.Tr "repo.issues.review.show_resolved"}}
|
|
{{end}}
|
|
</button>
|
|
<button id="hide-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="hide ui compact right labeled button hide-outdated">
|
|
{{svg "octicon-fold" 16}}
|
|
{{if $invalid}}
|
|
{{$.i18n.Tr "repo.issues.review.hide_outdated"}}
|
|
{{else}}
|
|
{{$.i18n.Tr "repo.issues.review.hide_resolved"}}
|
|
{{end}}
|
|
</button>
|
|
{{end}}
|
|
<a href="{{(index $comms 0).CodeCommentURL}}" class="file-comment">{{$filename}}</a>
|
|
</div>
|
|
{{$diff := (CommentMustAsDiff (index $comms 0))}}
|
|
{{if $diff}}
|
|
{{$file := (index $diff.Files 0)}}
|
|
<div id="code-preview-{{(index $comms 0).ID}}" class="ui table segment{{if or $invalid $resolved}} hide{{end}}">
|
|
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}">
|
|
<div class="file-body file-code code-view code-diff code-diff-unified">
|
|
<table>
|
|
<tbody>
|
|
{{template "repo/diff/section_unified" dict "file" $file "root" $}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
<div id="code-comments-{{(index $comms 0).ID}}" class="ui segment{{if or $invalid $resolved}} hide{{end}}">
|
|
<div class="ui comments">
|
|
{{range $comms}}
|
|
{{ $createdSubStr:= TimeSinceUnix .CreatedUnix $.Lang }}
|
|
<div class="comment" id="{{.HashTag}}">
|
|
<a class="avatar">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<div class="content">
|
|
<div class="code-comment-content">
|
|
<span class="text grey">
|
|
<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdSubStr | Safe}}
|
|
<div class="text">
|
|
<div class="render-content markdown">
|
|
{{if .RenderedContent}}
|
|
{{.RenderedContent|Str2html}}
|
|
{{else}}
|
|
<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
|
|
{{end}}
|
|
</div>
|
|
<div class="raw-content hide">{{.Content}}</div>
|
|
</div>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index $comms 0).ReviewID "root" $ "comment" (index $comms 0)}}
|
|
|
|
{{if and $.CanMarkConversation $isNotPending}}
|
|
<button class="ui tiny button resolve-conversation" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $comms 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" >
|
|
{{if $resolved}}
|
|
{{$.i18n.Tr "repo.issues.review.un_resolve_conversation"}}
|
|
{{else}}
|
|
{{$.i18n.Tr "repo.issues.review.resolve_conversation"}}
|
|
{{end}}
|
|
</button>
|
|
{{end}}
|
|
|
|
{{if $resolved}}
|
|
<span class="ui grey text"><b>{{$resolveDoer.Name}}</b> {{$.i18n.Tr "repo.issues.review.resolved_by"}}</span>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else if eq .Type 23}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-lock" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
{{ if .Content }}
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}}
|
|
</span>
|
|
{{ else }}
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.lock_no_reason" $createdStr | Safe}}
|
|
</span>
|
|
{{ end }}
|
|
</div>
|
|
{{else if eq .Type 24}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-key" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.unlock_comment" $createdStr | Safe}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 25}}
|
|
<div class="timeline-item event">
|
|
<span class="badge">{{svg "octicon-git-branch" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
|
|
{{$.i18n.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
|
|
</span>
|
|
</div>
|
|
{{else if eq .Type 26}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-clock" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{$.i18n.Tr "repo.issues.del_time_history" $createdStr | Safe}}
|
|
</span>
|
|
<div class="detail">
|
|
{{svg "octicon-clock" 16}}
|
|
<span class="text grey">{{.Content}}</span>
|
|
</div>
|
|
</div>
|
|
{{else if eq .Type 27}}
|
|
<div class="timeline-item event" id="{{.HashTag}}">
|
|
<span class="badge">{{svg "octicon-eye" 16}}</span>
|
|
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
|
|
<img src="{{.Poster.RelAvatarLink}}">
|
|
</a>
|
|
<span class="text grey">
|
|
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
|
|
{{if .RemovedAssignee}}
|
|
{{if eq .PosterID .AssigneeID}}
|
|
{{$.i18n.Tr "repo.issues.review.remove_review_request_self" $createdStr | Safe}}
|
|
{{else}}
|
|
{{$.i18n.Tr "repo.issues.review.remove_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
|
|
{{end}}
|
|
{{else}}
|
|
{{$.i18n.Tr "repo.issues.review.add_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|