projects

showcase

A public git mirror

refs.html 1.5 KB · 28 lines Raw
{{define "content" -}}{{template "repohead" .}}{{- $r := .Repo}}{{$kind := .Kind}}<section class="box">  <h2 class="box-head">{{if eq $kind "tags"}}{{template "icon" "tag"}}{{else}}{{template "icon" "branch"}}{{end}}{{len .Refs}} {{if eq (len .Refs) 1}}{{slice $kind 0 (len $kind | dec)}}{{else}}{{$kind}}{{end}}</h2>  {{- if .Refs}}  <ol class="rows">    {{- range .Refs}}{{$href := $r.CommitHref .Hash}}    <li class="row">      <span class="pkg-icon">{{if eq $kind "tags"}}{{template "icon" "tag"}}{{else}}{{template "icon" "branch"}}{{end}}</span>      <div class="row-main">        <span class="row-title">          {{- if and (eq $kind "branches") (eq .Name $r.DefaultBranch)}}<a href="/{{$r.Name}}/">{{.Name}}</a><span class="badge">default</span>          {{- else if and (eq $kind "tags") ($r.Release .Name)}}<a href="/{{$r.Name}}/releases/#{{.Name}}">{{.Name}}</a>          {{- else}}{{.Name}}{{end}}</span>        <span class="row-sub">{{if $href}}<a href="{{$href}}">{{.Subject}}</a>{{else}}{{.Subject}}{{end}}</span>      </div>      <time class="{{fresh .When}}" datetime="{{.When.Format "2006-01-02T15:04:05Z07:00"}}">{{ago .When}}</time>      {{template "sha" (dict "R" $r "Hash" .Hash "Href" $href)}}    </li>    {{- end}}  </ol>  {{- else}}  <p class="box-note empty-inline">{{template "icon" (or (and (eq $kind "tags") "tag") "branch")}}None yet.</p>  {{- end}}</section>{{- if eq $kind "branches"}}<p class="hint">Only the default branch is browsable here. Clone the repository for the others.</p>{{end}}{{- end}}