{{if .DiffNotAvailable}}
{{if .PageIsPullFiles}} {{template "repo/diff/whitespace_dropdown" .}} {{else}} {{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}} {{end}} {{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}}
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
{{if .PageIsPullFiles}} {{template "repo/diff/whitespace_dropdown" .}} {{else}} {{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}} {{end}} {{template "repo/diff/options_dropdown" .}} {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} {{template "repo/diff/new_review" .}} {{end}}
    {{range .Diff.Files}}
  1. {{if not .IsBin}} +{{.Addition}}
    -{{.Deletion}} {{else}} {{$.i18n.Tr "repo.diff.bin"}} {{end}}
      {{.Name}}
  2. {{end}}
{{range $i, $file := .Diff.Files}} {{if $file.IsIncomplete}}

{{if not $file.IsRenamed}} + {{.Addition}}
- {{.Deletion}} {{end}}
{{$file.Name}}
{{$.i18n.Tr "repo.diff.file_suppressed"}}
{{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}}

{{else}}

{{$isImage := false}} {{if $file.IsDeleted}} {{$isImage = (call $.IsImageFileInBase $file.Name)}} {{else}} {{$isImage = (call $.IsImageFileInHead $file.Name)}} {{end}} {{if or (not $file.IsBin) $isImage}} {{end}}
{{if $file.IsBin}} {{$.i18n.Tr "repo.diff.bin"}} {{else if not $file.IsRenamed}} + {{.Addition}}
- {{.Deletion}} {{end}}
{{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}}{{if .IsLFSFile}} ({{$.i18n.Tr "repo.stored_lfs"}}){{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 ne $file.Type 4}}
{{if $isImage}} {{template "repo/diff/image_diff" dict "file" . "root" $}} {{else}} {{if $.IsSplitStyle}} {{$highlightClass := $file.GetHighlightClass}} {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} {{if eq .GetType 4}} {{else}} {{end}} {{if gt (len $line.Comments) 0}} {{$resolved := (index $line.Comments 0).IsResolved}} {{$resolveDoer := (index $line.Comments 0).ResolveDoer}} {{$isNotPending := false}} {{if (index $line.Comments 0).Review}} {{$isNotPending = (not (eq (index $line.Comments 0).Review.Type 0))}} {{end}} {{end}} {{end}} {{end}} {{else}} {{template "repo/diff/section_unified" dict "file" . "root" $}} {{end}} {{end}}
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} {{end}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} {{end}} {{if eq $line.GetExpandDirection 2}} {{svg "octicon-fold" 16}} {{end}} {{$section.GetComputedInlineDiffFor $line}} {{if $line.LeftIdx}}{{end}} {{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 2))}}+{{end}}{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}} {{if $line.RightIdx}}{{end}} {{if and $.SignedUserID $line.CanComment $.PageIsPullFiles (not (eq .GetType 3))}}+{{end}}{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}
{{if and $resolved (eq $line.GetCommentSide "previous")}}
{{$resolveDoer.Name}} {{$.i18n.Tr "repo.issues.review.resolved_by"}}
{{end}} {{if eq $line.GetCommentSide "previous"}}
{{ template "repo/diff/comments" dict "root" $ "comments" $line.Comments}}
{{template "repo/diff/comment_form_datahandler" dict "reply" (index $line.Comments 0).ReviewID "hidden" true "root" $ "comment" (index $line.Comments 0)}} {{if and $.CanMarkConversation $isNotPending}} {{end}}
{{end}}
{{if and $resolved (eq $line.GetCommentSide "proposed")}}
{{$resolveDoer.Name}} {{$.i18n.Tr "repo.issues.review.resolved_by"}}
{{end}} {{if eq $line.GetCommentSide "proposed"}}
{{ template "repo/diff/comments" dict "root" $ "comments" $line.Comments}}
{{template "repo/diff/comment_form_datahandler" dict "reply" (index $line.Comments 0).ReviewID "hidden" true "root" $ "comment" (index $line.Comments 0)}} {{if and $.CanMarkConversation $isNotPending}} {{end}}
{{end}}
{{end}}
{{end}}
{{end}} {{if .Diff.IsIncomplete}}

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

{{end}} {{if not $.Repository.IsArchived}}
{{template "repo/diff/new_comment" dict "root" .}}
{{$.i18n.Tr "loading"}}
{{.i18n.Tr "repo.issues.cancel"}}
{{.i18n.Tr "repo.issues.save"}}
{{end}} {{if .IsSplitStyle}} {{end}}
{{end}}