forked from
tangled.org/core
Monorepo for Tangled
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 .Pull.IsForkBased }}
46 {{ if .Pull.PullSource.Repo }}
47 {{ $owner := resolve .Pull.PullSource.Repo.Did }}
48 <a href="/{{ $owner }}/{{ .Pull.PullSource.Repo.Name }}" class="no-underline hover:underline">{{ $owner }}/{{ .Pull.PullSource.Repo.Name }}</a>:
49 {{- else -}}
50 <span class="italic">[deleted fork]</span>
51 {{- end -}}
52 {{- end -}}
53 {{- .Pull.PullSource.Branch -}}
54 </span>
55 {{ end }}
56 </span>
57 </div>
58
59 {{ if .Pull.Body }}
60 <article id="body" class="mt-8 prose dark:prose-invert">
61 {{ .Pull.Body | markdown }}
62 </article>
63 {{ end }}
64
65 {{ with .OrderedReactionKinds }}
66 <div class="flex items-center gap-2 mt-2">
67 {{ template "repo/fragments/reactionsPopUp" . }}
68 {{ range $kind := . }}
69 {{ $reactionData := index $.Reactions $kind }}
70 {{
71 template "repo/fragments/reaction"
72 (dict
73 "Kind" $kind
74 "Count" $reactionData.Count
75 "IsReacted" (index $.UserReacted $kind)
76 "ThreadAt" $.Pull.PullAt
77 "Users" $reactionData.Users)
78 }}
79 {{ end }}
80 </div>
81 {{ end }}
82</section>
83
84
85{{ end }}