forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
1{{ define "repo/pulls/fragments/pullHeader" }} 2<header class="pb-4"> 3 <h1 class="text-2xl dark:text-white"> 4 {{ .Pull.Title }} 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{{ $owner := resolve .Pull.OwnerDid }} 21<section class="mt-2"> 22 <div class="flex items-center gap-2"> 23 <div 24 id="state" 25 class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }}" 26 > 27 {{ i $icon "w-4 h-4 mr-1.5 text-white" }} 28 <span class="text-white">{{ .Pull.State.String }}</span> 29 </div> 30 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 31 opened by 32 {{ template "user/fragments/picHandleLink" .Pull.OwnerDid }} 33 <span class="select-none before:content-['\00B7']"></span> 34 {{ template "repo/fragments/time" .Pull.Created }} 35 36 <span class="select-none before:content-['\00B7']"></span> 37 <span> 38 targeting 39 <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"> 40 <a href="/{{ .RepoInfo.FullName }}/tree/{{ .Pull.TargetBranch }}" class="no-underline hover:underline">{{ .Pull.TargetBranch }}</a> 41 </span> 42 </span> 43 {{ if not .Pull.IsPatchBased }} 44 from 45 <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"> 46 {{ if .Pull.IsForkBased }} 47 {{ if .Pull.PullSource.Repo }} 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 {{ 70 template "repo/fragments/reaction" 71 (dict 72 "Kind" $kind 73 "Count" (index $.Reactions $kind) 74 "IsReacted" (index $.UserReacted $kind) 75 "ThreadAt" $.Pull.PullAt) 76 }} 77 {{ end }} 78 </div> 79 {{ end }} 80</section> 81 82 83{{ end }}