{{define "commit"}} {{template "layout-start" .}}

{{.Commit.Subject}}

{{if .Commit.Body}}
{{.Commit.Body}}
{{end}}
{{template "avatar" .Commit}}

{{template "commitwho" .Commit}}

{{t "commit.authored"}} {{.Commit.Date}}{{if .Commit.When}} · {{.Commit.When}}{{end}}

{{t "commit.sha"}}
{{.Commit.SHA}}
{{if .CommitDiff.Parents}}
{{if eq (len .CommitDiff.Parents) 1}}{{t "commit.parent"}}{{else}}{{t "commit.parents"}}{{end}}
{{range .CommitDiff.Parents}}{{.Short}}{{end}}
{{end}} {{if .Commit.PipeStatus}}
{{t "pipe.one"}}
{{.Commit.PipeLabel}}
{{end}}
{{if not .CommitDiff.Files}}

{{t "commit.empty"}}

{{else}} {{template "repodiff" .}} {{end}}
{{template "layout-end" .}} {{end}} {{define "repodiff"}}
{{tn .CommitDiff.FilesN "commit.file.one" "commit.file.many"}} +{{.CommitDiff.Added}} −{{.CommitDiff.Deleted}}
{{range .CommitDiff.Files}}
{{if .HasBody}}{{end}} {{if .OldPath}}{{.OldPath}} {{end}}{{if .FileURL}}{{.Path}}{{else}}{{.Path}}{{end}} {{if eq .Status "added"}}{{t "commit.added"}}{{else if eq .Status "deleted"}}{{t "commit.deleted"}}{{else if eq .Status "renamed"}}{{t "commit.renamed"}}{{end}} {{if .Binary}}{{t "commit.binary"}}{{end}} +{{.Added}} −{{.Deleted}}
{{if .HasBody}}
{{if .Binary}}

{{t "commit.binaryHint"}}

{{else}}
{{range .Lines}}
{{if and $.CanComment (ne .Kind "hunk")}}{{end}} {{if .Old}}{{.Old}}{{end}} {{if .New}}{{.New}}{{end}} {{.HTML}}
{{if $.CanComment}}{{range .Notes}}
{{.Author}} {{.When}}
{{.HTML}}
{{if and $.CanApply .HasSuggestion}}{{end}} {{range .Replies}}
{{.Author}} {{.When}}
{{.HTML}}
{{end}}
{{end}}{{end}} {{end}}
{{range .Pairs}} {{if .Hunk}}
{{.Hunk}}
{{else}}
{{if .LNo}}{{.LNo}}{{end}}{{.LHTML}}
{{if .RNo}}{{.RNo}}{{end}}{{.RHTML}}
{{end}} {{end}}
{{end}}
{{end}}
{{end}}
{{end}}