bidet / internal / handlers / templates / refs.tmpl

@ 211fd0009b9dd8e579158ff492f92736e00cf03f | 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}}