|
| 1 | +<!-- Provide Issue for any types other than type 0 --> |
1 | 2 | {{template "base/alert"}} |
2 | | -{{range .Issue.Comments}} |
| 3 | +{{$IsIssue:= .IsIssue}} |
| 4 | +{{$IsCommit:= .IsCommit}} |
| 5 | +{{range .Comments}} |
3 | 6 | {{if call $.ShouldShowCommentType .Type}} |
4 | 7 | {{$createdStr:= DateUtils.TimeSince .CreatedUnix}} |
5 | 8 |
|
|
53 | 56 | <div class="comment-header-right actions tw-flex tw-items-center"> |
54 | 57 | {{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}} |
55 | 58 | {{if not $.Repository.IsArchived}} |
56 | | - {{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} |
| 59 | + {{if $IsIssue}} |
| 60 | + {{template "repo/conversation/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} |
| 61 | + {{else}} |
| 62 | + {{template "repo/conversation/add_reaction" dict "ActionURL" (printf "%s/conversations/comments/%d/reactions" $.RepoLink .ID)}} |
| 63 | + {{end}} |
57 | 64 | {{end}} |
58 | | - {{template "repo/issue/view_content/context_menu" dict "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} |
| 65 | + |
| 66 | + {{template "repo/conversation/context_menu" dict "ctxData" $ "item" . "delete" true "issue" $IsIssue "pull" ((and $IsIssue .Issue.IsPull)) "commit" $IsCommit "diff" false "IsIssue" $IsIssue "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} |
59 | 67 | </div> |
60 | 68 | </div> |
61 | 69 | <div class="ui attached segment comment-body" role="article"> |
|
66 | 74 | <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> |
67 | 75 | {{end}} |
68 | 76 | </div> |
69 | | - <div id="issuecomment-{{.ID}}-raw" class="raw-content tw-hidden">{{.Content}}</div> |
70 | | - <div class="edit-content-zone tw-hidden" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-content-version="{{.ContentVersion}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div> |
| 77 | + <div id="{{if $IsIssue}}issue{{end}}comment-{{.ID}}-raw" class="raw-content tw-hidden">{{.Content}}</div> |
| 78 | + |
| 79 | + {{if $IsIssue}} |
| 80 | + {{$EditURL:=printf "%s/%s/%d" $.RepoLink "comments" .ID}} |
| 81 | + <div class="edit-content-zone tw-hidden" data-update-url="{{$EditURL}}" data-content-version="{{.ContentVersion}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$EditURL}}/attachments"></div> |
| 82 | + {{else}} |
| 83 | + {{$EditURL:=printf "%s/%s/%d" $.RepoLink "conversations/comments" .ID}} |
| 84 | + <div class="edit-content-zone tw-hidden" data-update-url="{{$EditURL}}" data-content-version="{{.ContentVersion}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$EditURL}}/attachments"></div> |
| 85 | + {{end}} |
| 86 | + |
71 | 87 | {{if .Attachments}} |
72 | 88 | {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}} |
73 | 89 | {{end}} |
74 | 90 | </div> |
75 | 91 | {{$reactions := .Reactions.GroupByType}} |
76 | 92 | {{if $reactions}} |
77 | | - {{template "repo/issue/view_content/reactions" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} |
| 93 | + {{if $IsIssue}} |
| 94 | + {{template "repo/conversation/reactions" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} |
| 95 | + {{else}} |
| 96 | + {{template "repo/conversation/reactions" dict "ActionURL" (printf "%s/conversations/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} |
| 97 | + {{end}} |
78 | 98 | {{end}} |
79 | 99 | </div> |
80 | 100 | </div> |
|
85 | 105 | {{template "shared/user/avatarlink" dict "user" .Poster}} |
86 | 106 | {{end}} |
87 | 107 | <span class="text grey muted-links"> |
88 | | - {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} |
| 108 | + {{template "repo/conversation/comments_authorlink" dict "ctxData" $ "comment" .}} |
89 | 109 | {{if .Issue.IsPull}} |
90 | 110 | {{ctx.Locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr}} |
91 | 111 | {{else}} |
|
100 | 120 | {{template "shared/user/avatarlink" dict "user" .Poster}} |
101 | 121 | {{end}} |
102 | 122 | <span class="text grey muted-links"> |
103 | | - {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} |
| 123 | + {{template "repo/conversation/comments_authorlink" dict "ctxData" $ "comment" .}} |
104 | 124 | {{if .Issue.IsPull}} |
105 | 125 | {{ctx.Locale.Tr "repo.pulls.closed_at" .EventTag $createdStr}} |
106 | 126 | {{else}} |
|
115 | 135 | {{template "shared/user/avatarlink" dict "user" .Poster}} |
116 | 136 | {{end}} |
117 | 137 | <span class="text grey muted-links"> |
118 | | - {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} |
| 138 | + {{template "repo/conversation/comments_authorlink" dict "ctxData" $ "comment" .}} |
119 | 139 | {{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}} |
120 | 140 | {{if eq $.Issue.PullRequest.Status 3}} |
121 | 141 | {{ctx.Locale.Tr "repo.issues.comment_manually_pull_merged_at" (HTMLFormat `<a class="ui sha" href="%[1]s"><b>%[2]s</b></a>` $link (ShortSha $.Issue.PullRequest.MergedCommitID)) (HTMLFormat "<b>%[1]s</b>" $.BaseTarget) $createdStr}} |
|
251 | 271 | {{template "shared/user/authorlink" .Poster}} |
252 | 272 | {{ctx.Locale.Tr "repo.issues.stop_tracking_history" $createdStr}} |
253 | 273 | </span> |
254 | | - {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} |
| 274 | + {{template "repo/conversation/comments_delete_time" dict "ctxData" $ "comment" .}} |
255 | 275 | <div class="detail flex-text-block"> |
256 | 276 | {{svg "octicon-clock"}} |
257 | 277 | {{if .RenderedContent}} |
|
270 | 290 | {{template "shared/user/authorlink" .Poster}} |
271 | 291 | {{ctx.Locale.Tr "repo.issues.add_time_history" $createdStr}} |
272 | 292 | </span> |
273 | | - {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} |
| 293 | + {{template "repo/conversation/comments_delete_time" dict "ctxData" $ "comment" .}} |
274 | 294 | <div class="detail flex-text-block"> |
275 | 295 | {{svg "octicon-clock"}} |
276 | 296 | {{if .RenderedContent}} |
|
386 | 406 | {{if .Review}}{{svg (printf "octicon-%s" .Review.Type.Icon)}}{{end}} |
387 | 407 | </span> |
388 | 408 | <span class="text grey muted-links"> |
389 | | - {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} |
| 409 | + {{template "repo/conversation/comments_authorlink" dict "ctxData" $ "comment" .}} |
390 | 410 | {{if eq $reviewType 1}} |
391 | 411 | {{ctx.Locale.Tr "repo.issues.review.approve" $createdStr}} |
392 | 412 | {{else if eq $reviewType 2}} |
|
429 | 449 | <div class="comment-header-right actions tw-flex tw-items-center"> |
430 | 450 | {{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}} |
431 | 451 | {{if not $.Repository.IsArchived}} |
432 | | - {{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} |
433 | | - {{template "repo/issue/view_content/context_menu" dict "item" . "delete" false "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} |
| 452 | + {{template "repo/conversation/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} |
| 453 | + {{template "repo/conversation/context_menu" dict "ctxData" $ "item" . "delete" false "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} |
434 | 454 | {{end}} |
435 | 455 | </div> |
436 | 456 | </div> |
|
498 | 518 | {{template "shared/user/avatarlink" dict "user" .Poster}} |
499 | 519 | {{end}} |
500 | 520 | <span class="text grey muted-links"> |
501 | | - {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} |
| 521 | + {{template "repo/conversation/comments_authorlink" dict "ctxData" $ "comment" .}} |
502 | 522 | {{ctx.Locale.Tr "repo.pulls.change_target_branch_at" .OldRef .NewRef $createdStr}} |
503 | 523 | </span> |
504 | 524 | </div> |
|
687 | 707 | <div class="timeline-item event" id="{{.HashTag}}"> |
688 | 708 | <span class="badge">{{svg "octicon-git-merge" 16}}</span> |
689 | 709 | <span class="text grey muted-links"> |
690 | | - {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} |
| 710 | + {{template "repo/conversation/comments_authorlink" dict "ctxData" $ "comment" .}} |
691 | 711 | {{if eq .Type 34}}{{ctx.Locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr}} |
692 | 712 | {{else}}{{ctx.Locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr}}{{end}} |
693 | 713 | </span> |
|
0 commit comments