bidet / internal / handlers / templates / commits.tmpl

@ c362fc5ff73740244ceaacba31cdae3e6098ac04 | history


{{define "title"}}{{.Repo}} @ {{.RefLabel}}{{end}}
{{define "content"}}
<h1><a href="/{{.Repo}}/tree/{{.RefLabel}}">{{.Repo}}</a></h1>
{{- if eq .Crumbs nil -}}
<p>@ {{.RefLabel}}</p>
{{- else -}}
<h3>history for {{range $i, $c := .Crumbs}}
  {{if $i}} / {{end}}
  {{if eq $i (sub (len $.Crumbs) 1)}}
    {{$c.Name}}
  {{else}}
    <a href="/{{$c.URL}}">{{$c.Name}}</a>
  {{end}}
{{end}} @ <a href="/{{.Repo}}/tree/{{.RefLabel}}">{{.RefLabel}}</a></h3>
{{- end -}}
<p><a href="/{{.Repo}}/refs">refs</a></p>
<h2>commits</h2>
{{ range .Commits }}
    <p><a href="/{{$.Repo}}/commit/{{.Hash}}">{{.Hash}}</a></p>
    <p>{{.Author}} | <span title="{{rfc3339 .When}}">{{humanize .When}}</span> </p>
    <pre>{{.Message}}</pre>
{{end}}
{{- if or .PrevPage .NextPage -}}
    <p>
        {{- if .PrevPage -}}
            <a href="/{{.Repo}}/commits/{{.RefLabel}}/{{.Path}}?before={{.PrevPage.AnchorHash}}+{{.PrevPage.Offset}}">&lt;-- previous</a>
        {{- end -}}
        {{- if and .PrevPage .NextPage }} | {{ end -}}
        {{- if .NextPage -}}
            <a href="/{{.Repo}}/commits/{{.RefLabel}}/{{.Path}}?after={{.NextPage.AnchorHash}}+{{.NextPage.Offset}}">next --&gt;</a>
        {{- end -}}
    </p>
    <br>
{{end}}
{{end}}

{{define "commits"}}
{{template "base" .}}
{{end}}