|
15 | 15 | <div>
|
16 | 16 | <div class="diff-detail-box diff-box sticky gt-df gt-sb gt-ac gt-fw">
|
17 | 17 | <div class="gt-df gt-ac gt-fw">
|
18 |
| - <button class="diff-toggle-file-tree-button gt-df gt-ac" data-show-text="{{.locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{.locale.Tr "repo.diff.hide_file_tree"}}"> |
| 18 | + <button class="diff-toggle-file-tree-button gt-df gt-ac not-mobile" data-show-text="{{.locale.Tr "repo.diff.show_file_tree"}}" data-hide-text="{{.locale.Tr "repo.diff.hide_file_tree"}}"> |
19 | 19 | {{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}}
|
20 | 20 | {{svg "octicon-sidebar-collapse" 20 "icon gt-hidden"}}
|
21 | 21 | {{svg "octicon-sidebar-expand" 20 "icon gt-hidden"}}
|
|
27 | 27 | diffTreeBtn.querySelector(diffTreeIcon).classList.remove('gt-hidden');
|
28 | 28 | diffTreeBtn.setAttribute('data-tooltip-content', diffTreeBtn.getAttribute(diffTreeVisible ? 'data-hide-text' : 'data-show-text'));
|
29 | 29 | </script>
|
30 |
| - <div class="diff-detail-stats gt-df gt-ac gt-ml-3"> |
| 30 | + <div class="diff-detail-stats gt-df gt-ac gt-fw"> |
31 | 31 | {{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
|
32 | 32 | </div>
|
33 | 33 | </div>
|
34 |
| - <div class="diff-detail-actions gt-df gt-ac"> |
| 34 | + <div class="diff-detail-actions gt-df gt-ac gt-gap-2 gt-fw"> |
35 | 35 | {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
|
36 |
| - <progress id="viewed-files-summary" class="gt-mr-2" value="{{.Diff.NumViewedFiles}}" max="{{.Diff.NumFiles}}"></progress> |
37 |
| - <label for="viewed-files-summary" id="viewed-files-summary-label" class="gt-mr-3 gt-f1" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}"> |
| 36 | + <progress id="viewed-files-summary" value="{{.Diff.NumViewedFiles}}" max="{{.Diff.NumFiles}}"></progress> |
| 37 | + <label for="viewed-files-summary" id="viewed-files-summary-label" class="gt-f1 gt-whitespace-nowrap not-mobile" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}"> |
38 | 38 | {{.locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}}
|
39 | 39 | </label>
|
40 | 40 | {{end}}
|
|
85 | 85 | {{$isCsv := (call $.IsCsvFile $file)}}
|
86 | 86 | {{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}}
|
87 | 87 | {{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}}
|
| 88 | + {{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived)}} |
88 | 89 | <div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}} gt-mt-3" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}>
|
89 |
| - <h4 class="diff-file-header sticky-2nd-row ui top attached normal header gt-df gt-ac gt-sb"> |
90 |
| - <div class="diff-file-name gt-df gt-ac gt-mr-3"> |
| 90 | + <h4 class="diff-file-header sticky-2nd-row ui top attached normal header gt-df gt-ac gt-sb gt-fw"> |
| 91 | + <div class="diff-file-name gt-df gt-ac gt-gap-2 gt-fw"> |
91 | 92 | <button class="fold-file ui button button-ghost gt-p-0 gt-mr-3{{if not $isExpandable}} gt-invisible{{end}}">
|
92 | 93 | {{if $file.ShouldBeHidden}}
|
93 | 94 | {{svg "octicon-chevron-right" 18}}
|
|
105 | 106 | {{end}}
|
106 | 107 | </div>
|
107 | 108 | <span class="file gt-mono"><a class="muted file-link" title="{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}" href="#diff-{{$file.NameHash}}">{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}</a>{{if .IsLFSFile}} ({{$.locale.Tr "repo.stored_lfs"}}){{end}}</span>
|
| 109 | + <button class="ui button button-link gt-p-3" data-clipboard-text="{{$file.Name}}">{{svg "octicon-copy" 14}}</button> |
108 | 110 | {{if $file.IsGenerated}}
|
109 |
| - <span class="ui label gt-ml-3">{{$.locale.Tr "repo.diff.generated"}}</span> |
| 111 | + <span class="ui label">{{$.locale.Tr "repo.diff.generated"}}</span> |
110 | 112 | {{end}}
|
111 | 113 | {{if $file.IsVendored}}
|
112 |
| - <span class="ui label gt-ml-3">{{$.locale.Tr "repo.diff.vendored"}}</span> |
| 114 | + <span class="ui label">{{$.locale.Tr "repo.diff.vendored"}}</span> |
113 | 115 | {{end}}
|
114 | 116 | {{if and $file.Mode $file.OldMode}}
|
115 | 117 | <span class="gt-ml-4 gt-mono">{{$file.OldMode}} → {{$file.Mode}}</span>
|
116 | 118 | {{else if $file.Mode}}
|
117 | 119 | <span class="gt-ml-4 gt-mono">{{$file.Mode}}</span>
|
118 | 120 | {{end}}
|
119 | 121 | </div>
|
120 |
| - <div class="diff-file-header-actions gt-df gt-ac"> |
| 122 | + <div class="diff-file-header-actions gt-df gt-ac gt-gap-2 gt-fw"> |
121 | 123 | {{if $showFileViewToggle}}
|
122 | 124 | <div class="ui compact icon buttons">
|
123 | 125 | <button class="ui tiny basic button file-view-toggle" data-toggle-selector="#diff-source-{{$file.NameHash}}" data-tooltip-content="{{$.locale.Tr "repo.file_view_source"}}">{{svg "octicon-code"}}</button>
|
|
127 | 129 | {{if $file.IsProtected}}
|
128 | 130 | <span class="ui basic label">{{$.locale.Tr "repo.diff.protected"}}</span>
|
129 | 131 | {{end}}
|
| 132 | + {{if and $isReviewFile $file.HasChangedSinceLastReview}} |
| 133 | + <span class="changed-since-last-review unselectable not-mobile">{{$.locale.Tr "repo.pulls.has_changed_since_last_review"}}</span> |
| 134 | + {{end}} |
130 | 135 | {{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}}
|
131 |
| - <button class="ui basic tiny button unescape-button">{{$.locale.Tr "repo.unescape_control_characters"}}</button> |
| 136 | + <button class="ui basic tiny button unescape-button not-mobile">{{$.locale.Tr "repo.unescape_control_characters"}}</button> |
132 | 137 | <button class="ui basic tiny button escape-button gt-hidden">{{$.locale.Tr "repo.escape_control_characters"}}</button>
|
133 | 138 | {{end}}
|
134 | 139 | {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}}
|
|
138 | 143 | <a class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{$.locale.Tr "repo.diff.view_file"}}</a>
|
139 | 144 | {{end}}
|
140 | 145 | {{end}}
|
141 |
| - {{if and $.IsSigned $.PageIsPullFiles (not $.IsArchived)}} |
142 |
| - {{if $file.HasChangedSinceLastReview}} |
143 |
| - <span class="changed-since-last-review unselectable">{{$.locale.Tr "repo.pulls.has_changed_since_last_review"}}</span> |
144 |
| - {{end}} |
| 146 | + {{if $isReviewFile}} |
145 | 147 | <label data-link="{{$.Issue.Link}}/viewed-files" data-headcommit="{{$.PullHeadCommitID}}" class="viewed-file-form unselectable{{if $file.IsViewed}} viewed-file-checked-form{{end}}">
|
146 | 148 | <input type="checkbox" name="{{$file.GetDiffFileName}}" autocomplete="off"{{if $file.IsViewed}} checked{{end}}> {{$.locale.Tr "repo.pulls.has_viewed_file"}}
|
147 | 149 | </label>
|
|
0 commit comments