forked from tangled.org/core
this repo has no description
1{{ define "repo/pulls/fragments/pullHeader" }} 2 <header class="flex items-center gap-2 pb-2"> 3 {{ block "pullState" .Pull }} {{ end }} 4 <h1 class="text-2xl dark:text-white"> 5 {{ .Pull.Title }} 6 <span class="text-gray-500 dark:text-gray-400">#{{ .Pull.PullId }}</span> 7 </h1> 8 </header> 9 10 <section class=""> 11 <div class="flex items-center gap-2"> 12 <span class="text-gray-500 dark:text-gray-400 text-sm"> 13 opened by 14 {{ $owner := index $.DidHandleMap .Pull.OwnerDid }} 15 <a href="/{{ $owner }}" class="no-underline hover:underline">{{ $owner }}</a> 16 <span class="select-none before:content-['\00B7']"></span> 17 <time>{{ .Pull.Created | timeFmt }}</time> 18 <span class="select-none before:content-['\00B7']"></span> 19 <span> 20 targeting 21 <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"> 22 <a href="/{{ .RepoInfo.FullName }}/tree/{{ .Pull.TargetBranch }}" class="no-underline hover:underline">{{ .Pull.TargetBranch }}</a> 23 </span> 24 </span> 25 {{ if not .Pull.IsPatchBased }} 26 from 27 <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"> 28 {{ if .Pull.IsForkBased }} 29 {{ if .Pull.PullSource.Repo }} 30 <a href="/{{ $owner }}/{{ .Pull.PullSource.Repo.Name }}" class="no-underline hover:underline">{{ $owner }}/{{ .Pull.PullSource.Repo.Name }}</a>: 31 {{- else -}} 32 <span class="italic">[deleted fork]</span> 33 {{- end -}} 34 {{- end -}} 35 {{- .Pull.PullSource.Branch -}} 36 </span> 37 {{ end }} 38 </span> 39 </div> 40 41 {{ if .Pull.Body }} 42 <article id="body" class="mt-2 prose dark:prose-invert"> 43 {{ .Pull.Body | markdown }} 44 </article> 45 {{ end }} 46 </section> 47 48{{ end }} 49 50{{ define "singlePullHeader" }} 51{{ end }} 52 53{{ define "stackedPullHeader" }} 54 <div class="border border-gray-200 dark:border-gray-700 rounded-sm"> 55 {{ block "stackedPullHeaderAbove" . }} {{ end }} 56 <div class="p-2"> 57 {{ block "singlePullHeader" . }} {{ end }} 58 </div> 59 {{ block "stackedPullHeaderBelow" . }} {{ end }} 60 </div> 61{{ end }} 62 63{{ define "stackedPullHeaderAbove" }} 64 {{ if .Pull.IsStacked }} 65 {{ $above := .Stack.StrictlyAbove .Pull }} 66 <div class="flex flex-col"> 67 {{ range $pull := $above }} 68 <div class="border-b border-gray-200 dark:border-gray-700 p-2"> 69 {{ block "summarizedHeader" (list $pull $) }} {{ end }} 70 </div> 71 {{ end }} 72 </div> 73 {{ end }} 74{{ end }} 75 76{{ define "stackedPullHeaderBelow" }} 77 {{ if .Pull.IsStacked }} 78 {{ $below := .Stack.StrictlyBelow .Pull }} 79 <div class="flex flex-col"> 80 {{ range $pull := $below }} 81 <div class="border-t border-gray-200 dark:border-gray-700 p-2"> 82 {{ block "summarizedHeader" (list $pull $) }} {{ end }} 83 </div> 84 {{ end }} 85 </div> 86 {{ end }} 87{{ end }} 88 89{{ define "pullState" }} 90 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} 91 {{ $icon := "ban" }} 92 93 {{ if .State.IsOpen }} 94 {{ $bgColor = "bg-green-600 dark:bg-green-700" }} 95 {{ $icon = "git-pull-request" }} 96 {{ else if .State.IsMerged }} 97 {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }} 98 {{ $icon = "git-merge" }} 99 {{ else if .State.IsDeleted }} 100 {{ $bgColor = "bg-red-600 dark:bg-red-700" }} 101 {{ $icon = "git-pull-request-closed" }} 102 {{ end }} 103 104 <div id="state" class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }}" > 105 {{ i $icon "w-4 h-4 mr-1.5 text-white" }} 106 <span class="text-white ">{{ .State.String }}</span> 107 </div> 108{{ end }}