{{ define "content" }}
{{ template "gist_header" . }} {{ if ne (len .commits) 0 }}
{{ range $commit := .commits }}

{{ $user := $commit.User }} {{ if not (shouldGenerateAvatar $user $.DisableGravatar) }} {{ else }} {{ end }} {{ if $user }}{{ $user.Username }}{{ else }}{{ $commit.AuthorName }}{{ end }} {{ $.locale.Tr "gist.revision.revised" }} {{ $commit.Timestamp | humanTimeDiffStr }} ยท {{ slice $commit.Hash 0 7 }}

{{ if gt $commit.FilesChanged 0 }}

{{ $commit.FilesChanged }} {{ if eq $commit.FilesChanged 1 }}file{{ else }}files{{ end }} changed{{ if gt $commit.Additions 0 }}, {{ $commit.Additions }} {{ if eq $commit.Additions 1 }}insertion{{ else }}insertions{{ end }}{{ end }}{{ if gt $commit.Deletions 0 }}, {{ $commit.Deletions }} {{ if eq $commit.Deletions 1 }}deletion{{ else }}deletions{{ end }}{{ end }}

{{ end }}
{{ if ne (len $commit.Files) 0 }}
{{ range $file := $commit.Files }}
{{ if $file.IsCreated }} {{ $file.Filename }} ({{ $.locale.Tr "gist.revision.file-created" }}) {{ else if $file.IsDeleted }} {{ $file.Filename }} ({{ $.locale.Tr "gist.revision.file-deleted" }}) {{ else if ne $file.OldFilename $file.Filename }} {{ $file.OldFilename }} {{ $.locale.Tr "gist.revision.file-renamed" }} {{ $file.Filename }} {{ else }} {{ $file.Filename }} {{ end }}
{{ if $file.Truncated }}

{{ $.locale.Tr "gist.revision.diff-truncated" }}

{{ else if $file.IsBinary }}

{{ $.locale.Tr "gist.revision.binary-file-changes" }}

{{ else if and (eq $file.Content "") (ne $file.OldFilename "") }}

{{ $.locale.Tr "gist.revision.file-renamed-no-changes" }}

{{ else if eq $file.Content "" }}

{{ $.locale.Tr "gist.revision.empty-file" }}

{{ else }} {{ $left := 0 }} {{ $right := 0 }} {{ range $line := split $file.Content "\n" }} {{ if ne $line "" }}{{ if ne (index $line 0) 92 }} {{ if eq (index $line 0) 64 }} {{ $left = toInt (index (splitGit (index (split $line "-") 1)) 0) }} {{ $right = toInt (index (splitGit (index (split $line "+") 1)) 0) }} {{ end }} {{ if eq (index $line 0) 64 }} {{ else }} {{ if eq (index $line 0) 43 }} {{ $right = inc $right }} {{ else if eq (index $line 0) 45 }} {{ $left = inc $left }} {{ else if eq (index $line 0) 32 }} {{ $left = inc $left }} {{ $right = inc $right }} {{ end }} {{ end }} {{ end }}{{ end }}{{ end }}
{{ $right }}{{ $left }} {{ $left }} {{ $right }}{{ if ne (index $line 0) 64 }}{{ slice $line 0 1 }}{{ end }} {{ if ne (index $line 0) 64 }}{{ slice $line 1 }}{{ else }}{{ $line }}{{ end }}
{{ end }}
{{ end }}
{{ else }}

{{ $.locale.Tr "gist.revision.no-changes" }}

{{ end }}
{{ end }}
{{ template "pagination" . }} {{ else }}

{{ .locale.Tr "gist.revision.no-revisions" }}

{{ end }}
{{ end }}