{{ define "title" }}pulls · {{ .RepoInfo.FullName }}{{ end }} {{ define "extrameta" }} {{ $title := "pulls"}} {{ $url := printf "https://tangled.sh/%s/pulls" .RepoInfo.FullName }} {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} {{ end }} {{ define "repoContent" }}
{{ i "git-pull-request" "w-4 h-4" }} {{ .RepoInfo.Stats.PullCount.Open }} open {{ i "git-merge" "w-4 h-4" }} {{ .RepoInfo.Stats.PullCount.Merged }} merged {{ i "ban" "w-4 h-4" }} {{ .RepoInfo.Stats.PullCount.Closed }} closed
{{ i "git-pull-request-create" "w-4 h-4" }} new
{{ end }} {{ define "repoAfter" }}
{{ range .Pulls }}

{{ $owner := index $.DidHandleMap .OwnerDid }} {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} {{ $icon := "ban" }} {{ if .State.IsOpen }} {{ $bgColor = "bg-green-600 dark:bg-green-700" }} {{ $icon = "git-pull-request" }} {{ else if .State.IsMerged }} {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }} {{ $icon = "git-merge" }} {{ end }} {{ i $icon "w-3 h-3 mr-1.5 text-white" }} {{ .State.String }} {{ template "user/fragments/picHandleLink" $owner }} {{ template "repo/fragments/time" .Created }} targeting {{ .TargetBranch }} {{ if not .IsPatchBased }} from {{ if .IsForkBased }} {{ if .PullSource.Repo }} {{ $owner }}/{{ .PullSource.Repo.Name }}: {{- else -}} [deleted fork] {{- end -}} {{- end -}} {{- .PullSource.Branch -}} {{ end }} {{ $latestRound := .LastRoundNumber }} {{ $lastSubmission := index .Submissions $latestRound }} round #{{ .LastRoundNumber }} {{ $commentCount := len $lastSubmission.Comments }} {{ $s := "s" }} {{ if eq $commentCount 1 }} {{ $s = "" }} {{ end }} {{ if eq $commentCount 0 }} awaiting comments {{ else }} recieved {{ len $lastSubmission.Comments}} comment{{$s}} {{ end }}

{{ if .StackId }} {{ $otherPulls := index $.Stacks .StackId }}
{{ $s := "s" }} {{ if eq (len $otherPulls) 1 }} {{ $s = "" }} {{ end }}
{{ i "chevrons-up-down" "w-4 h-4" }} expand {{ len $otherPulls }} pull{{$s}} in this stack
{{ block "pullList" (list $otherPulls $) }} {{ end }}
{{ end }}
{{ end }}
{{ end }} {{ define "pullList" }} {{ $list := index . 0 }} {{ $root := index . 1 }}
{{ range $pull := $list }}
{{ template "repo/pulls/fragments/summarizedHeader" (list $pull 0) }}
{{ end }}
{{ end }}