Monorepo for Tangled
at 137098c6facc621749546975820d7bdf69742fab 75 lines 3.2 kB view raw
1{{ define "repo/pulls/fragments/pullHeader" }} 2<header class="pb-2"> 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> 21 <div class="flex items-center gap-2"> 22 <span 23 class="inline-flex items-center rounded px-2 py-[5px] {{ $bgColor }} text-sm" 24 > 25 {{ i $icon "w-3 h-3 mr-1.5 text-white" }} 26 <span class="text-white">{{ .Pull.State.String }}</span> 27 </span> 28 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 29 opened by 30 {{ template "user/fragments/picHandleLink" .Pull.OwnerDid }} 31 <span class="select-none before:content-['\00B7']"></span> 32 {{ template "repo/fragments/time" .Pull.Created }} 33 34 <span class="select-none before:content-['\00B7']"></span> 35 <span> 36 targeting 37 <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"> 38 <a href="/{{ .RepoInfo.FullName }}/tree/{{ .Pull.TargetBranch }}" class="no-underline hover:underline">{{ .Pull.TargetBranch }}</a> 39 </span> 40 </span> 41 {{ if not .Pull.IsPatchBased }} 42 from 43 <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"> 44 {{ if not .Pull.IsForkBased }} 45 {{ $repoPath := .RepoInfo.FullName }} 46 <a href="/{{ $repoPath }}/tree/{{ pathEscape .Pull.PullSource.Branch }}" class="no-underline hover:underline">{{ .Pull.PullSource.Branch }}</a> 47 {{ else if .Pull.PullSource.Repo }} 48 {{ $repoPath := print (resolve .Pull.PullSource.Repo.Did) "/" .Pull.PullSource.Repo.Name }} 49 <a href="/{{ $repoPath }}" class="no-underline hover:underline">{{ $repoPath }}</a>: 50 <a href="/{{ $repoPath }}/tree/{{ pathEscape .Pull.PullSource.Branch }}" class="no-underline hover:underline">{{ .Pull.PullSource.Branch }}</a> 51 {{ else }} 52 <span class="italic">[deleted fork]</span>: 53 {{ .Pull.PullSource.Branch }} 54 {{ end }} 55 </span> 56 {{ end }} 57 </span> 58 </div> 59 60 {{ if .Pull.Body }} 61 <article id="body" class="mt-8 prose dark:prose-invert"> 62 {{ .Pull.Body | markdown }} 63 </article> 64 {{ end }} 65 66 <div class="mt-2"> 67 {{ template "repo/fragments/reactions" 68 (dict "Reactions" .Reactions 69 "UserReacted" .UserReacted 70 "ThreadAt" .Pull.AtUri) }} 71 </div> 72</section> 73 74 75{{ end }}