this repo has no description
1{{ define "title" }}{{ .RepoInfo.FullName }} at {{ .Ref }}{{ end }}
2
3
4{{ define "extrameta" }}
5 {{ template "repo/fragments/meta" . }}
6
7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo) }}
8{{ end }}
9
10
11{{ define "repoContent" }}
12 <main>
13 <div class="flex items-center justify-between pb-5">
14 {{ block "branchSelector" . }}{{ end }}
15 <div class="flex md:hidden items-center gap-4">
16 <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="inline-flex items-center text-sm gap-1">
17 {{ i "git-commit-horizontal" "w-4" "h-4" }} {{ .TotalCommits }}
18 </a>
19 <a href="/{{ .RepoInfo.FullName }}/branches" class="inline-flex items-center text-sm gap-1">
20 {{ i "git-branch" "w-4" "h-4" }} {{ len .Branches }}
21 </a>
22 <a href="/{{ .RepoInfo.FullName }}/tags" class="inline-flex items-center text-sm gap-1">
23 {{ i "tags" "w-4" "h-4" }} {{ len .Tags }}
24 </a>
25 </div>
26 </div>
27 <div class="grid grid-cols-1 md:grid-cols-2 gap-2">
28 {{ block "fileTree" . }}{{ end }}
29 {{ block "rightInfo" . }}{{ end }}
30 </div>
31 </main>
32{{ end }}
33
34{{ define "branchSelector" }}
35 <div>
36 <select
37 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)"
38 class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700"
39 >
40 <optgroup label="branches ({{len .Branches}})" class="bold text-sm">
41 {{ range .Branches }}
42 <option
43 value="{{ .Reference.Name }}"
44 class="py-1"
45 {{ if eq .Reference.Name $.Ref }}
46 selected
47 {{ end }}
48 >
49 {{ .Reference.Name }}
50 </option>
51 {{ end }}
52 </optgroup>
53 <optgroup label="tags ({{len .Tags}})" class="bold text-sm">
54 {{ range .Tags }}
55 <option
56 value="{{ .Reference.Name }}"
57 class="py-1"
58 {{ if eq .Reference.Name $.Ref }}
59 selected
60 {{ end }}
61 >
62 {{ .Reference.Name }}
63 </option>
64 {{ else }}
65 <option class="py-1" disabled>no tags found</option>
66 {{ end }}
67 </optgroup>
68 </select>
69 <button
70 id="syncBtn"
71 class="btn disabled:opacity-50 disabled:cursor-not-allowed"
72 hx-post="/{{ .RepoInfo.FullName }}/fork/sync?knot={{ .RepoInfo.Knot }}&branch={{ .RepoInfo.Ref }}"
73 hx-trigger="click"
74 hx-swap="none"
75 >
76 sync
77 </button>
78 </div>
79{{ end }}
80
81{{ define "fileTree" }}
82 <div
83 id="file-tree"
84 class="col-span-1 pr-2 md:border-r md:border-gray-200 dark:md:border-gray-700"
85 >
86 {{ $containerstyle := "py-1" }}
87 {{ $linkstyle := "no-underline hover:underline dark:text-white" }}
88
89 {{ range .Files }}
90 {{ if not .IsFile }}
91 <div class="{{ $containerstyle }}">
92 <div class="flex justify-between items-center">
93 <a
94 href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref | urlquery }}/{{ .Name }}"
95 class="{{ $linkstyle }}"
96 >
97 <div class="flex items-center gap-2">
98 {{ i "folder" "size-4 fill-current" }}
99 {{ .Name }}
100 </div>
101 </a>
102
103 <time class="text-xs text-gray-500 dark:text-gray-400"
104 >{{ timeFmt .LastCommit.When }}</time
105 >
106 </div>
107 </div>
108 {{ end }}
109 {{ end }}
110
111 {{ range .Files }}
112 {{ if .IsFile }}
113 <div class="{{ $containerstyle }}">
114 <div class="flex justify-between items-center">
115 <a
116 href="/{{ $.RepoInfo.FullName }}/blob/{{ $.Ref | urlquery }}/{{ .Name }}"
117 class="{{ $linkstyle }}"
118 >
119 <div class="flex items-center gap-2">
120 {{ i "file" "size-4" }}{{ .Name }}
121 </div>
122 </a>
123
124 <time class="text-xs text-gray-500 dark:text-gray-400"
125 >{{ timeFmt .LastCommit.When }}</time
126 >
127 </div>
128 </div>
129 {{ end }}
130 {{ end }}
131 </div>
132{{ end }}
133
134{{ define "rightInfo" }}
135 <div id="right-info" class="hidden md:block col-span-1">
136 {{ block "commitLog" . }} {{ end }}
137 {{ block "branchList" . }} {{ end }}
138 {{ block "tagList" . }} {{ end }}
139 </div>
140{{ end }}
141
142{{ define "commitLog" }}
143<div id="commit-log" class="md:col-span-1 px-2 pb-4">
144 <div class="flex justify-between items-center">
145 <a href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group">
146 <div class="flex gap-2 items-center font-bold">
147 {{ i "logs" "w-4 h-4" }} commits
148 </div>
149 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
150 view {{ .TotalCommits }} commits {{ i "chevron-right" "w-4 h-4" }}
151 </span>
152 </a>
153 </div>
154 <div class="flex flex-col gap-6">
155 {{ range .CommitsTrunc }}
156 <div>
157 <div id="commit-message">
158 {{ $messageParts := splitN .Message "\n\n" 2 }}
159 <div class="text-base cursor-pointer">
160 <div>
161 <div>
162 <a
163 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
164 class="inline no-underline hover:underline dark:text-white"
165 >{{ index $messageParts 0 }}</a
166 >
167 {{ if gt (len $messageParts) 1 }}
168
169 <button
170 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
171 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')"
172 >
173 {{ i "ellipsis" "w-3 h-3" }}
174 </button>
175 {{ end }}
176 </div>
177 {{ if gt (len $messageParts) 1 }}
178 <p
179 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300"
180 >
181 {{ nl2br (index $messageParts 1) }}
182 </p>
183 {{ end }}
184 </div>
185 </div>
186 </div>
187
188 <div class="text-xs text-gray-500 dark:text-gray-400">
189 <span class="font-mono">
190 <a
191 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
192 class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
193 >{{ slice .Hash.String 0 8 }}</a
194 ></span
195 >
196 <span
197 class="mx-2 before:content-['·'] before:select-none"
198 ></span>
199 <span>
200 {{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }}
201 <a
202 href="{{ if $didOrHandle }}
203 /{{ $didOrHandle }}
204 {{ else }}
205 mailto:{{ .Author.Email }}
206 {{ end }}"
207 class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
208 >{{ if $didOrHandle }}
209 {{ $didOrHandle }}
210 {{ else }}
211 {{ .Author.Name }}
212 {{ end }}</a
213 >
214 </span>
215 <div
216 class="inline-block px-1 select-none after:content-['·']"
217 ></div>
218 <span>{{ timeFmt .Author.When }}</span>
219 {{ $tagsForCommit := index $.TagMap .Hash.String }}
220 {{ if gt (len $tagsForCommit) 0 }}
221 <div
222 class="inline-block px-1 select-none after:content-['·']"
223 ></div>
224 {{ end }}
225 {{ range $tagsForCommit }}
226 <span
227 class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center"
228 >
229 {{ . }}
230 </span>
231 {{ end }}
232 </div>
233 </div>
234 {{ end }}
235 </div>
236</div>
237{{ end }}
238
239{{ define "branchList" }}
240 {{ if gt (len .BranchesTrunc) 0 }}
241 <div id="branches" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
242 <a href="/{{ .RepoInfo.FullName }}/branches" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group">
243 <div class="flex gap-2 items-center font-bold">
244 {{ i "git-branch" "w-4 h-4" }} branches
245 </div>
246 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
247 view {{ len .Branches }} branches {{ i "chevron-right" "w-4 h-4" }}
248 </span>
249 </a>
250 <div class="flex flex-col gap-1">
251 {{ range .BranchesTrunc }}
252 <div class="text-base flex items-center gap-2">
253 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
254 class="inline no-underline hover:underline dark:text-white">
255 {{ .Reference.Name }}
256 </a>
257 {{ if .Commit }}
258 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>
259 <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Commit.Author.When }}</time>
260 {{ end }}
261 {{ if .IsDefault }}
262 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>
263 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">default</span>
264 {{ end }}
265 </div>
266 {{ end }}
267 </div>
268 </div>
269 {{ end }}
270{{ end }}
271
272{{ define "tagList" }}
273 {{ if gt (len .TagsTrunc) 0 }}
274 <div id="tags" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
275 <div class="flex justify-between items-center">
276 <a href="/{{ .RepoInfo.FullName }}/tags" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group">
277 <div class="flex gap-2 items-center font-bold">
278 {{ i "tags" "w-4 h-4" }} tags
279 </div>
280 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
281 view {{ len .Tags }} tags {{ i "chevron-right" "w-4 h-4" }}
282 </span>
283 </a>
284 </div>
285 <div class="flex flex-col gap-1">
286 {{ range $idx, $tag := .TagsTrunc }}
287 {{ with $tag }}
288 <div>
289 <div class="text-base flex items-center gap-2">
290 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
291 class="inline no-underline hover:underline dark:text-white">
292 {{ .Reference.Name }}
293 </a>
294 </div>
295 <div>
296 {{ with .Tag }}
297 <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Tagger.When }}</time>
298 {{ end }}
299 {{ if eq $idx 0 }}
300 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>
301 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">latest</span>
302 {{ end }}
303 </div>
304 </div>
305 {{ end }}
306 {{ end }}
307 </div>
308 </div>
309 {{ end }}
310{{ end }}
311
312{{ define "repoAfter" }}
313 {{- if .HTMLReadme -}}
314 <section
315 class="p-6 mt-4 rounded-br rounded-bl bg-white dark:bg-gray-800 dark:text-white drop-shadow-sm w-full mx-auto overflow-auto {{ if not .Raw }}
316 prose dark:prose-invert dark:[&_pre]:bg-gray-900
317 dark:[&_code]:text-gray-300 dark:[&_pre_code]:bg-gray-900
318 dark:[&_pre]:border dark:[&_pre]:border-gray-700
319 {{ end }}"
320 >
321 <article class="{{ if .Raw }}whitespace-pre{{ end }}">{{- if .Raw -}}<pre class="dark:bg-gray-900 dark:text-gray-200 dark:border dark:border-gray-700 dark:p-4 dark:rounded">
322 {{- .HTMLReadme -}}
323 </pre>
324 {{- else -}}
325 {{ .HTMLReadme }}
326 {{- end -}}</article>
327 </section>
328 {{- end -}}
329
330 {{ template "repo/fragments/cloneInstructions" . }}
331{{ end }}