|
1 | 1 | {{$invalid := (index .comments 0).Invalidated}}
|
2 | 2 | {{$resolved := (index .comments 0).IsResolved}}
|
3 | 3 | {{$resolveDoer := (index .comments 0).ResolveDoer}}
|
| 4 | +{{$hideByDefault := or $resolved (and $invalid (not .ShowOutdatedComments))}} |
4 | 5 | {{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}}
|
5 | 6 | <div class="ui segments conversation-holder">
|
6 | 7 | <div class="ui segment collapsible-comment-box gt-py-3 gt-df gt-ac gt-sb">
|
|
14 | 15 | </div>
|
15 | 16 | <div>
|
16 | 17 | {{if or $invalid $resolved}}
|
17 |
| - <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"> |
| 18 | + <button id="show-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="{{if not $hideByDefault}}gt-hidden {{end}}ui compact labeled button show-outdated gt-df gt-ac"> |
18 | 19 | {{svg "octicon-unfold" 16 "gt-mr-3"}}
|
19 | 20 | {{if $resolved}}
|
20 | 21 | {{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
|
21 | 22 | {{else}}
|
22 | 23 | {{ctx.Locale.Tr "repo.issues.review.show_outdated"}}
|
23 | 24 | {{end}}
|
24 | 25 | </button>
|
25 |
| - <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"> |
| 26 | + <button id="hide-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="{{if $hideByDefault}}gt-hidden {{end}}ui compact labeled button hide-outdated gt-df gt-ac"> |
26 | 27 | {{svg "octicon-fold" 16 "gt-mr-3"}}
|
27 | 28 | {{if $resolved}}
|
28 | 29 | {{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
|
|
36 | 37 | {{$diff := (CommentMustAsDiff ctx (index .comments 0))}}
|
37 | 38 | {{if $diff}}
|
38 | 39 | {{$file := (index $diff.Files 0)}}
|
39 |
| - <div id="code-preview-{{(index .comments 0).ID}}" class="ui table segment{{if $resolved}} gt-hidden{{end}}"> |
| 40 | + <div id="code-preview-{{(index .comments 0).ID}}" class="ui table segment{{if $hideByDefault}} gt-hidden{{end}}"> |
40 | 41 | <div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}">
|
41 | 42 | <div class="file-body file-code code-view code-diff code-diff-unified unicode-escaped">
|
42 | 43 | <table>
|
|
48 | 49 | </div>
|
49 | 50 | </div>
|
50 | 51 | {{end}}
|
51 |
| - <div id="code-comments-{{(index .comments 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} gt-hidden{{end}}"> |
| 52 | + <div id="code-comments-{{(index .comments 0).ID}}" class="comment-code-cloud ui segment{{if $hideByDefault}} gt-hidden{{end}}"> |
52 | 53 | <div class="ui comments gt-mb-0">
|
53 | 54 | {{range .comments}}
|
54 | 55 | {{$createdSubStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
|
|
0 commit comments