| 1 | {{ define "page" -}} |
| 2 | <section class="shithub-branches"> |
| 3 | <header class="shithub-code-head"> |
| 4 | <h1> |
| 5 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .DefaultBranch }}">{{ .Owner }}/{{ .Repo.Name }}</a> |
| 6 | <span class="shithub-code-sep">/</span> |
| 7 | Branches |
| 8 | </h1> |
| 9 | <nav class="shithub-branches-filter"> |
| 10 | <a href="?filter=" class="shithub-button {{ if eq .Filter "" }}shithub-button-primary{{ end }}">All</a> |
| 11 | <a href="?filter=active" class="shithub-button {{ if eq .Filter "active" }}shithub-button-primary{{ end }}">Active</a> |
| 12 | <a href="?filter=stale" class="shithub-button {{ if eq .Filter "stale" }}shithub-button-primary{{ end }}">Stale</a> |
| 13 | </nav> |
| 14 | </header> |
| 15 | |
| 16 | <table class="shithub-branches-table"> |
| 17 | <thead> |
| 18 | <tr> |
| 19 | <th>Branch</th> |
| 20 | <th>Last commit</th> |
| 21 | <th>vs <code>{{ .DefaultBranch }}</code></th> |
| 22 | <th></th> |
| 23 | </tr> |
| 24 | </thead> |
| 25 | <tbody> |
| 26 | {{ range .Rows }} |
| 27 | <tr> |
| 28 | <td> |
| 29 | <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/tree/{{ .Name }}"><code>{{ .Name }}</code></a> |
| 30 | {{ if .IsDefault }}<span class="shithub-pill">default</span>{{ end }} |
| 31 | {{ if .Protected }}<span class="shithub-pill shithub-pill-private">protected</span>{{ end }} |
| 32 | </td> |
| 33 | <td> |
| 34 | {{ if .LastSubject }} |
| 35 | <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/commit/{{ .OID }}" class="shithub-branches-subject">{{ .LastSubject }}</a> |
| 36 | <small><time datetime="{{ .LastWhen.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .LastWhen }}</time></small> |
| 37 | {{ end }} |
| 38 | </td> |
| 39 | <td> |
| 40 | {{ if .IsDefault }}—{{ else }}<span class="shithub-add">+{{ .Ahead }}</span> <span class="shithub-del">−{{ .Behind }}</span>{{ end }} |
| 41 | </td> |
| 42 | <td> |
| 43 | {{ if not .IsDefault }} |
| 44 | <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/compare/{{ $.DefaultBranch }}...{{ .Name }}" class="shithub-button">Compare</a> |
| 45 | {{ end }} |
| 46 | </td> |
| 47 | </tr> |
| 48 | {{ end }} |
| 49 | </tbody> |
| 50 | </table> |
| 51 | </section> |
| 52 | {{- end }} |