| 1 | {{ define "page" -}} |
| 2 | <section class="shithub-repo-page"> |
| 3 | <header class="shithub-repo-page-head"> |
| 4 | <h1 class="shithub-repo-page-title"> |
| 5 | <a href="/{{ .Owner }}">{{ .Owner }}</a> |
| 6 | <span class="shithub-code-sep">/</span> |
| 7 | <a href="/{{ .Owner }}/{{ .Repo.Name }}">{{ .Repo.Name }}</a> |
| 8 | {{ if eq (printf "%s" .Repo.Visibility) "private" }}<span class="shithub-pill shithub-pill-private">private</span>{{ else }}<span class="shithub-pill">public</span>{{ end }} |
| 9 | </h1> |
| 10 | </header> |
| 11 | {{ template "repo-subnav" . }} |
| 12 | |
| 13 | <section class="shithub-code"> |
| 14 | <header class="shithub-code-head"> |
| 15 | <nav class="shithub-code-crumbs" aria-label="Breadcrumb"> |
| 16 | {{ range $i, $c := .Crumbs }} |
| 17 | {{ if $i }}<span class="shithub-code-sep">/</span>{{ end }} |
| 18 | <a href="{{ $c.URL }}">{{ $c.Name }}</a> |
| 19 | {{ end }} |
| 20 | </nav> |
| 21 | <div class="shithub-code-actions"> |
| 22 | <details class="shithub-ref-switcher"> |
| 23 | <summary>{{ .Ref }}</summary> |
| 24 | <div class="shithub-ref-panel"> |
| 25 | {{ if .Branches }} |
| 26 | <strong>Branches</strong> |
| 27 | {{ range .Branches }} |
| 28 | <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/tree/{{ .Name }}">{{ .Name }}</a> |
| 29 | {{ end }} |
| 30 | {{ end }} |
| 31 | {{ if .Tags }} |
| 32 | <strong>Tags</strong> |
| 33 | {{ range .Tags }} |
| 34 | <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/tree/{{ .Name }}">{{ .Name }}</a> |
| 35 | {{ end }} |
| 36 | {{ end }} |
| 37 | </div> |
| 38 | </details> |
| 39 | <a href="/{{ .Owner }}/{{ .Repo.Name }}/find/{{ .Ref }}" class="shithub-button">Go to file</a> |
| 40 | <details class="shithub-clone-dropdown"> |
| 41 | <summary class="shithub-button shithub-button-primary">{{ octicon "download" }} Code</summary> |
| 42 | <div class="shithub-clone-panel" role="dialog" aria-label="Clone this repository"> |
| 43 | <div class="shithub-clone-row"> |
| 44 | <label for="clone-https">Clone with HTTPS</label> |
| 45 | <div class="shithub-clone-input"> |
| 46 | <input id="clone-https" type="text" readonly value="{{ .HTTPSCloneURL }}" onclick="this.select()"> |
| 47 | <button type="button" class="shithub-button" data-clone-copy="#clone-https" title="Copy">{{ octicon "copy" }}</button> |
| 48 | </div> |
| 49 | </div> |
| 50 | {{ if .SSHEnabled }} |
| 51 | <div class="shithub-clone-row"> |
| 52 | <label for="clone-ssh">Clone with SSH</label> |
| 53 | <div class="shithub-clone-input"> |
| 54 | <input id="clone-ssh" type="text" readonly value="{{ .SSHCloneURL }}" onclick="this.select()"> |
| 55 | <button type="button" class="shithub-button" data-clone-copy="#clone-ssh" title="Copy">{{ octicon "copy" }}</button> |
| 56 | </div> |
| 57 | </div> |
| 58 | {{ end }} |
| 59 | <p class="shithub-clone-hint">Use Git or checkout with SVN using the web URL.</p> |
| 60 | </div> |
| 61 | </details> |
| 62 | </div> |
| 63 | </header> |
| 64 | |
| 65 | <table class="shithub-tree"> |
| 66 | <tbody> |
| 67 | {{ range .Entries }} |
| 68 | <tr> |
| 69 | <td class="shithub-tree-icon" aria-hidden="true"> |
| 70 | {{ if eq (printf "%s" .Kind) "tree" }}{{ octicon "directory" }} |
| 71 | {{ else if eq (printf "%s" .Kind) "commit" }}{{ octicon "submodule" }} |
| 72 | {{ else if eq (printf "%s" .Kind) "symlink" }}{{ octicon "symlink" }} |
| 73 | {{ else }}{{ octicon "file" }}{{ end }} |
| 74 | </td> |
| 75 | <td class="shithub-tree-name"> |
| 76 | {{ if eq (printf "%s" .Kind) "tree" }} |
| 77 | <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/tree/{{ $.Ref }}/{{ if $.Path }}{{ $.Path }}/{{ end }}{{ .Name }}">{{ .Name }}</a> |
| 78 | {{ else if eq (printf "%s" .Kind) "blob" }} |
| 79 | <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/blob/{{ $.Ref }}/{{ if $.Path }}{{ $.Path }}/{{ end }}{{ .Name }}">{{ .Name }}</a> |
| 80 | {{ else if eq (printf "%s" .Kind) "symlink" }} |
| 81 | {{ .Name }} <em class="shithub-tree-symlink">(symlink)</em> |
| 82 | {{ else }} |
| 83 | {{ .Name }} <em class="shithub-tree-submodule">@ {{ slice .OID 0 7 }}</em> |
| 84 | {{ end }} |
| 85 | </td> |
| 86 | <td class="shithub-tree-size">{{ if gt .Size 0 }}{{ .Size }}{{ end }}</td> |
| 87 | </tr> |
| 88 | {{ end }} |
| 89 | </tbody> |
| 90 | </table> |
| 91 | |
| 92 | </section> |
| 93 | {{ if .README }} |
| 94 | <section class="shithub-readme" aria-label="README"> |
| 95 | {{ .README }} |
| 96 | </section> |
| 97 | {{ end }} |
| 98 | </section> |
| 99 | {{- end }} |