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