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