HTML · 11973 bytes Raw Blame History
1 {{ define "page" -}}
2 <section class="shithub-repo-page">
3 {{ template "repo-header" . }}
4
5 <div class="shithub-repo-content-grid">
6 <main class="shithub-repo-main">
7 <section class="shithub-code">
8 <header class="shithub-code-head">
9 <div class="shithub-code-primary-actions">
10 <details class="shithub-ref-switcher">
11 <summary>{{ octicon "git-branch" }} {{ .RefDisplay }}</summary>
12 <div class="shithub-ref-panel">
13 {{ if .Branches }}
14 <strong>Branches</strong>
15 {{ range .Branches }}
16 <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/tree/{{ .Name }}">{{ .Name }}</a>
17 {{ end }}
18 {{ end }}
19 {{ if .Tags }}
20 <strong>Tags</strong>
21 {{ range .Tags }}
22 <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/tree/{{ .Name }}">{{ .Name }}</a>
23 {{ end }}
24 {{ end }}
25 </div>
26 </details>
27 <a href="/{{ .Owner }}/{{ .Repo.Name }}/branches" class="shithub-code-count">{{ octicon "git-branch" }} {{ len .Branches }} Branches</a>
28 <a href="/{{ .Owner }}/{{ .Repo.Name }}/tags" class="shithub-code-count">{{ octicon "tag" }} {{ len .Tags }} Tags</a>
29 </div>
30 <div class="shithub-code-actions">
31 <a href="/{{ .Owner }}/{{ .Repo.Name }}/find/{{ .Ref }}" class="shithub-go-to-file">
32 {{ octicon "search" }}
33 <span>Go to file</span>
34 <kbd>T</kbd>
35 </a>
36 {{ if .CanWrite }}
37 <details class="shithub-add-file-dropdown">
38 <summary class="shithub-button">{{ octicon "plus" }} Add file {{ octicon "triangle-down" }}</summary>
39 <div class="shithub-add-file-panel" role="dialog" aria-label="Add file">
40 <a href="/{{ .Owner }}/{{ .Repo.Name }}/new/{{ .Ref }}/{{ .Path }}">{{ octicon "file" }} Create new file</a>
41 <a href="/{{ .Owner }}/{{ .Repo.Name }}/upload/{{ .Ref }}/{{ .Path }}">{{ octicon "upload" }} Upload files</a>
42 </div>
43 </details>
44 {{ end }}
45 <details class="shithub-clone-dropdown">
46 <summary class="shithub-button shithub-button-primary">{{ octicon "code" }} Code {{ octicon "triangle-down" }}</summary>
47 <div class="shithub-clone-panel" role="dialog" aria-label="Clone this repository">
48 <div class="shithub-clone-row">
49 <label for="clone-https">Clone with HTTPS</label>
50 <div class="shithub-clone-input">
51 <input id="clone-https" type="text" readonly value="{{ .HTTPSCloneURL }}" onclick="this.select()">
52 <button type="button" class="shithub-button" data-clone-copy="#clone-https" title="Copy">{{ octicon "copy" }}</button>
53 </div>
54 </div>
55 {{ if .SSHEnabled }}
56 <div class="shithub-clone-row">
57 <label for="clone-ssh">Clone with SSH</label>
58 <div class="shithub-clone-input">
59 <input id="clone-ssh" type="text" readonly value="{{ .SSHCloneURL }}" onclick="this.select()">
60 <button type="button" class="shithub-button" data-clone-copy="#clone-ssh" title="Copy">{{ octicon "copy" }}</button>
61 </div>
62 </div>
63 {{ end }}
64 <p class="shithub-clone-hint">Use Git or checkout with SVN using the web URL.</p>
65 </div>
66 </details>
67 </div>
68 </header>
69
70 {{ if .BranchCompare.Show }}
71 {{ if and .BranchCompare.HasRecentPush .HeadFound }}
72 <div class="shithub-branch-push-banner">
73 <div>
74 {{ octicon "git-pull-request" }}
75 <strong>{{ .BranchCompare.Head }}</strong> had recent pushes <time datetime="{{ .Head.AuthorWhen.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .Head.AuthorWhen }}</time>
76 </div>
77 <a href="{{ .BranchCompare.PullNewHref }}" class="shithub-button shithub-button-primary">Compare &amp; pull request</a>
78 </div>
79 {{ end }}
80 <div class="shithub-branch-compare-bar">
81 <div>
82 This branch is
83 <a href="{{ .BranchCompare.CompareHref }}">{{ .BranchCompare.Ahead }} {{ pluralize .BranchCompare.Ahead "commit" "commits" }} ahead</a>
84 of and
85 <a href="{{ .BranchCompare.CompareHref }}">{{ .BranchCompare.Behind }} {{ pluralize .BranchCompare.Behind "commit" "commits" }} behind</a>
86 <code>{{ .BranchCompare.Base }}</code>.
87 </div>
88 <details class="shithub-contribute-menu">
89 <summary class="shithub-button">{{ octicon "git-pull-request" }} Contribute {{ octicon "triangle-down" }}</summary>
90 <div class="shithub-contribute-menu-panel">
91 <div>
92 <strong>This branch is {{ .BranchCompare.Ahead }} {{ pluralize .BranchCompare.Ahead "commit" "commits" }} ahead of <code>{{ .BranchCompare.Base }}</code>.</strong>
93 <p>Open a pull request to contribute your changes upstream.</p>
94 </div>
95 <div class="shithub-contribute-actions">
96 <a href="{{ .BranchCompare.CompareHref }}" class="shithub-button">Compare</a>
97 {{ if gt .BranchCompare.Ahead 0 }}
98 <a href="{{ .BranchCompare.PullNewHref }}" class="shithub-button shithub-button-primary">Open pull request</a>
99 {{ else }}
100 <button type="button" class="shithub-button shithub-button-primary" disabled>Open pull request</button>
101 {{ end }}
102 </div>
103 </div>
104 </details>
105 </div>
106 {{ end }}
107
108 {{ if .Path }}
109 <nav class="shithub-code-crumbs" aria-label="Breadcrumb">
110 {{ range $i, $c := .Crumbs }}
111 {{ if $i }}<span class="shithub-code-sep">/</span>{{ end }}
112 <a href="{{ $c.URL }}">{{ $c.Name }}</a>
113 {{ end }}
114 </nav>
115 {{ end }}
116
117 <div class="shithub-tree-panel">
118 {{ if .HeadFound }}
119 <div class="shithub-tree-commit">
120 <div class="shithub-tree-commit-message">
121 {{ if .HeadAuthor.User }}
122 <a href="/{{ .HeadAuthor.Username }}"><img src="{{ .HeadAuthor.AvatarURL }}" alt="" class="shithub-avatar-sm"></a>
123 <a href="/{{ .HeadAuthor.Username }}"><strong>{{ if .HeadAuthor.DisplayName }}{{ .HeadAuthor.DisplayName }}{{ else }}{{ .HeadAuthor.Username }}{{ end }}</strong></a>
124 {{ else }}
125 <span class="shithub-avatar-sm shithub-identicon" data-seed="{{ .HeadAuthor.IdenticonSeed }}" aria-hidden="true"></span>
126 <strong>{{ .Head.AuthorName }}</strong>
127 {{ end }}
128 <a href="/{{ .Owner }}/{{ .Repo.Name }}/commit/{{ .Head.OID }}" class="shithub-tree-commit-subject">{{ .Head.Subject }}</a>
129 </div>
130 <div class="shithub-tree-commit-meta">
131 {{ if .HeadChecks.Show }}
132 <a href="{{ .HeadChecks.Href }}" class="shithub-tree-check-status shithub-actions-state-{{ .HeadChecks.StateClass }}" aria-label="{{ .HeadChecks.Label }}" title="{{ .HeadChecks.Label }}">{{ octicon .HeadChecks.StateIcon }}</a>
133 {{ end }}
134 <a href="/{{ .Owner }}/{{ .Repo.Name }}/commit/{{ .Head.OID }}"><code title="{{ .Head.OID }}">{{ slice .Head.OID 0 7 }}</code></a>
135 <time datetime="{{ .Head.AuthorWhen.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .Head.AuthorWhen }}</time>
136 <a href="/{{ .Owner }}/{{ .Repo.Name }}/commits/{{ .Ref }}" class="shithub-tree-commit-count">{{ octicon "history" }} {{ .CommitCount }} Commits</a>
137 </div>
138 </div>
139 {{ end }}
140 <table class="shithub-tree">
141 <tbody>
142 {{ range .EntryRows }}
143 <tr>
144 <td class="shithub-tree-icon" aria-hidden="true">
145 {{ if eq (printf "%s" .Entry.Kind) "tree" }}{{ octicon "directory" }}
146 {{ else if eq (printf "%s" .Entry.Kind) "commit" }}{{ octicon "submodule" }}
147 {{ else if eq (printf "%s" .Entry.Kind) "symlink" }}{{ octicon "symlink" }}
148 {{ else }}{{ octicon "file" }}{{ end }}
149 </td>
150 <td class="shithub-tree-name">
151 {{ if eq (printf "%s" .Entry.Kind) "commit" }}
152 {{ if .URL }}
153 <a href="{{ .URL }}">{{ .Entry.Name }} <span class="shithub-tree-submodule">@ {{ slice .Entry.OID 0 7 }}</span></a>
154 {{ else }}
155 {{ .Entry.Name }} <span class="shithub-tree-submodule">@ {{ slice .Entry.OID 0 7 }}</span>
156 {{ end }}
157 {{ else if .URL }}
158 <a href="{{ .URL }}">{{ .Entry.Name }}</a>
159 {{ else if eq (printf "%s" .Entry.Kind) "symlink" }}
160 {{ .Entry.Name }} <em class="shithub-tree-symlink">(symlink)</em>
161 {{ else }}
162 {{ .Entry.Name }}
163 {{ end }}
164 </td>
165 <td class="shithub-tree-row-commit">
166 {{ if .LastFound }}
167 <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/commit/{{ .LastCommit.OID }}">{{ .LastCommit.Subject }}</a>
168 {{ end }}
169 </td>
170 <td class="shithub-tree-row-time">
171 {{ if .LastFound }}<time datetime="{{ .LastCommit.AuthorWhen.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .LastCommit.AuthorWhen }}</time>{{ end }}
172 </td>
173 </tr>
174 {{ end }}
175 </tbody>
176 </table>
177 </div>
178 </section>
179 {{ if .README }}
180 <section class="shithub-readme markdown-body" id="readme" aria-label="README">
181 <div class="shithub-readme-head">
182 {{ if .ReadmeTabs }}
183 <nav class="shithub-readme-tabs" aria-label="Repository documents">
184 {{ range .ReadmeTabs }}
185 <a href="{{ .Href }}" class="shithub-readme-tab{{ if .Active }} is-active{{ end }}">
186 {{ octicon .Icon }}
187 <span>{{ .Label }}</span>
188 </a>
189 {{ end }}
190 </nav>
191 {{ else }}
192 <span class="shithub-readme-tab is-active">{{ octicon "book" }} <span>README</span></span>
193 {{ end }}
194 <div class="shithub-readme-head-actions">
195 {{ if and .CanWrite .READMEPath }}
196 <a class="shithub-button shithub-button-icon" href="/{{ .Owner }}/{{ .Repo.Name }}/edit/{{ .Ref }}/{{ .READMEPath }}" title="Edit README" aria-label="Edit README">{{ octicon "pencil" }}</a>
197 {{ end }}
198 <details class="shithub-readme-outline" data-readme-outline hidden>
199 <summary aria-label="Outline" title="Outline">
200 {{ octicon "list-unordered" }}
201 </summary>
202 <div class="shithub-readme-outline-panel" role="dialog" aria-label="README outline">
203 <label class="shithub-readme-outline-filter">
204 <span class="sr-only">Filter headings</span>
205 <input type="search" placeholder="Filter headings" aria-label="Filter headings" autocomplete="off" data-readme-outline-filter>
206 </label>
207 <nav class="shithub-readme-outline-list" aria-label="README headings" data-readme-outline-list></nav>
208 <p class="shithub-readme-outline-empty" data-readme-outline-empty hidden>No matching headings.</p>
209 </div>
210 </details>
211 </div>
212 </div>
213 <div class="shithub-readme-body">{{ .README }}</div>
214 </section>
215 {{ end }}
216 </main>
217 {{ template "repo-about-sidebar" . }}
218 </div>
219 </section>
220 {{- end }}