{{if .DiffNotAvailable}}
{{template "repo/diff/whitespace_dropdown" .}} {{template "repo/diff/options_dropdown" .}} {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} {{template "repo/diff/new_review" .}} {{end}}

{{.i18n.Tr "repo.diff.data_not_available"}}

{{else}}
{{svg "octicon-diff" 16 "mr-2"}}{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
{{template "repo/diff/whitespace_dropdown" .}} {{template "repo/diff/options_dropdown" .}} {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} {{template "repo/diff/new_review" .}} {{end}}
    {{range .Diff.Files}}
  1. {{if .IsBin}} {{$.i18n.Tr "repo.diff.bin"}} {{else}} {{template "repo/diff/stats" dict "file" . "root" $}} {{end}}
      {{.Name}}
  2. {{end}} {{if .Diff.IsIncomplete}}
  3. {{$.i18n.Tr "repo.diff.too_many_files"}} {{.i18n.Tr "repo.diff.show_more"}}
  4. {{end}}
{{range $i, $file := .Diff.Files}} {{$blobBase := call $.GetBlobByPathForCommit $.BaseCommit $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)}} {{$nameHash := Sha1 $file.Name}}

{{if $file.IsGenerated}} {{svg "octicon-chevron-right" 18}} {{else}} {{svg "octicon-chevron-down" 18}} {{end}}
{{if $file.IsBin}} {{$.i18n.Tr "repo.diff.bin"}} {{else}} {{template "repo/diff/stats" dict "file" . "root" $}} {{end}}
{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.i18n.Tr "repo.stored_lfs"}}){{end}} {{if $file.IsGenerated}} {{$.i18n.Tr "repo.diff.generated"}} {{end}} {{if $file.IsVendored}} {{$.i18n.Tr "repo.diff.vendored"}} {{end}}
{{if $showFileViewToggle}}
{{svg "octicon-code"}} {{svg "octicon-file"}}
{{end}} {{if $file.IsProtected}} {{$.i18n.Tr "repo.diff.protected"}} {{end}} {{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}} {{$.i18n.Tr "repo.unescape_control_characters"}} {{end}} {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} {{if $file.IsDeleted}} {{$.i18n.Tr "repo.diff.view_file"}} {{else}} {{$.i18n.Tr "repo.diff.view_file"}} {{end}} {{end}}

{{if or $file.IsIncomplete $file.IsBin}}
{{if $file.IsIncomplete}} {{if $file.IsIncompleteLineTooLong}} {{$.i18n.Tr "repo.diff.file_suppressed_line_too_long"}} {{else}} {{$.i18n.Tr "repo.diff.file_suppressed"}} {{$.i18n.Tr "repo.diff.load"}} {{end}} {{else}} {{$.i18n.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}}
{{if $isImage}} {{template "repo/diff/image_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead}} {{else}} {{template "repo/diff/csv_diff" dict "file" . "root" $}} {{end}}
{{end}}
{{end}} {{if .Diff.IsIncomplete}}

{{$.i18n.Tr "repo.diff.too_many_files"}} {{.i18n.Tr "repo.diff.show_more"}}

{{end}}
{{if not $.Repository.IsArchived}}
{{$.i18n.Tr "loading"}}
{{.i18n.Tr "repo.issues.cancel"}}
{{.i18n.Tr "repo.issues.save"}}
{{end}} {{template "repo/issue/view_content/reference_issue_dialog" .}}
{{end}}