| 1 | {{ define "page" -}} |
| 2 | <section class="shithub-repo-page"> |
| 3 | {{ template "repo-header" . }} |
| 4 | <div class="shithub-social"> |
| 5 | <header class="shithub-social-subhead"> |
| 6 | <h1>Forks</h1> |
| 7 | <p>{{ .Total }} {{ if eq .Total 1 }}fork{{ else }}forks{{ end }}</p> |
| 8 | </header> |
| 9 | |
| 10 | {{ if .Forks }} |
| 11 | <ul class="shithub-social-list"> |
| 12 | {{ range .Forks }} |
| 13 | <li> |
| 14 | <a href="/{{ .OwnerUsername }}" class="shithub-social-avatar"><img src="/avatars/{{ .OwnerUsername }}" alt="" width="40" height="40"></a> |
| 15 | <div class="shithub-social-person"> |
| 16 | <a href="/{{ .OwnerUsername }}/{{ .Name }}"><strong>{{ .OwnerUsername }}/{{ .Name }}</strong></a> |
| 17 | {{ if .Description }}<span>{{ .Description }}</span>{{ end }} |
| 18 | <span class="shithub-social-fork-badges"> |
| 19 | {{ if eq .Visibility "private" }}<span class="shithub-pill shithub-pill-private">Private</span>{{ end }} |
| 20 | {{ if eq .InitStatus "init_pending" }}<span class="shithub-pill">Preparing</span>{{ end }} |
| 21 | {{ if eq .InitStatus "init_failed" }}<span class="shithub-pill shithub-pill-private">Failed</span>{{ end }} |
| 22 | </span> |
| 23 | </div> |
| 24 | <div class="shithub-social-meta"> |
| 25 | <span>{{ octicon "star" }} {{ .StarCount }}</span> |
| 26 | <span>{{ octicon "repo-forked" }} {{ .ForkCount }}</span> |
| 27 | <time datetime="{{ .CreatedAt.Format "2006-01-02T15:04:05Z" }}">Forked {{ relativeTime .CreatedAt }}</time> |
| 28 | </div> |
| 29 | </li> |
| 30 | {{ end }} |
| 31 | </ul> |
| 32 | {{ else }} |
| 33 | <div class="shithub-social-blank"> |
| 34 | {{ octicon "repo-forked" }} |
| 35 | <h2>No one has forked this repository yet</h2> |
| 36 | <p>Forks are a great way to contribute to a repository. After forking, you can send the original author a pull request.</p> |
| 37 | </div> |
| 38 | {{ end }} |
| 39 | |
| 40 | {{ if or .HasPrev .HasNext }} |
| 41 | <nav class="shithub-pagination"> |
| 42 | {{ if .HasPrev }}<a href="?page={{ sub .Page 1 }}" class="shithub-button">Previous</a>{{ end }} |
| 43 | {{ if .HasNext }}<a href="?page={{ add .Page 1 }}" class="shithub-button">Next</a>{{ end }} |
| 44 | </nav> |
| 45 | {{ end }} |
| 46 | </div> |
| 47 | </section> |
| 48 | {{- end }} |