- {{if or $file.IsIncomplete $file.IsBin}}
-
- {{if $file.IsIncomplete}}
- {{if $file.IsIncompleteLineTooLong}}
- {{$.locale.Tr "repo.diff.file_suppressed_line_too_long"}}
- {{else}}
- {{$.locale.Tr "repo.diff.file_suppressed"}}
-
{{$.locale.Tr "repo.diff.load"}}
- {{end}}
- {{else}}
- {{$.locale.Tr "repo.diff.bin_not_shown"}}
- {{end}}
-
+ {{end}}
+
+ {{if .DiffNotAvailable}}
+
{{.locale.Tr "repo.diff.data_not_available"}}
+ {{else}}
+
+
+
+ {{range $i, $file := .Diff.Files}}
+ {{/*notice: the index of Diff.Files should not be used for element ID, because the index will be restarted from 0 when doing load-more for PRs with a lot of files*/}}
+ {{$blobBase := call $.GetBlobByPathForCommit $.BeforeCommit $file.OldName}}
+ {{$blobHead := call $.GetBlobByPathForCommit $.HeadCommit $file.Name}}
+ {{$isImage := or (call $.IsBlobAnImage $blobBase) (call $.IsBlobAnImage $blobHead)}}
+ {{$isCsv := (call $.IsCsvFile $file)}}
+ {{$showFileViewToggle := or $isImage (and (not $file.IsIncomplete) $isCsv)}}
+ {{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}}
+ {{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived)}}
+
+
+
+
+ {{if or $file.IsIncomplete $file.IsBin}}
+
+ {{if $file.IsIncomplete}}
+ {{if $file.IsIncompleteLineTooLong}}
+ {{$.locale.Tr "repo.diff.file_suppressed_line_too_long"}}
+ {{else}}
+ {{$.locale.Tr "repo.diff.file_suppressed"}}
+
{{$.locale.Tr "repo.diff.load"}}
+ {{end}}
+ {{else}}
+ {{$.locale.Tr "repo.diff.bin_not_shown"}}
+ {{end}}
+
+ {{else}}
+
+ {{if $.IsSplitStyle}}
+ {{template "repo/diff/section_split" dict "file" . "root" $}}
+ {{else}}
+ {{template "repo/diff/section_unified" dict "file" . "root" $}}
+ {{end}}
+
+ {{end}}
+
+ {{if $showFileViewToggle}}
+ {{/* for image or CSV, it can have a horizontal scroll bar, there won't be review comment context menu (position absolute) which would be clipped by "overflow" */}}
+
+
+ {{if $isImage}}
+ {{template "repo/diff/image_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead}}
+ {{else}}
+ {{template "repo/diff/csv_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead}}
+ {{end}}
+
+
+ {{end}}
- {{end}}
-
- {{if .Diff.IsIncomplete}}
-
-
-
- {{end}}
-
-
-
- {{if not $.Repository.IsArchived}}
-
- {{end}}
+ {{end}}
- {{template "repo/issue/view_content/reference_issue_dialog" .}}
+ {{if .Diff.IsIncomplete}}
+
+
+
+ {{end}}
+
+ {{end}}
-{{end}}
+
+ {{if and (not $.Repository.IsArchived) (not .DiffNotAvailable)}}
+
+ {{end}}
+ {{if (not .DiffNotAvailable)}}
+ {{template "repo/issue/view_content/reference_issue_dialog" .}}
+ {{end}}
+