this repo has no description
1{{ define "title" }}pulls · {{ .RepoInfo.FullName }}{{ end }}
2
3{{ define "extrameta" }}
4 {{ $title := "pulls"}}
5 {{ $url := printf "https://tangled.org/%s/pulls" .RepoInfo.FullName }}
6
7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }}
8{{ end }}
9
10{{ define "repoContent" }}
11 {{ $active := "closed" }}
12 {{ if .FilteringBy.IsOpen }}
13 {{ $active = "open" }}
14 {{ else if .FilteringBy.IsMerged }}
15 {{ $active = "merged" }}
16 {{ end }}
17 {{ $open :=
18 (dict
19 "Key" "open"
20 "Value" "open"
21 "Icon" "git-pull-request"
22 "Meta" (string .RepoInfo.Stats.PullCount.Open)) }}
23 {{ $merged :=
24 (dict
25 "Key" "merged"
26 "Value" "merged"
27 "Icon" "git-merge"
28 "Meta" (string .RepoInfo.Stats.PullCount.Merged)) }}
29 {{ $closed :=
30 (dict
31 "Key" "closed"
32 "Value" "closed"
33 "Icon" "ban"
34 "Meta" (string .RepoInfo.Stats.PullCount.Closed)) }}
35 {{ $values := list $open $merged $closed }}
36 <div class="grid gap-2 grid-cols-[auto_1fr_auto] grid-row-2">
37 <form class="flex relative col-span-3 sm:col-span-1 sm:col-start-2" method="GET">
38 <input type="hidden" name="state" value="{{ .FilteringBy.String }}">
39 <div class="flex-1 flex relative">
40 <input
41 id="search-q"
42 class="flex-1 py-1 pl-2 pr-10 mr-[-1px] rounded-r-none focus:border-0 focus:outline-none focus:ring focus:ring-blue-400 ring-inset peer"
43 type="text"
44 name="q"
45 value="{{ .FilterQuery }}"
46 placeholder=" "
47 >
48 <a
49 href="?state={{ .FilteringBy.String }}"
50 class="absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hidden peer-[:not(:placeholder-shown)]:block"
51 >
52 {{ i "x" "w-4 h-4" }}
53 </a>
54 </div>
55 <button
56 type="submit"
57 class="p-2 text-gray-400 border rounded-r border-gray-400 dark:border-gray-600"
58 >
59 {{ i "search" "w-4 h-4" }}
60 </button>
61 </form>
62 <div class="sm:row-start-1">
63 {{ template "fragments/tabSelector" (dict "Name" "state" "Values" $values "Active" $active "Include" "#search-q") }}
64 </div>
65 <a
66 href="/{{ .RepoInfo.FullName }}/pulls/new"
67 class="col-start-3 btn-create text-sm flex items-center gap-2 no-underline hover:no-underline hover:text-white"
68 >
69 {{ i "git-pull-request-create" "w-4 h-4" }}
70 <span>new</span>
71 </a>
72 </div>
73 <div class="error" id="pulls"></div>
74{{ end }}
75
76{{ define "repoAfter" }}
77 <div class="flex flex-col gap-2 mt-2">
78 {{ range .Pulls }}
79 <div class="rounded bg-white dark:bg-gray-800">
80 <div class="px-6 py-4 z-5">
81 <div class="pb-2">
82 <a href="/{{ $.RepoInfo.FullName }}/pulls/{{ .PullId }}" class="dark:text-white">
83 {{ .Title | description }}
84 <span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span>
85 </a>
86 </div>
87 <div class="text-sm text-gray-500 dark:text-gray-400 flex flex-wrap items-center gap-1">
88 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
89 {{ $icon := "ban" }}
90
91 {{ if .State.IsOpen }}
92 {{ $bgColor = "bg-green-600 dark:bg-green-700" }}
93 {{ $icon = "git-pull-request" }}
94 {{ else if .State.IsMerged }}
95 {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }}
96 {{ $icon = "git-merge" }}
97 {{ end }}
98
99
100 <span
101 class="inline-flex items-center rounded px-2 py-[5px] {{ $bgColor }} text-sm"
102 >
103 {{ i $icon "w-3 h-3 mr-1.5 text-white" }}
104 <span class="text-white">{{ .State.String }}</span>
105 </span>
106
107 <span class="ml-1">
108 {{ template "user/fragments/picHandleLink" .OwnerDid }}
109 </span>
110
111 <span class="before:content-['·']">
112 {{ template "repo/fragments/time" .Created }}
113 </span>
114
115
116 {{ $latestRound := .LastRoundNumber }}
117 {{ $lastSubmission := index .Submissions $latestRound }}
118
119 <span class="before:content-['·']">
120 {{ $commentCount := len $lastSubmission.Comments }}
121 {{ $s := "s" }}
122 {{ if eq $commentCount 1 }}
123 {{ $s = "" }}
124 {{ end }}
125
126 {{ len $lastSubmission.Comments}} comment{{$s}}
127 </span>
128
129 <span class="before:content-['·']">
130 round
131 <span class="font-mono">
132 #{{ .LastRoundNumber }}
133 </span>
134 </span>
135
136 {{ $pipeline := index $.Pipelines .LatestSha }}
137 {{ if and $pipeline $pipeline.Id }}
138 <span class="before:content-['·']"></span>
139 {{ template "repo/pipelines/fragments/pipelineSymbol" $pipeline }}
140 {{ end }}
141
142 {{ $state := .Labels }}
143 {{ range $k, $d := $.LabelDefs }}
144 {{ range $v, $s := $state.GetValSet $d.AtUri.String }}
145 {{ template "labels/fragments/label" (dict "def" $d "val" $v "withPrefix" true) }}
146 {{ end }}
147 {{ end }}
148 </div>
149 </div>
150 {{ if .StackId }}
151 {{ $otherPulls := index $.Stacks .StackId }}
152 {{ if gt (len $otherPulls) 0 }}
153 <details class="bg-white dark:bg-gray-800 group">
154 <summary class="pb-4 px-6 text-xs list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400">
155 {{ $s := "s" }}
156 {{ if eq (len $otherPulls) 1 }}
157 {{ $s = "" }}
158 {{ end }}
159 <div class="group-open:hidden flex items-center gap-2">
160 {{ i "chevrons-up-down" "w-4 h-4" }} expand {{ len $otherPulls }} pull{{$s}} in this stack
161 </div>
162 <div class="hidden group-open:flex items-center gap-2">
163 {{ i "chevrons-down-up" "w-4 h-4" }} hide {{ len $otherPulls }} pull{{$s}} in this stack
164 </div>
165 </summary>
166 {{ block "stackedPullList" (list $otherPulls $) }} {{ end }}
167 </details>
168 {{ end }}
169 {{ end }}
170 </div>
171 {{ end }}
172 </div>
173{{ end }}
174
175{{ define "stackedPullList" }}
176 {{ $list := index . 0 }}
177 {{ $root := index . 1 }}
178 <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">
179 {{ range $pull := $list }}
180 {{ $pipeline := index $root.Pipelines $pull.LatestSha }}
181 <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">
182 <div class="flex gap-2 items-center px-6">
183 <div class="flex-grow min-w-0 w-full py-2">
184 {{ template "repo/pulls/fragments/summarizedPullHeader" (list $pull $pipeline) }}
185 </div>
186 </div>
187 </a>
188 {{ end }}
189 </div>
190{{ end }}