A vibe coded tangled fork which supports pijul.
at dacad6d744383ff69a88c16a73d58de2d60d9f47 82 lines 2.9 kB view raw
1{{ define "repo/pulls/fragments/pullStack" }} 2 <p class="text-sm font-bold p-2 dark:text-white">STACK</p> 3 {{ block "pullList" (list .Stack $) }} {{ end }} 4 5 {{ if gt (len .AbandonedPulls) 0 }} 6 <p class="text-sm font-bold p-2 dark:text-white">ABANDONED PULLS</p> 7 {{ block "pullList" (list .AbandonedPulls $) }} {{ end }} 8 {{ end }} 9{{ end }} 10 11{{ define "summarizedHeader" }} 12 <div class="flex text-sm items-center justify-between w-full"> 13 <div class="flex items-center gap-2 text-ellipsis"> 14 {{ block "summarizedPullState" . }} {{ end }} 15 <span> 16 <span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span> 17 {{ .Title }} 18 </span> 19 </div> 20 21 <div> 22 {{ $latestRound := .LastRoundNumber }} 23 {{ $lastSubmission := index .Submissions $latestRound }} 24 {{ $commentCount := len $lastSubmission.Comments }} 25 <span> 26 <div class="inline-flex items-center gap-2"> 27 {{ i "message-square" "w-3 h-3 md:hidden" }} 28 {{ $commentCount }} 29 <span class="hidden md:inline">comment{{if ne $commentCount 1}}s{{end}}</span> 30 </div> 31 </span> 32 <span class="mx-2 before:content-['·'] before:select-none"></span> 33 <span> 34 <span class="hidden md:inline">round</span> 35 <span class="font-mono">#{{ $latestRound }}</span> 36 </span> 37 </div> 38 </div> 39{{ end }} 40 41{{ define "summarizedPullState" }} 42 {{ $fgColor := "text-gray-600 dark:text-gray-300" }} 43 {{ $icon := "ban" }} 44 45 {{ if .State.IsOpen }} 46 {{ $fgColor = "text-green-600 dark:text-green-500" }} 47 {{ $icon = "git-pull-request" }} 48 {{ else if .State.IsMerged }} 49 {{ $fgColor = "text-purple-600 dark:text-purple-500" }} 50 {{ $icon = "git-merge" }} 51 {{ else if .State.IsDeleted }} 52 {{ $fgColor = "text-red-600 dark:text-red-500" }} 53 {{ $icon = "git-pull-request-closed" }} 54 {{ end }} 55 56 {{ $style := printf "w-4 h-4 %s" $fgColor }} 57 58 {{ i $icon $style }} 59{{ end }} 60 61{{ define "pullList" }} 62 {{ $list := index . 0 }} 63 {{ $root := index . 1 }} 64 <div class="grid grid-cols-1 rounded border border-gray-200 dark:border-gray-700 divide-y divide-gray-200 dark:divide-gray-700"> 65 {{ range $pull := $list }} 66 {{ $isCurrent := false }} 67 {{ with $root.Pull }} 68 {{ $isCurrent = eq $pull.PullId $root.Pull.PullId }} 69 {{ end }} 70 <a href="/{{ $root.RepoInfo.FullName }}/pulls/{{ $pull.PullId }}" class="no-underline hover:no-underline hover:bg-gray-100/25 hover:dark:bg-gray-700/25"> 71 <div class="flex gap-2 items-center px-2 {{ if $isCurrent }}bg-gray-100/50 dark:bg-gray-700/50{{ end }}"> 72 {{ if $isCurrent }} 73 {{ i "arrow-right" "w-4 h-4" }} 74 {{ end }} 75 <div class="{{ if not $isCurrent }} ml-6 {{ end }} w-full py-2"> 76 {{ block "summarizedHeader" $pull }} {{ end }} 77 </div> 78 </div> 79 </a> 80 {{ end }} 81 </div> 82{{ end }}