forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
1{{ define "title" }}pulls &middot; {{ .RepoInfo.FullName }}{{ end }} 2 3{{ define "repoContent" }} 4 <div class="flex justify-between items-center"> 5 <p class="dark:text-white"> 6 filtering 7 <select 8 class="border p-1 bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-600 dark:text-white" 9 onchange="window.location.href = '/{{ .RepoInfo.FullName }}/pulls?state=' + this.value" 10 > 11 <option value="open" {{ if .FilteringBy.IsOpen }}selected{{ end }}> 12 open ({{ .RepoInfo.Stats.PullCount.Open }}) 13 </option> 14 <option value="merged" {{ if .FilteringBy.IsMerged }}selected{{ end }}> 15 merged ({{ .RepoInfo.Stats.PullCount.Merged }}) 16 </option> 17 <option value="closed" {{ if .FilteringBy.IsClosed }}selected{{ end }}> 18 closed ({{ .RepoInfo.Stats.PullCount.Closed }}) 19 </option> 20 </select> 21 pull requests 22 </p> 23 <a 24 href="/{{ .RepoInfo.FullName }}/pulls/new" 25 class="btn text-sm flex items-center gap-2 no-underline hover:no-underline" 26 > 27 {{ i "git-pull-request-create" "w-4 h-4" }} 28 <span>new</span> 29 </a> 30 </div> 31 <div class="error" id="pulls"></div> 32{{ end }} 33 34{{ define "repoAfter" }} 35 <div class="flex flex-col gap-2 mt-2"> 36 {{ range .Pulls }} 37 <div class="rounded drop-shadow-sm bg-white dark:bg-gray-800 px-6 py-4"> 38 <div class="pb-2"> 39 <a href="/{{ $.RepoInfo.FullName }}/pulls/{{ .PullId }}" class="dark:text-white"> 40 {{ .Title }} 41 <span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span> 42 </a> 43 </div> 44 <p class="text-sm text-gray-500 dark:text-gray-400"> 45 {{ $owner := index $.DidHandleMap .OwnerDid }} 46 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} 47 {{ $icon := "ban" }} 48 49 {{ if .State.IsOpen }} 50 {{ $bgColor = "bg-green-600 dark:bg-green-700" }} 51 {{ $icon = "git-pull-request" }} 52 {{ else if .State.IsMerged }} 53 {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }} 54 {{ $icon = "git-merge" }} 55 {{ end }} 56 57 58 <span 59 class="inline-flex items-center rounded px-2 py-[5px] {{ $bgColor }} text-sm" 60 > 61 {{ i $icon "w-3 h-3 mr-1.5 text-white" }} 62 <span class="text-white">{{ .State.String }}</span> 63 </span> 64 65 <span> 66 <a href="/{{ $owner }}" class="dark:text-gray-300">{{ $owner }}</a> 67 </span> 68 69 <span class="before:content-['·']"> 70 <time> 71 {{ .Created | timeFmt }} 72 </time> 73 </span> 74 75 <span class="before:content-['·']"> 76 targeting 77 <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"> 78 {{ .TargetBranch }} 79 </span> 80 </span> 81 {{ if not .IsPatchBased }} 82 from 83 <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"> 84 {{ if .IsForkBased }} 85 {{ if .PullSource.Repo }} 86 <a href="/{{ $owner }}/{{ .PullSource.Repo.Name }}" class="no-underline hover:underline">{{ $owner }}/{{ .PullSource.Repo.Name }}</a>: 87 {{- else -}} 88 <span class="italic">[deleted fork]</span> 89 {{- end -}} 90 {{- end -}} 91 {{- .PullSource.Branch -}} 92 </span> 93 {{ end }} 94 <span class="before:content-['·']"> 95 {{ $latestRound := .LastRoundNumber }} 96 {{ $lastSubmission := index .Submissions $latestRound }} 97 round 98 <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"> 99 #{{ .LastRoundNumber }} 100 </span> 101 {{ $commentCount := len $lastSubmission.Comments }} 102 {{ $s := "s" }} 103 {{ if eq $commentCount 1 }} 104 {{ $s = "" }} 105 {{ end }} 106 107 {{ if eq $commentCount 0 }} 108 awaiting comments 109 {{ else }} 110 recieved {{ len $lastSubmission.Comments}} comment{{$s}} 111 {{ end }} 112 </span> 113 </p> 114 </div> 115 {{ end }} 116 </div> 117{{ end }}