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