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