bidet / internal / handlers / templates / refs.tmpl

@ a2cf096eba70b87eb52429e3f17c014e386de87e | history


{{define "title"}}{{.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>
    {{end}}
  {{else}}
  {{end}}
</ul>
{{end}}

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