this repo has no description
at knot-xrpc 6.6 kB view raw
1{{ define "title" }}pulls &middot; {{ .RepoInfo.FullName }}{{ end }} 2 3{{ define "extrameta" }} 4 {{ $title := "pulls"}} 5 {{ $url := printf "https://tangled.sh/%s/pulls" .RepoInfo.FullName }} 6 7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} 8{{ end }} 9 10{{ define "repoContent" }} 11 <div class="flex justify-between items-center"> 12 <div class="flex gap-4"> 13 <a 14 href="?state=open" 15 class="flex items-center gap-2 {{ if .FilteringBy.IsOpen }}font-bold {{ else }}text-gray-500 dark:text-gray-400{{ end }}" 16 > 17 {{ i "git-pull-request" "w-4 h-4" }} 18 <span>{{ .RepoInfo.Stats.PullCount.Open }} open</span> 19 </a> 20 <a 21 href="?state=merged" 22 class="flex items-center gap-2 {{ if .FilteringBy.IsMerged }}font-bold {{ else }}text-gray-500 dark:text-gray-400{{ end }}" 23 > 24 {{ i "git-merge" "w-4 h-4" }} 25 <span>{{ .RepoInfo.Stats.PullCount.Merged }} merged</span> 26 </a> 27 <a 28 href="?state=closed" 29 class="flex items-center gap-2 {{ if .FilteringBy.IsClosed }}font-bold {{ else }}text-gray-500 dark:text-gray-400{{ end }}" 30 > 31 {{ i "ban" "w-4 h-4" }} 32 <span>{{ .RepoInfo.Stats.PullCount.Closed }} closed</span> 33 </a> 34 </div> 35 <a 36 href="/{{ .RepoInfo.FullName }}/pulls/new" 37 class="btn-create text-sm flex items-center gap-2 no-underline hover:no-underline hover:text-white" 38 > 39 {{ i "git-pull-request-create" "w-4 h-4" }} 40 <span>new</span> 41 </a> 42 </div> 43 <div class="error" id="pulls"></div> 44{{ end }} 45 46{{ define "repoAfter" }} 47 <div class="flex flex-col gap-2 mt-2"> 48 {{ range .Pulls }} 49 <div class="rounded bg-white dark:bg-gray-800"> 50 <div class="px-6 py-4 z-5"> 51 <div class="pb-2"> 52 <a href="/{{ $.RepoInfo.FullName }}/pulls/{{ .PullId }}" class="dark:text-white"> 53 {{ .Title }} 54 <span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span> 55 </a> 56 </div> 57 <div class="text-sm text-gray-500 dark:text-gray-400 flex flex-wrap items-center gap-1"> 58 {{ $owner := index $.DidHandleMap .OwnerDid }} 59 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} 60 {{ $icon := "ban" }} 61 62 {{ if .State.IsOpen }} 63 {{ $bgColor = "bg-green-600 dark:bg-green-700" }} 64 {{ $icon = "git-pull-request" }} 65 {{ else if .State.IsMerged }} 66 {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }} 67 {{ $icon = "git-merge" }} 68 {{ end }} 69 70 71 <span 72 class="inline-flex items-center rounded px-2 py-[5px] {{ $bgColor }} text-sm" 73 > 74 {{ i $icon "w-3 h-3 mr-1.5 text-white" }} 75 <span class="text-white">{{ .State.String }}</span> 76 </span> 77 78 <span class="ml-1"> 79 {{ template "user/fragments/picHandleLink" $owner }} 80 </span> 81 82 <span class="before:content-['·']"> 83 {{ template "repo/fragments/time" .Created }} 84 </span> 85 86 87 {{ $latestRound := .LastRoundNumber }} 88 {{ $lastSubmission := index .Submissions $latestRound }} 89 90 <span class="before:content-['·']"> 91 {{ $commentCount := len $lastSubmission.Comments }} 92 {{ $s := "s" }} 93 {{ if eq $commentCount 1 }} 94 {{ $s = "" }} 95 {{ end }} 96 97 {{ len $lastSubmission.Comments}} comment{{$s}} 98 </span> 99 100 <span class="before:content-['·']"> 101 round 102 <span class="font-mono"> 103 #{{ .LastRoundNumber }} 104 </span> 105 </span> 106 107 {{ $pipeline := index $.Pipelines .LatestSha }} 108 {{ if and $pipeline $pipeline.Id }} 109 <span class="before:content-['·']"></span> 110 {{ template "repo/pipelines/fragments/pipelineSymbol" $pipeline }} 111 {{ end }} 112 </div> 113 </div> 114 {{ if .StackId }} 115 {{ $otherPulls := index $.Stacks .StackId }} 116 {{ if gt (len $otherPulls) 0 }} 117 <details class="bg-white dark:bg-gray-800 group"> 118 <summary class="pb-4 px-6 text-xs list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400"> 119 {{ $s := "s" }} 120 {{ if eq (len $otherPulls) 1 }} 121 {{ $s = "" }} 122 {{ end }} 123 <div class="group-open:hidden flex items-center gap-2"> 124 {{ i "chevrons-up-down" "w-4 h-4" }} expand {{ len $otherPulls }} pull{{$s}} in this stack 125 </div> 126 <div class="hidden group-open:flex items-center gap-2"> 127 {{ i "chevrons-down-up" "w-4 h-4" }} hide {{ len $otherPulls }} pull{{$s}} in this stack 128 </div> 129 </summary> 130 {{ block "pullList" (list $otherPulls $) }} {{ end }} 131 </details> 132 {{ end }} 133 {{ end }} 134 </div> 135 {{ end }} 136 </div> 137{{ end }} 138 139{{ define "pullList" }} 140 {{ $list := index . 0 }} 141 {{ $root := index . 1 }} 142 <div class="grid grid-cols-1 rounded-b border-b border-t border-gray-200 dark:border-gray-900 divide-y divide-gray-200 dark:divide-gray-900"> 143 {{ range $pull := $list }} 144 {{ $pipeline := index $root.Pipelines $pull.LatestSha }} 145 <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"> 146 <div class="flex gap-2 items-center px-6"> 147 <div class="flex-grow min-w-0 w-full py-2"> 148 {{ template "repo/pulls/fragments/summarizedHeader" (list $pull $pipeline) }} 149 </div> 150 </div> 151 </a> 152 {{ end }} 153 </div> 154{{ end }}