{{template "base/head" .}}
{{template "repo/header" .}}
{{if .IsDiffCompare }} {{template "repo/commits_table" .}} {{else}}

{{RenderCommitMessage .Commit.Message $.RepoLink}}

{{if .Author}} {{.Commit.Author.Name}} {{else}} {{.Commit.Author.Name}} {{end}} {{TimeSince .Commit.Author.When $.Lang}}
{{.i18n.Tr "repo.diff.parent"}}
{{range .Parents}} {{ShortSha .}} {{end}}
{{.i18n.Tr "repo.diff.commit"}}
{{ShortSha .CommitId}}
{{end}} {{if .DiffNotAvailable}}

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

{{else}}
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
    {{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 not $file.IsBin}} + {{.Addition}} - {{.Deletion}} {{else}} {{$.i18n.Tr "repo.diff.bin"}} {{end}}
{{$file.Name}}

{{$isImage := (call $.IsImageFile $file.Name)}} {{if $isImage}}
{{else}}
{{range .Sections}} {{range $k, $line := .Lines}} {{end}} {{end}}
{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}} {{if $line.RightIdx}}{{$line.RightIdx}}{{end}}
{{$line.Content}}
{{end}}

{{end}} {{end}}
{{template "base/footer" .}}