1{{ define "repo/pulls/fragments/pullHeader" }}
2<header class="pb-4">
3 <h1 class="text-2xl dark:text-white">
4 {{ .Pull.Title | description }}
5 <span class="text-gray-500 dark:text-gray-400">#{{ .Pull.PullId }}</span>
6 </h1>
7</header>
8
9{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
10{{ $icon := "ban" }}
11
12{{ if .Pull.State.IsOpen }}
13 {{ $bgColor = "bg-green-600 dark:bg-green-700" }}
14 {{ $icon = "git-pull-request" }}
15{{ else if .Pull.State.IsMerged }}
16 {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }}
17 {{ $icon = "git-merge" }}
18{{ end }}
19
20<section class="mt-2">
21 <div class="flex items-center gap-2">
22 <div
23 id="state"
24 class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }}"
25 >
26 {{ i $icon "w-4 h-4 mr-1.5 text-white" }}
27 <span class="text-white">{{ .Pull.State.String }}</span>
28 </div>
29 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1">
30 opened by
31 {{ template "user/fragments/picHandleLink" .Pull.OwnerDid }}
32 <span class="select-none before:content-['\00B7']"></span>
33 {{ template "repo/fragments/time" .Pull.Created }}
34
35 <span class="select-none before:content-['\00B7']"></span>
36 <span>
37 targeting
38 <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">
39 <a href="/{{ .RepoInfo.FullName }}/tree/{{ .Pull.TargetBranch }}" class="no-underline hover:underline">{{ .Pull.TargetBranch }}</a>
40 </span>
41 </span>
42 {{ if not .Pull.IsPatchBased }}
43 from
44 <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">
45 {{ if not .Pull.IsForkBased }}
46 {{ $repoPath := .RepoInfo.FullName }}
47 <a href="/{{ $repoPath }}/tree/{{ pathEscape .Pull.PullSource.Branch }}" class="no-underline hover:underline">{{ .Pull.PullSource.Branch }}</a>
48 {{ else if .Pull.PullSource.Repo }}
49 {{ $repoPath := print (resolve .Pull.PullSource.Repo.Did) "/" .Pull.PullSource.Repo.Name }}
50 <a href="/{{ $repoPath }}" class="no-underline hover:underline">{{ $repoPath }}</a>:
51 <a href="/{{ $repoPath }}/tree/{{ pathEscape .Pull.PullSource.Branch }}" class="no-underline hover:underline">{{ .Pull.PullSource.Branch }}</a>
52 {{ else }}
53 <span class="italic">[deleted fork]</span>:
54 {{ .Pull.PullSource.Branch }}
55 {{ end }}
56 </span>
57 {{ end }}
58 </span>
59 </div>
60
61 {{ if .Pull.Body }}
62 <article id="body" class="mt-8 prose dark:prose-invert">
63 {{ .Pull.Body | markdown }}
64 </article>
65 {{ end }}
66
67 {{ with .OrderedReactionKinds }}
68 <div class="flex items-center gap-2 mt-2">
69 {{ template "repo/fragments/reactionsPopUp" . }}
70 {{ range $kind := . }}
71 {{ $reactionData := index $.Reactions $kind }}
72 {{
73 template "repo/fragments/reaction"
74 (dict
75 "Kind" $kind
76 "Count" $reactionData.Count
77 "IsReacted" (index $.UserReacted $kind)
78 "ThreadAt" $.Pull.PullAt
79 "Users" $reactionData.Users)
80 }}
81 {{ end }}
82 </div>
83 {{ end }}
84</section>
85
86
87{{ end }}