bidet / internal / handlers / templates / refs.tmpl

@ ea3ad75a48086bec94087d2bd6722af3943eeb2c | history


{{define "title"}}refs - {{.Repo}}{{end}}
{{define "content"}}
<h1><a href="/{{.Repo}}">{{.Repo}}</a></h1>

<h2>
  {{if and (eq .Type "branches") (gt (len .Tags) 0)}}
    branches | <a href="/{{.Repo}}/refs/tags">tags</a>
  {{else if eq .Type "branches"}}
    branches
  {{else if eq .Type "tags"}}
    <a href="/{{.Repo}}/refs/branches">branches</a> | tags
  {{end}}
</h2>

<ul>
  {{if eq .Type "branches"}}
    {{range .Branches}}
    <li><a href="/{{$.Repo}}/tree/{{.Name}}">{{.Name}}</a></li>
    {{end}}
  {{else if eq .Type "tags"}}
    {{range .Tags}}
    <li><a href="/{{$.Repo}}/tree/{{.Name}}">{{.Name}}</a></li>
    {{ if ne .Annotation "" }}<pre>{{ .Annotation }}</pre>{{ end }}
    {{end}}
  {{else}}
  {{end}}
</ul>
{{end}}

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