this repo has no description
1{{ define "title" }}pulls · {{ .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 <p 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 <span class="before:content-['·']">
87 targeting
88 <span 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">
89 {{ .TargetBranch }}
90 </span>
91 </span>
92 {{ if not .IsPatchBased }}
93 from
94 <span 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">
95 {{ if .IsForkBased }}
96 {{ if .PullSource.Repo }}
97 <a href="/{{ $owner }}/{{ .PullSource.Repo.Name }}" class="no-underline hover:underline">{{ $owner }}/{{ .PullSource.Repo.Name }}</a>:
98 {{- else -}}
99 <span class="italic">[deleted fork]</span>
100 {{- end -}}
101 {{- end -}}
102 {{- .PullSource.Branch -}}
103 </span>
104 {{ end }}
105 <span class="before:content-['·']">
106 {{ $latestRound := .LastRoundNumber }}
107 {{ $lastSubmission := index .Submissions $latestRound }}
108 round
109 <span 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">
110 #{{ .LastRoundNumber }}
111 </span>
112 {{ $commentCount := len $lastSubmission.Comments }}
113 {{ $s := "s" }}
114 {{ if eq $commentCount 1 }}
115 {{ $s = "" }}
116 {{ end }}
117
118 {{ if eq $commentCount 0 }}
119 awaiting comments
120 {{ else }}
121 recieved {{ len $lastSubmission.Comments}} comment{{$s}}
122 {{ end }}
123 </span>
124 </p>
125 </div>
126 {{ if .StackId }}
127 {{ $otherPulls := index $.Stacks .StackId }}
128 <details class="bg-white dark:bg-gray-800 group">
129 <summary class="pb-4 px-6 text-xs list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400">
130 {{ $s := "s" }}
131 {{ if eq (len $otherPulls) 1 }}
132 {{ $s = "" }}
133 {{ end }}
134 <div class="group-open:hidden flex items-center gap-2">
135 {{ i "chevrons-up-down" "w-4 h-4" }} expand {{ len $otherPulls }} pull{{$s}} in this stack
136 </div>
137 <div class="hidden group-open:flex items-center gap-2">
138 {{ i "chevrons-down-up" "w-4 h-4" }} hide {{ len $otherPulls }} pull{{$s}} in this stack
139 </div>
140 </summary>
141 {{ block "pullList" (list $otherPulls $) }} {{ end }}
142 </details>
143 {{ end }}
144 </div>
145 {{ end }}
146 </div>
147{{ end }}
148
149{{ define "pullList" }}
150 {{ $list := index . 0 }}
151 {{ $root := index . 1 }}
152 <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">
153 {{ range $pull := $list }}
154 <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">
155 <div class="flex gap-2 items-center px-6">
156 <div class="flex-grow min-w-0 w-full py-2">
157 {{ template "repo/pulls/fragments/summarizedHeader" (list $pull 0) }}
158 </div>
159 </div>
160 </a>
161 {{ end }}
162 </div>
163{{ end }}