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