|
|
|
@ -1,11 +1,14 @@ |
|
|
|
|
{{$invalid := (index .comments 0).Invalidated}} |
|
|
|
|
{{$resolved := (index .comments 0).IsResolved}} |
|
|
|
|
{{$resolveDoer := (index .comments 0).ResolveDoer}} |
|
|
|
|
{{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}} |
|
|
|
|
<div class="ui segments conversation-holder"> |
|
|
|
|
{{if len .comments}} |
|
|
|
|
{{$comment := index .comments 0}} |
|
|
|
|
{{$invalid := $comment.Invalidated}} |
|
|
|
|
{{$resolved := $comment.IsResolved}} |
|
|
|
|
{{$resolveDoer := $comment.ResolveDoer}} |
|
|
|
|
{{$hasReview := and $comment.Review}} |
|
|
|
|
{{$isReviewPending := and $hasReview (eq $comment.Review.Type 0)}} |
|
|
|
|
<div class="ui segments conversation-holder"> |
|
|
|
|
<div class="ui segment collapsible-comment-box gt-py-3 gt-df gt-ac gt-sb"> |
|
|
|
|
<div class="gt-df gt-ac"> |
|
|
|
|
<a href="{{(index .comments 0).CodeCommentLink ctx}}" class="file-comment gt-ml-3 gt-word-break">{{(index .comments 0).TreePath}}</a> |
|
|
|
|
<a href="{{$comment.CodeCommentLink ctx}}" class="file-comment gt-ml-3 gt-word-break">{{$comment.TreePath}}</a> |
|
|
|
|
{{if $invalid}} |
|
|
|
|
<span class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> |
|
|
|
|
{{ctx.Locale.Tr "repo.issues.review.outdated"}} |
|
|
|
@ -14,7 +17,7 @@ |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
{{if or $invalid $resolved}} |
|
|
|
|
<button id="show-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="{{if not $resolved}}gt-hidden {{end}}ui compact labeled button show-outdated gt-df gt-ac"> |
|
|
|
|
<button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if not $resolved}}gt-hidden {{end}}ui compact labeled button show-outdated gt-df gt-ac"> |
|
|
|
|
{{svg "octicon-unfold" 16 "gt-mr-3"}} |
|
|
|
|
{{if $resolved}} |
|
|
|
|
{{ctx.Locale.Tr "repo.issues.review.show_resolved"}} |
|
|
|
@ -22,7 +25,7 @@ |
|
|
|
|
{{ctx.Locale.Tr "repo.issues.review.show_outdated"}} |
|
|
|
|
{{end}} |
|
|
|
|
</button> |
|
|
|
|
<button id="hide-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="{{if $resolved}}gt-hidden {{end}}ui compact labeled button hide-outdated gt-df gt-ac"> |
|
|
|
|
<button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if $resolved}}gt-hidden {{end}}ui compact labeled button hide-outdated gt-df gt-ac"> |
|
|
|
|
{{svg "octicon-fold" 16 "gt-mr-3"}} |
|
|
|
|
{{if $resolved}} |
|
|
|
|
{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}} |
|
|
|
@ -33,10 +36,10 @@ |
|
|
|
|
{{end}} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{{$diff := (CommentMustAsDiff ctx (index .comments 0))}} |
|
|
|
|
{{$diff := (CommentMustAsDiff ctx $comment)}} |
|
|
|
|
{{if $diff}} |
|
|
|
|
{{$file := (index $diff.Files 0)}} |
|
|
|
|
<div id="code-preview-{{(index .comments 0).ID}}" class="ui table segment{{if $resolved}} gt-hidden{{end}}"> |
|
|
|
|
<div id="code-preview-{{$comment.ID}}" class="ui table segment{{if $resolved}} gt-hidden{{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 unicode-escaped"> |
|
|
|
|
<table> |
|
|
|
@ -48,7 +51,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{{end}} |
|
|
|
|
<div id="code-comments-{{(index .comments 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} gt-hidden{{end}}"> |
|
|
|
|
<div id="code-comments-{{$comment.ID}}" class="comment-code-cloud ui segment{{if $resolved}} gt-hidden{{end}}"> |
|
|
|
|
<div class="ui comments gt-mb-0"> |
|
|
|
|
{{range .comments}} |
|
|
|
|
{{$createdSubStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} |
|
|
|
@ -116,8 +119,8 @@ |
|
|
|
|
{{end}} |
|
|
|
|
</div> |
|
|
|
|
<div class="code-comment-buttons-buttons"> |
|
|
|
|
{{if and $.CanMarkConversation $isNotPending}} |
|
|
|
|
<button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation"> |
|
|
|
|
{{if and $.CanMarkConversation $hasReview (not $isReviewPending)}} |
|
|
|
|
<button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{$comment.ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation"> |
|
|
|
|
{{if $resolved}} |
|
|
|
|
{{ctx.Locale.Tr "repo.issues.review.un_resolve_conversation"}} |
|
|
|
|
{{else}} |
|
|
|
@ -132,6 +135,9 @@ |
|
|
|
|
{{end}} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index .comments 0).ReviewID "root" $ "comment" (index .comments 0)}} |
|
|
|
|
{{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" $comment.ReviewID "root" $ "comment" $comment}} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{{else}} |
|
|
|
|
{{template "repo/diff/conversation_outdated"}} |
|
|
|
|
{{end}} |
|
|
|
|