|
|
|
@ -1,20 +1,7 @@ |
|
|
|
|
{{if .DiffNotAvailable}} |
|
|
|
|
<div> |
|
|
|
|
<div class="diff-detail-box diff-box sticky"> |
|
|
|
|
<div class="ui right"> |
|
|
|
|
{{template "repo/diff/whitespace_dropdown" .}} |
|
|
|
|
{{template "repo/diff/options_dropdown" .}} |
|
|
|
|
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} |
|
|
|
|
{{template "repo/diff/new_review" .}} |
|
|
|
|
{{end}} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<h4>{{.locale.Tr "repo.diff.data_not_available"}}</h4> |
|
|
|
|
{{else}} |
|
|
|
|
<div> |
|
|
|
|
<div> |
|
|
|
|
<div class="diff-detail-box diff-box sticky gt-df gt-sb gt-ac gt-fw"> |
|
|
|
|
<div class="gt-df gt-ac gt-fw"> |
|
|
|
|
{{if not .DiffNotAvailable}} |
|
|
|
|
<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"}}"> |
|
|
|
|
{{/* the icon meaning is reversed here, "octicon-sidebar-collapse" means show the file tree */}} |
|
|
|
|
{{svg "octicon-sidebar-collapse" 20 "icon gt-hidden"}} |
|
|
|
@ -31,9 +18,10 @@ |
|
|
|
|
<div class="diff-detail-stats gt-df gt-ac gt-fw"> |
|
|
|
|
{{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} |
|
|
|
|
</div> |
|
|
|
|
{{end}} |
|
|
|
|
</div> |
|
|
|
|
<div class="diff-detail-actions gt-df gt-ac gt-gap-2 gt-fw"> |
|
|
|
|
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} |
|
|
|
|
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived) (not .DiffNotAvailable)}} |
|
|
|
|
<div class="gt-df gt-ac gt-fc gt-whitespace-nowrap gt-mr-2"> |
|
|
|
|
<label for="viewed-files-summary" id="viewed-files-summary-label" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}"> |
|
|
|
|
{{.locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}} |
|
|
|
@ -48,6 +36,7 @@ |
|
|
|
|
{{end}} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{{if not .DiffNotAvailable}} |
|
|
|
|
<script id="diff-data-script" type="module"> |
|
|
|
|
const diffDataFiles = [{{range $i, $file := .Diff.Files}}{Name:"{{$file.Name}}",NameHash:"{{$file.NameHash}}",Type:{{$file.Type}},IsBin:{{$file.IsBin}},Addition:{{$file.Addition}},Deletion:{{$file.Deletion}},IsViewed:{{$file.IsViewed}}},{{end}}]; |
|
|
|
|
const diffData = { |
|
|
|
@ -74,7 +63,11 @@ |
|
|
|
|
window.config.pageData.diffFileInfo = diffFileInfo; |
|
|
|
|
</script> |
|
|
|
|
<div id="diff-file-list"></div> |
|
|
|
|
{{end}} |
|
|
|
|
<div id="diff-container"> |
|
|
|
|
{{if .DiffNotAvailable}} |
|
|
|
|
<h4>{{.locale.Tr "repo.diff.data_not_available"}}</h4> |
|
|
|
|
{{else}} |
|
|
|
|
<div id="diff-file-tree" class="gt-hidden"></div> |
|
|
|
|
<script> |
|
|
|
|
if (diffTreeVisible) document.getElementById('diff-file-tree').classList.remove('gt-hidden'); |
|
|
|
@ -203,9 +196,10 @@ |
|
|
|
|
</div> |
|
|
|
|
{{end}} |
|
|
|
|
</div> |
|
|
|
|
{{end}} |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
{{if not $.Repository.IsArchived}} |
|
|
|
|
{{if and (not $.Repository.IsArchived) (not .DiffNotAvailable)}} |
|
|
|
|
<template id="issue-comment-editor-template"> |
|
|
|
|
<div class="ui comment form"> |
|
|
|
|
{{template "shared/combomarkdowneditor" (dict |
|
|
|
@ -222,7 +216,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
{{end}} |
|
|
|
|
|
|
|
|
|
{{if (not .DiffNotAvailable)}} |
|
|
|
|
{{template "repo/issue/view_content/reference_issue_dialog" .}} |
|
|
|
|
</div> |
|
|
|
|
{{end}} |
|
|
|
|
{{end}} |
|
|
|
|
</div> |
|
|
|
|