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