all repos — legit @ b97e2ba81f0f58e7b2029dacea2b4c0eb43c9403

web frontend for git, written in go

templates/commit.html (view raw)

{{ define "commit" }}


{{ template "head" . }}

  
    {{ template "repoheader" . }}
    {{ template "nav" . }}
    
      
          {{- .commit.Message -}}
        
{{ .commit.Author.Name }} {{ .commit.Author.Email}}
{{ .commit.Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}
commit

{{ .commit.This }}

{{ if .commit.Parent }}
parent

{{ .commit.Parent }}

{{ end }}
{{ .stat.FilesChanged }} files changed, {{ .stat.Insertions }} insertions(+), {{ .stat.Deletions }} deletions(-)

jump to
    {{ range .diff }}
  • {{ .Name.New }}
  • {{ end }}
{{ $repo := .name }} {{ $this := .commit.This }} {{ $parent := .commit.Parent }} {{ range .diff }}
{{ if .IsNew }} A {{ end }} {{ if .IsDelete }} D {{ end }} {{ if not (or .IsNew .IsDelete) }} M {{ end }} {{ if .Name.Old }} {{ .Name.Old }} {{ if .Name.New }} → {{ .Name.New }} {{ end }} {{ else }} {{ .Name.New }} {{- end -}} {{ if .IsBinary }}

Not showing binary file.

{{ else }}
{{- .Header -}}
            {{- range .TextFragments -}}
            {{- range .Lines -}}
              {{- if eq .Op.String "+" -}}
              {{ .String }}
              {{- end -}}
              {{- if eq .Op.String "-" -}}
              {{ .String }}
              {{- end -}}
              {{- if eq .Op.String " " -}}
              {{ .String }}
              {{- end -}}
            {{- end -}}
            {{- end -}}
          {{- end -}}
            
{{ end }}
{{ end }}