forked from
tangled.org/core
Monorepo for Tangled — https://tangled.org
1{{ define "title" }}pulls · {{ .RepoInfo.FullName }}{{ end }}
2
3{{ define "repoContent" }}
4 <div class="flex justify-between items-center">
5 <p class="dark:text-white">
6 filtering
7 <select
8 class="border p-1 bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-600 dark:text-white"
9 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/pulls?state=' + this.value"
10 >
11 <option value="open" {{ if .FilteringBy.IsOpen }}selected{{ end }}>
12 open ({{ .RepoInfo.Stats.PullCount.Open }})
13 </option>
14 <option value="merged" {{ if .FilteringBy.IsMerged }}selected{{ end }}>
15 merged ({{ .RepoInfo.Stats.PullCount.Merged }})
16 </option>
17 <option value="closed" {{ if .FilteringBy.IsClosed }}selected{{ end }}>
18 closed ({{ .RepoInfo.Stats.PullCount.Closed }})
19 </option>
20 </select>
21 pull requests
22 </p>
23 <a
24 href="/{{ .RepoInfo.FullName }}/pulls/new"
25 class="btn text-sm flex items-center gap-2 no-underline hover:no-underline"
26 >
27 {{ i "git-pull-request-create" "w-4 h-4" }}
28 <span>new</span>
29 </a>
30 </div>
31 <div class="error" id="pulls"></div>
32{{ end }}
33
34{{ define "repoAfter" }}
35 <div class="flex flex-col gap-2 mt-2">
36 {{ range .Pulls }}
37 <div class="rounded drop-shadow-sm bg-white dark:bg-gray-800 px-6 py-4">
38 <div class="pb-2">
39 <a href="/{{ $.RepoInfo.FullName }}/pulls/{{ .PullId }}" class="dark:text-white">
40 {{ .Title }}
41 <span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span>
42 </a>
43 </div>
44 <p class="text-sm text-gray-500 dark:text-gray-400">
45 {{ $owner := index $.DidHandleMap .OwnerDid }}
46 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
47 {{ $icon := "ban" }}
48
49 {{ if .State.IsOpen }}
50 {{ $bgColor = "bg-green-600 dark:bg-green-700" }}
51 {{ $icon = "git-pull-request" }}
52 {{ else if .State.IsMerged }}
53 {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }}
54 {{ $icon = "git-merge" }}
55 {{ end }}
56
57
58 <span
59 class="inline-flex items-center rounded px-2 py-[5px] {{ $bgColor }} text-sm"
60 >
61 {{ i $icon "w-3 h-3 mr-1.5 text-white" }}
62 <span class="text-white">{{ .State.String }}</span>
63 </span>
64
65 <span>
66 <a href="/{{ $owner }}" class="dark:text-gray-300">{{ $owner }}</a>
67 </span>
68
69 <span class="before:content-['·']">
70 <time>
71 {{ .Created | timeFmt }}
72 </time>
73 </span>
74
75 <span class="before:content-['·']">
76 targeting
77 <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">
78 {{ .TargetBranch }}
79 </span>
80 </span>
81 {{ if not .IsPatchBased }}
82 <span>from
83 {{ if .IsForkBased }}
84 {{ if .PullSource.Repo }}
85 <a href="/{{ $owner }}/{{ .PullSource.Repo.Name }}" class="no-underline hover:underline">{{ $owner }}/{{ .PullSource.Repo.Name }}</a>
86 {{ else }}
87 <span class="italic">[deleted fork]</span>
88 {{ end }}
89 {{ end }}
90
91 <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">
92 {{ .PullSource.Branch }}
93 </span>
94 </span>
95 {{ end }}
96 <span class="before:content-['·']">
97 {{ $latestRound := .LastRoundNumber }}
98 {{ $lastSubmission := index .Submissions $latestRound }}
99 round
100 <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">
101 #{{ .LastRoundNumber }}
102 </span>
103 {{ $commentCount := len $lastSubmission.Comments }}
104 {{ $s := "s" }}
105 {{ if eq $commentCount 1 }}
106 {{ $s = "" }}
107 {{ end }}
108
109 {{ if eq $commentCount 0 }}
110 awaiting comments
111 {{ else }}
112 recieved {{ len $lastSubmission.Comments}} comment{{$s}}
113 {{ end }}
114 </span>
115 </p>
116 </div>
117 {{ end }}
118 </div>
119{{ end }}