this repo has no description
1{{ define "title" }}{{ .RepoInfo.FullName }} at {{ .Ref }}{{ end }}
2
3{{ define "extrameta" }}
4 {{ template "repo/fragments/meta" . }}
5
6 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo) }}
7{{ end }}
8
9{{ define "repoContent" }}
10 <main>
11 {{ if .Languages }}
12 {{ block "repoLanguages" . }}{{ end }}
13 {{ end }}
14 <div class="flex items-center justify-between pb-5">
15 {{ block "branchSelector" . }}{{ end }}
16 <div class="flex md:hidden items-center gap-4">
17 <a
18 href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}"
19 class="inline-flex items-center text-sm gap-1">
20 {{ i "git-commit-horizontal" "w-4" "h-4" }}
21 {{ .TotalCommits }}
22 </a>
23 <a
24 href="/{{ .RepoInfo.FullName }}/branches"
25 class="inline-flex items-center text-sm gap-1">
26 {{ i "git-branch" "w-4" "h-4" }}
27 {{ len .Branches }}
28 </a>
29 <a
30 href="/{{ .RepoInfo.FullName }}/tags"
31 class="inline-flex items-center text-sm gap-1">
32 {{ i "tags" "w-4" "h-4" }}
33 {{ len .Tags }}
34 </a>
35 </div>
36 </div>
37 <div class="grid grid-cols-1 md:grid-cols-2 gap-2">
38 {{ block "fileTree" . }}{{ end }}
39 {{ block "rightInfo" . }}{{ end }}
40 </div>
41 </main>
42{{ end }}
43
44{{ define "repoLanguages" }}
45 <div class="flex gap-[1px] -m-6 mb-6 overflow-hidden rounded-t">
46 {{ range $value := .Languages }}
47 <div
48 title="{{ or $value.Name "Other" }} {{ printf "%.1f" $value.Percentage }}%"
49 class="h-[4px] rounded-full"
50 style="background-color: {{ $value.Color }}; width: {{ $value.Percentage }}%"></div>
51 {{ end }}
52 </div>
53{{ end }}
54
55{{ define "branchSelector" }}
56 <div class="flex gap-2 items-center items-stretch justify-center">
57 <select
58 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)"
59 class="p-1 border max-w-32 border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700">
60 <optgroup label="branches ({{ len .Branches }})" class="bold text-sm">
61 {{ range .Branches }}
62 <option
63 value="{{ .Reference.Name }}"
64 class="py-1"
65 {{ if eq .Reference.Name $.Ref }}
66 selected
67 {{ end }}>
68 {{ .Reference.Name }}
69 </option>
70 {{ end }}
71 </optgroup>
72 <optgroup label="tags ({{ len .Tags }})" class="bold text-sm">
73 {{ range .Tags }}
74 <option
75 value="{{ .Reference.Name }}"
76 class="py-1"
77 {{ if eq .Reference.Name $.Ref }}
78 selected
79 {{ end }}>
80 {{ .Reference.Name }}
81 </option>
82 {{ else }}
83 <option class="py-1" disabled>no tags found</option>
84 {{ end }}
85 </optgroup>
86 </select>
87 <div class="flex items-center gap-2">
88 {{ $isOwner := and .LoggedInUser .RepoInfo.Roles.IsOwner }}
89 {{ $isCollaborator := and .LoggedInUser .RepoInfo.Roles.IsCollaborator }}
90 {{ if and (or $isOwner $isCollaborator) .ForkInfo .ForkInfo.IsFork }}
91 {{ $disabled := "" }}
92 {{ $title := "" }}
93 {{ if eq .ForkInfo.Status 0 }}
94 {{ $disabled = "disabled" }}
95 {{ $title = "This branch is not behind the upstream" }}
96 {{ else if eq .ForkInfo.Status 2 }}
97 {{ $disabled = "disabled" }}
98 {{ $title = "This branch has conflicts that must be resolved" }}
99 {{ else if eq .ForkInfo.Status 3 }}
100 {{ $disabled = "disabled" }}
101 {{ $title = "This branch does not exist on the upstream" }}
102 {{ end }}
103
104
105 <button
106 id="syncBtn"
107 {{ $disabled }}
108 {{ if $title }}title="{{ $title }}"{{ end }}
109 class="btn flex gap-2 items-center disabled:opacity-50 disabled:cursor-not-allowed"
110 hx-post="/{{ .RepoInfo.FullName }}/fork/sync"
111 hx-trigger="click"
112 hx-swap="none">
113 {{ if $disabled }}
114 {{ i "refresh-cw-off" "w-4 h-4" }}
115 {{ else }}
116 {{ i "refresh-cw" "w-4 h-4" }}
117 {{ end }}
118 <span>sync</span>
119 </button>
120 {{ end }}
121 <a
122 href="/{{ .RepoInfo.FullName }}/compare?base={{ $.Ref | urlquery }}"
123 class="btn flex items-center gap-2 no-underline hover:no-underline"
124 title="Compare branches or tags">
125 {{ i "git-compare" "w-4 h-4" }}
126 </a>
127 </div>
128 </div>
129{{ end }}
130
131{{ define "fileTree" }}
132 <div
133 id="file-tree"
134 class="col-span-1 pr-2 md:border-r md:border-gray-200 dark:md:border-gray-700">
135 {{ $linkstyle := "no-underline hover:underline dark:text-white" }}
136
137 {{ range .Files }}
138 <div class="grid grid-cols-2 gap-4 items-center py-1">
139 <div class="col-span-1">
140 {{ $link := printf "/%s/%s/%s/%s" $.RepoInfo.FullName "tree" (urlquery $.Ref) .Name }}
141 {{ $icon := "folder" }}
142 {{ $iconStyle := "size-4 fill-current" }}
143
144 {{ if .IsFile }}
145 {{ $link = printf "/%s/%s/%s/%s" $.RepoInfo.FullName "blob" (urlquery $.Ref) .Name }}
146 {{ $icon = "file" }}
147 {{ $iconStyle = "size-4" }}
148 {{ end }}
149 <a href="{{ $link }}" class="{{ $linkstyle }}">
150 <div class="flex items-center gap-2">
151 {{ i $icon $iconStyle "flex-shrink-0" }}
152 <span class="truncate">{{ .Name }}</span>
153 </div>
154 </a>
155 </div>
156
157 <div class="text-xs col-span-1 text-right">
158 {{ with .LastCommit }}
159 <a
160 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash }}"
161 class="text-gray-500 dark:text-gray-400">
162 {{ template "repo/fragments/time" .When }}
163 </a>
164 {{ end }}
165 </div>
166 </div>
167 {{ end }}
168 </div>
169{{ end }}
170
171{{ define "rightInfo" }}
172 <div id="right-info" class="hidden md:block col-span-1">
173 {{ block "commitLog" . }}{{ end }}
174 {{ block "branchList" . }}{{ end }}
175 {{ block "tagList" . }}{{ end }}
176 </div>
177{{ end }}
178
179{{ define "commitLog" }}
180 <div id="commit-log" class="md:col-span-1 px-2 pb-4">
181 <div class="flex justify-between items-center">
182 <a
183 href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}"
184 class="flex items-center gap-2 pb-2 cursor-pointer font-bold hover:text-gray-600 dark:hover:text-gray-300 hover:no-underline">
185 {{ i "logs" "w-4 h-4" }} commits
186 <span
187 class="bg-gray-100 dark:bg-gray-700 font-normal rounded py-1/2 px-1 text-sm">
188 {{ .TotalCommits }}
189 </span>
190 </a>
191 </div>
192 <div class="flex flex-col gap-6">
193 {{ range .CommitsTrunc }}
194 <div>
195 <div id="commit-message">
196 {{ $messageParts := splitN .Message "\n\n" 2 }}
197 <div class="text-base cursor-pointer">
198 <div>
199 <div>
200 <a
201 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
202 class="inline no-underline hover:underline dark:text-white">
203 {{ index $messageParts 0 }}
204 </a>
205 {{ if gt (len $messageParts) 1 }}
206
207 <button
208 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
209 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')">
210 {{ i "ellipsis" "w-3 h-3" }}
211 </button>
212 {{ end }}
213 </div>
214 {{ if gt (len $messageParts) 1 }}
215 <p
216 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300">
217 {{ nl2br (index $messageParts 1) }}
218 </p>
219 {{ end }}
220 </div>
221 </div>
222 </div>
223
224 <!-- commit info bar -->
225 <div
226 class="text-xs mt-2 text-gray-500 dark:text-gray-400 flex items-center flex-wrap">
227 {{ $verified := $.VerifiedCommits.IsVerified .Hash.String }}
228 {{ $hashStyle := "text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900" }}
229 {{ if $verified }}
230 {{ $hashStyle = "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 rounded" }}
231 {{ end }}
232 <span class="font-mono">
233 <a
234 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
235 class="no-underline hover:underline {{ $hashStyle }} px-2 py-1 rounded flex items-center gap-2">
236 {{ slice .Hash.String 0 8 }}
237 {{ if $verified }}
238 {{ i "shield-check" "w-3 h-3" }}
239 {{ end }}
240 </a>
241 </span>
242 <span class="mx-1 before:content-['·'] before:select-none"></span>
243 <span>
244 {{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }}
245 <a
246 href="{{ if $didOrHandle }}
247 /{{ $didOrHandle }}
248 {{ else }}
249 mailto:{{ .Author.Email }}
250 {{ end }}"
251 class="text-gray-500 dark:text-gray-400 no-underline hover:underline">
252 {{ if $didOrHandle }}
253 {{ template "user/fragments/picHandleLink" $didOrHandle }}
254 {{ else }}
255 {{ .Author.Name }}
256 {{ end }}
257 </a>
258 </span>
259 <div
260 class="inline-block px-1 select-none after:content-['·']"></div>
261 {{ template "repo/fragments/time" .Committer.When }}
262
263
264 <!-- tags/branches -->
265 {{ $tagsForCommit := index $.TagMap .Hash.String }}
266 {{ if gt (len $tagsForCommit) 0 }}
267 <div
268 class="inline-block px-1 select-none after:content-['·']"></div>
269 {{ end }}
270 {{ range $tagsForCommit }}
271 <span
272 class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-[2px] inline-flex items-center">
273 {{ . }}
274 </span>
275 {{ end }}
276
277
278 <!-- ci status -->
279 {{ $pipeline := index $.Pipelines .Hash.String }}
280 {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }}
281 <div
282 class="inline-block px-1 select-none after:content-['·']"></div>
283 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "RepoInfo" $.RepoInfo "Pipeline" $pipeline) }}
284 {{ end }}
285 </div>
286 </div>
287 {{ end }}
288 </div>
289 </div>
290{{ end }}
291
292{{ define "branchList" }}
293 {{ if gt (len .BranchesTrunc) 0 }}
294 <div
295 id="branches"
296 class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
297 <a
298 href="/{{ .RepoInfo.FullName }}/branches"
299 class="flex items-center gap-2 pb-2 cursor-pointer font-bold hover:text-gray-600 dark:hover:text-gray-300 hover:no-underline">
300 {{ i "git-branch" "w-4 h-4" }} branches
301 <span
302 class="bg-gray-100 dark:bg-gray-700 font-normal rounded py-1/2 px-1 text-sm">
303 {{ len .Branches }}
304 </span>
305 </a>
306 <div class="flex flex-col gap-1">
307 {{ range .BranchesTrunc }}
308 <div
309 class="text-base flex items-center justify-between overflow-hidden">
310 <div class="flex items-center gap-2 min-w-0 flex-1">
311 <a
312 href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
313 class="inline-block truncate no-underline hover:underline dark:text-white">
314 {{ .Reference.Name }}
315 </a>
316 {{ if .Commit }}
317 <span
318 class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·'] shrink-0"></span>
319 <span
320 class="whitespace-nowrap text-xs text-gray-500 dark:text-gray-400 shrink-0">
321 {{ template "repo/fragments/time" .Commit.Committer.When }}
322 </span>
323 {{ end }}
324 {{ if .IsDefault }}
325 <span
326 class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·'] shrink-0"></span>
327 <span
328 class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono shrink-0">
329 default
330 </span>
331 {{ end }}
332 </div>
333 {{ if ne $.Ref .Reference.Name }}
334 <a
335 href="/{{ $.RepoInfo.FullName }}/compare/{{ $.Ref | urlquery }}...{{ .Reference.Name | urlquery }}"
336 class="text-xs flex gap-2 items-center shrink-0 ml-2"
337 title="Compare branches or tags">
338 {{ i "git-compare" "w-3 h-3" }} compare
339 </a>
340 {{ end }}
341 </div>
342 {{ end }}
343 </div>
344 </div>
345 {{ end }}
346{{ end }}
347
348{{ define "tagList" }}
349 {{ if gt (len .TagsTrunc) 0 }}
350 <div
351 id="tags"
352 class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
353 <div class="flex justify-between items-center">
354 <a
355 href="/{{ .RepoInfo.FullName }}/tags"
356 class="flex items-center gap-2 pb-2 cursor-pointer font-bold hover:text-gray-600 dark:hover:text-gray-300 hover:no-underline">
357 {{ i "tags" "w-4 h-4" }} tags
358 <span
359 class="bg-gray-100 dark:bg-gray-700 font-normal rounded py-1/2 px-1 text-sm">
360 {{ len .Tags }}
361 </span>
362 </a>
363 </div>
364 <div class="flex flex-col gap-1">
365 {{ range $idx, $tag := .TagsTrunc }}
366 {{ with $tag }}
367 <div>
368 <div class="text-base flex items-center gap-2">
369 <a
370 href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
371 class="inline no-underline hover:underline dark:text-white">
372 {{ .Reference.Name }}
373 </a>
374 </div>
375 <div>
376 {{ with .Tag }}
377 <span class="text-xs text-gray-500 dark:text-gray-400">
378 {{ template "repo/fragments/time" .Tagger.When }}
379 </span>
380 {{ end }}
381 {{ if eq $idx 0 }}
382 {{ with .Tag }}
383 <span
384 class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>
385 {{ end }}
386 <span
387 class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">
388 latest
389 </span>
390 {{ end }}
391 </div>
392 </div>
393 {{ end }}
394 {{ end }}
395 </div>
396 </div>
397 {{ end }}
398{{ end }}
399
400{{ define "repoAfter" }}
401 {{- if or .HTMLReadme .Readme -}}
402 <section
403 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 }}
404 prose dark:prose-invert dark:[&_pre]:bg-gray-900
405 dark:[&_code]:text-gray-300 dark:[&_pre_code]:bg-gray-900
406 dark:[&_pre]:border dark:[&_pre]:border-gray-700
407 {{ end }}">
408 <article class="{{ if .Raw }}whitespace-pre{{ end }}">
409 {{- if .Raw -}}
410 <pre class="dark:bg-gray-800 dark:text-white overflow-x-auto">
411 {{- .Readme -}}
412 </pre
413 >
414 {{- else -}}
415 {{ .HTMLReadme }}
416 {{- end -}}
417 </article>
418 </section>
419 {{- end -}}
420
421 {{ template "repo/fragments/cloneInstructions" . }}
422{{ end }}