2018-08-06 00:43:22 -04:00
|
|
|
{{$file := .file}}
|
2016-08-28 07:31:42 -04:00
|
|
|
{{$highlightClass := $file.GetHighlightClass}}
|
|
|
|
{{range $j, $section := $file.Sections}}
|
|
|
|
{{range $k, $line := $section.Lines}}
|
|
|
|
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
|
|
|
|
{{if eq .GetType 4}}
|
2019-11-14 21:52:59 -05:00
|
|
|
<td colspan="2" class="lines-num">
|
|
|
|
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
|
|
|
|
<i class="ui blob-excerpt fa fa-caret-down" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"></i>
|
|
|
|
{{end}}
|
|
|
|
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
|
|
|
|
<i class="ui blob-excerpt fa fa-caret-up" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"></i>
|
|
|
|
{{end}}
|
2020-04-16 17:26:24 -04:00
|
|
|
{{if eq $line.GetExpandDirection 2}}
|
2020-02-11 12:02:41 -05:00
|
|
|
<span class="ui blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">{{svg "octicon-fold" 16}}</span>
|
2019-11-14 21:52:59 -05:00
|
|
|
{{end}}
|
|
|
|
</td>
|
2016-08-28 07:31:42 -04:00
|
|
|
{{else}}
|
2019-06-26 17:35:07 -04:00
|
|
|
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}"></span></td>
|
|
|
|
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}"></span></td>
|
2016-08-28 07:31:42 -04:00
|
|
|
{{end}}
|
2019-06-26 17:35:07 -04:00
|
|
|
<td class="lines-type-marker"><span class="mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
|
2019-07-12 11:22:52 -04:00
|
|
|
<td class="lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}<a class="ui green button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}" data-path="{{$file.Name}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">+</a>{{end}}<span class="mono wrap{{if $highlightClass}} language-{{$highlightClass}}{{else}} nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</span></td>
|
2016-08-28 07:31:42 -04:00
|
|
|
</tr>
|
2018-08-06 00:43:22 -04:00
|
|
|
{{if gt (len $line.Comments) 0}}
|
2020-04-18 09:50:25 -04:00
|
|
|
{{$resolved := (index $line.Comments 0).IsResolved}}
|
|
|
|
{{$resolveDoer := (index $line.Comments 0).ResolveDoer}}
|
|
|
|
{{$isNotPending := (not (eq (index $line.Comments 0).Review.Type 0))}}
|
2018-08-06 00:43:22 -04:00
|
|
|
<tr>
|
|
|
|
<td colspan="2" class="lines-num"></td>
|
2020-05-15 18:54:18 -04:00
|
|
|
<td class="add-comment-left add-comment-right" colspan="2">
|
2020-04-18 09:50:25 -04:00
|
|
|
{{if $resolved}}
|
|
|
|
<div class = "ui attached header">
|
|
|
|
<span class="ui grey text left"><b>{{$resolveDoer.Name}}</b> {{$.root.i18n.Tr "repo.issues.review.resolved_by"}}</span>
|
|
|
|
<button id="show-outdated-{{(index $line.Comments 0).ID}}" data-comment="{{(index $line.Comments 0).ID}}" class="ui compact right labeled button show-outdated">
|
|
|
|
{{svg "octicon-unfold" 16}}
|
|
|
|
{{$.root.i18n.Tr "repo.issues.review.show_resolved"}}
|
|
|
|
</button>
|
|
|
|
<button id="hide-outdated-{{(index $line.Comments 0).ID}}" data-comment="{{(index $line.Comments 0).ID}}" class="hide ui compact right labeled button hide-outdated">
|
|
|
|
{{svg "octicon-fold" 16}}
|
|
|
|
{{$.root.i18n.Tr "repo.issues.review.hide_resolved"}}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
<div id="code-comments-{{(index $line.Comments 0).ID}}" class="field comment-code-cloud {{if $resolved}}hide{{end}}">
|
2018-08-06 00:43:22 -04:00
|
|
|
<div class="comment-list">
|
|
|
|
<ui class="ui comments">
|
|
|
|
{{ template "repo/diff/comments" dict "root" $.root "comments" $line.Comments}}
|
|
|
|
</ui>
|
|
|
|
</div>
|
2018-10-22 16:13:35 -04:00
|
|
|
{{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index $line.Comments 0).ReviewID "root" $.root "comment" (index $line.Comments 0)}}
|
2020-04-18 09:50:25 -04:00
|
|
|
{{if and $.root.CanMarkConversation $isNotPending}}
|
|
|
|
<button class="ui icon tiny button resolve-conversation" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $line.Comments 0).ID}}" data-update-url="{{$.root.RepoLink}}/issues/resolve_conversation" >
|
|
|
|
{{if $resolved}}
|
|
|
|
{{$.root.i18n.Tr "repo.issues.review.un_resolve_conversation"}}
|
|
|
|
{{else}}
|
|
|
|
{{$.root.i18n.Tr "repo.issues.review.resolve_conversation"}}
|
|
|
|
{{end}}
|
|
|
|
</button>
|
|
|
|
{{end}}
|
2018-08-06 00:43:22 -04:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
2016-08-28 07:31:42 -04:00
|
|
|
{{end}}
|
2018-08-06 00:43:22 -04:00
|
|
|
{{end}}
|