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 id="file-tree" class="col-span-1 pr-2 md:border-r md:border-gray-200 dark:md:border-gray-700" >
131 {{ $linkstyle := "no-underline hover:underline dark:text-white" }}
132
133 {{ range .Files }}
134 <div class="grid grid-cols-2 gap-4 items-center py-1">
135 <div class="col-span-1">
136 {{ $link := printf "/%s/%s/%s/%s" $.RepoInfo.FullName "tree" (urlquery $.Ref) .Name }}
137 {{ $icon := "folder" }}
138 {{ $iconStyle := "size-4 fill-current" }}
139
140 {{ if .IsFile }}
141 {{ $link = printf "/%s/%s/%s/%s" $.RepoInfo.FullName "blob" (urlquery $.Ref) .Name }}
142 {{ $icon = "file" }}
143 {{ $iconStyle = "size-4" }}
144 {{ end }}
145 <a href="{{ $link }}" class="{{ $linkstyle }}">
146 <div class="flex items-center gap-2">
147 {{ i $icon $iconStyle }}{{ .Name }}
148 </div>
149 </a>
150 </div>
151
152 <div class="text-xs col-span-1 text-right">
153 {{ with .LastCommit }}
154 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash }}" class="text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .When }}</a>
155 {{ end }}
156 </div>
157 </div>
158 {{ end }}
159 </div>
160{{ end }}
161
162{{ define "rightInfo" }}
163 <div id="right-info" class="hidden md:block col-span-1">
164 {{ block "commitLog" . }} {{ end }}
165 {{ block "branchList" . }} {{ end }}
166 {{ block "tagList" . }} {{ end }}
167 </div>
168{{ end }}
169
170{{ define "commitLog" }}
171<div id="commit-log" class="md:col-span-1 px-2 pb-4">
172 <div class="flex justify-between items-center">
173 <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">
174 <div class="flex gap-2 items-center font-bold">
175 {{ i "logs" "w-4 h-4" }} commits
176 </div>
177 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
178 view {{ .TotalCommits }} commits {{ i "chevron-right" "w-4 h-4" }}
179 </span>
180 </a>
181 </div>
182 <div class="flex flex-col gap-6">
183 {{ range .CommitsTrunc }}
184 <div>
185 <div id="commit-message">
186 {{ $messageParts := splitN .Message "\n\n" 2 }}
187 <div class="text-base cursor-pointer">
188 <div>
189 <div>
190 <a
191 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
192 class="inline no-underline hover:underline dark:text-white"
193 >{{ index $messageParts 0 }}</a
194 >
195 {{ if gt (len $messageParts) 1 }}
196
197 <button
198 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
199 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')"
200 >
201 {{ i "ellipsis" "w-3 h-3" }}
202 </button>
203 {{ end }}
204 </div>
205 {{ if gt (len $messageParts) 1 }}
206 <p
207 class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300"
208 >
209 {{ nl2br (index $messageParts 1) }}
210 </p>
211 {{ end }}
212 </div>
213 </div>
214 </div>
215
216 <!-- commit info bar -->
217 <div class="text-xs mt-2 text-gray-500 dark:text-gray-400 flex items-center">
218 {{ $verified := $.VerifiedCommits.IsVerified .Hash.String }}
219 {{ $hashStyle := "text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900" }}
220 {{ if $verified }}
221 {{ $hashStyle = "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 rounded" }}
222 {{ end }}
223 <span class="font-mono">
224 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
225 class="no-underline hover:underline {{ $hashStyle }} px-2 py-1 rounded flex items-center gap-2">
226 {{ slice .Hash.String 0 8 }}
227 {{ if $verified }}
228 {{ i "shield-check" "w-3 h-3" }}
229 {{ end }}
230 </a>
231 </span>
232 <span
233 class="mx-1 before:content-['·'] before:select-none"
234 ></span>
235 <span>
236 {{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }}
237 <a
238 href="{{ if $didOrHandle }}
239 /{{ $didOrHandle }}
240 {{ else }}
241 mailto:{{ .Author.Email }}
242 {{ end }}"
243 class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
244 >{{ if $didOrHandle }}
245 {{ template "user/fragments/picHandleLink" $didOrHandle }}
246 {{ else }}
247 {{ .Author.Name }}
248 {{ end }}</a
249 >
250 </span>
251 <div class="inline-block px-1 select-none after:content-['·']"></div>
252 {{ template "repo/fragments/time" .Committer.When }}
253
254 <!-- tags/branches -->
255 {{ $tagsForCommit := index $.TagMap .Hash.String }}
256 {{ if gt (len $tagsForCommit) 0 }}
257 <div class="inline-block px-1 select-none after:content-['·']"></div>
258 {{ end }}
259 {{ range $tagsForCommit }}
260 <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">
261 {{ . }}
262 </span>
263 {{ end }}
264
265 <!-- ci status -->
266 {{ $pipeline := index $.Pipelines .Hash.String }}
267 {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }}
268 <div class="inline-block px-1 select-none after:content-['·']"></div>
269 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "RepoInfo" $.RepoInfo "Pipeline" $pipeline) }}
270 {{ end }}
271 </div>
272 </div>
273 {{ end }}
274 </div>
275</div>
276{{ end }}
277
278{{ define "branchList" }}
279 {{ if gt (len .BranchesTrunc) 0 }}
280 <div id="branches" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
281 <a href="/{{ .RepoInfo.FullName }}/branches" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group">
282 <div class="flex gap-2 items-center font-bold">
283 {{ i "git-branch" "w-4 h-4" }} branches
284 </div>
285 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
286 view {{ len .Branches }} branches {{ i "chevron-right" "w-4 h-4" }}
287 </span>
288 </a>
289 <div class="flex flex-col gap-1">
290 {{ range .BranchesTrunc }}
291 <div class="text-base flex items-center justify-between">
292 <div class="flex items-center gap-2">
293 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
294 class="inline no-underline hover:underline dark:text-white">
295 {{ .Reference.Name }}
296 </a>
297 {{ if .Commit }}
298 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>
299 <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .Commit.Committer.When }}</span>
300 {{ end }}
301 {{ if .IsDefault }}
302 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>
303 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">default</span>
304 {{ end }}
305 </div>
306 {{ if ne $.Ref .Reference.Name }}
307 <a href="/{{ $.RepoInfo.FullName }}/compare/{{ $.Ref | urlquery }}...{{ .Reference.Name | urlquery }}"
308 class="text-xs flex gap-2 items-center"
309 title="Compare branches or tags">
310 {{ i "git-compare" "w-3 h-3" }} compare
311 </a>
312 {{end}}
313 </div>
314 {{ end }}
315 </div>
316 </div>
317 {{ end }}
318{{ end }}
319
320{{ define "tagList" }}
321 {{ if gt (len .TagsTrunc) 0 }}
322 <div id="tags" class="md:col-span-1 px-2 py-4 border-t border-gray-200 dark:border-gray-700">
323 <div class="flex justify-between items-center">
324 <a href="/{{ .RepoInfo.FullName }}/tags" class="flex text-black dark:text-white items-center gap-4 pb-2 no-underline hover:no-underline group">
325 <div class="flex gap-2 items-center font-bold">
326 {{ i "tags" "w-4 h-4" }} tags
327 </div>
328 <span class="hidden group-hover:flex gap-2 items-center text-sm text-gray-500 dark:text-gray-400 ">
329 view {{ len .Tags }} tags {{ i "chevron-right" "w-4 h-4" }}
330 </span>
331 </a>
332 </div>
333 <div class="flex flex-col gap-1">
334 {{ range $idx, $tag := .TagsTrunc }}
335 {{ with $tag }}
336 <div>
337 <div class="text-base flex items-center gap-2">
338 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ .Reference.Name | urlquery }}"
339 class="inline no-underline hover:underline dark:text-white">
340 {{ .Reference.Name }}
341 </a>
342 </div>
343 <div>
344 {{ with .Tag }}
345 <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .Tagger.When }}</span>
346 {{ end }}
347 {{ if eq $idx 0 }}
348 {{ with .Tag }}<span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['·']"></span>{{ end }}
349 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-xs font-mono">latest</span>
350 {{ end }}
351 </div>
352 </div>
353 {{ end }}
354 {{ end }}
355 </div>
356 </div>
357 {{ end }}
358{{ end }}
359
360{{ define "repoAfter" }}
361 {{- if .HTMLReadme -}}
362 <section
363 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 }}
364 prose dark:prose-invert dark:[&_pre]:bg-gray-900
365 dark:[&_code]:text-gray-300 dark:[&_pre_code]:bg-gray-900
366 dark:[&_pre]:border dark:[&_pre]:border-gray-700
367 {{ end }}"
368 >
369 <article class="{{ if .Raw }}whitespace-pre{{ end }}">{{- if .Raw -}}<pre class="dark:bg-gray-800 dark:text-white overflow-x-auto">
370 {{- .HTMLReadme -}}
371 </pre>
372 {{- else -}}
373 {{ .HTMLReadme }}
374 {{- end -}}</article>
375 </section>
376 {{- end -}}
377
378 {{ template "repo/fragments/cloneInstructions" . }}
379{{ end }}