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