{{ define "title" }}Pulls · {{ .RepoInfo.FullName }} · Tangled{{ end }} {{ define "extrameta" }} {{ $title := "Pulls"}} {{ $url := printf "https://tangled.org/%s/pulls" .RepoInfo.FullName }} {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} {{ end }} {{ define "repoContent" }} {{ $active := .FilterState }} {{ $open := (dict "Key" "open" "Value" "Open" "Icon" "git-pull-request" "Meta" (scaleFmt .RepoInfo.Stats.PullCount.Open)) }} {{ $merged := (dict "Key" "merged" "Value" "Merged" "Icon" "git-merge" "Meta" (scaleFmt .RepoInfo.Stats.PullCount.Merged)) }} {{ $closed := (dict "Key" "closed" "Value" "Closed" "Icon" "ban" "Meta" (scaleFmt .RepoInfo.Stats.PullCount.Closed)) }} {{ $values := list $open $merged $closed }}
{{ template "fragments/tabSelector" (dict "Name" "state" "Values" $values "Active" $active "Include" "#search-q" "Form" "search-form") }}
{{ i "git-pull-request-create" "w-4 h-4" }} New
{{ end }} {{ define "repoAfter" }}
{{ range $stack := .Stacks }} {{ $topPR := index $stack 0 }}
{{ template "repo/pulls/fragments/pullState" $topPR.State }} {{ template "user/fragments/picLink" (list $topPR.OwnerDid "size-6" (index $.VouchRelationships (did $topPR.OwnerDid))) }} {{ resolve $topPR.OwnerDid }} {{ template "repo/fragments/time" $topPR.Created }} {{ $commentCount := $topPR.TotalComments }} {{ $commentCount }} comment{{ if ne $commentCount 1 }}s{{ end }} Round #{{ $topPR.LastRoundNumber }} {{ $pipeline := index $.Pipelines $topPR.LatestSha }} {{ if and $pipeline $pipeline.Id }} {{ template "repo/pipelines/fragments/pipelineSymbol" (dict "Pipeline" $pipeline "ShortSummary" true) }} {{ end }} {{ $state := $topPR.Labels }} {{ range $k, $d := $.LabelDefs }} {{ range $v, $s := $state.GetValSet $d.AtUri.String }} {{ template "labels/fragments/label" (dict "def" $d "val" $v "withPrefix" true "baseFilterQuery" $.BaseFilterQuery "basePath" (printf "/%s/pulls" $.RepoInfo.FullName)) }} {{ end }} {{ end }}
{{ if gt (len $stack) 1 }}
{{ i "chevrons-up-down" "size-3" }} {{ $rest := sub (len $stack) 1 }} Expand {{ $rest }} pull{{if ne $rest 1 }}s{{end}} in this stack {{ template "stackedPullList" (list (slice $stack 1) $) }}
{{ end }}
{{ end }}
{{if gt .PullCount .Page.Limit }} {{ template "fragments/pagination" (dict "Page" .Page "TotalCount" .PullCount "BasePath" (printf "/%s/pulls" .RepoInfo.FullName) "QueryParams" (queryParams "q" .FilterQuery) ) }} {{ end }} {{ end }} {{ define "stackedPullList" }} {{ $list := index . 0 }} {{ $root := index . 1 }}
{{ range $pull := $list }} {{ $pipeline := index $root.Pipelines $pull.LatestSha }}
{{ template "repo/pulls/fragments/summarizedPullHeader" (list $pull $pipeline) }}
{{ end }}
{{ end }}