{{ define "title" }}pulls · {{ .RepoInfo.FullName }}{{ 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 := "closed" }} {{ if .FilteringBy.IsOpen }} {{ $active = "open" }} {{ else if .FilteringBy.IsMerged }} {{ $active = "merged" }} {{ end }} {{ $open := (dict "Key" "open" "Value" "open" "Icon" "git-pull-request" "Meta" (string .RepoInfo.Stats.PullCount.Open)) }} {{ $merged := (dict "Key" "merged" "Value" "merged" "Icon" "git-merge" "Meta" (string .RepoInfo.Stats.PullCount.Merged)) }} {{ $closed := (dict "Key" "closed" "Value" "closed" "Icon" "ban" "Meta" (string .RepoInfo.Stats.PullCount.Closed)) }} {{ $values := list $open $merged $closed }}
{{ template "fragments/tabSelector" (dict "Name" "state" "Values" $values "Active" $active "Include" "#search-q") }}
{{ i "git-pull-request-create" "w-4 h-4" }} new
{{ end }} {{ define "repoAfter" }}
{{ range .Pulls }}
{{ $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" .OwnerDid }} {{ template "repo/fragments/time" .Created }} {{ $latestRound := .LastRoundNumber }} {{ $lastSubmission := index .Submissions $latestRound }} {{ $commentCount := len $lastSubmission.Comments }} {{ $s := "s" }} {{ if eq $commentCount 1 }} {{ $s = "" }} {{ end }} {{ len $lastSubmission.Comments}} comment{{$s}} round #{{ .LastRoundNumber }} {{ $pipeline := index $.Pipelines .LatestSha }} {{ if and $pipeline $pipeline.Id }} {{ template "repo/pipelines/fragments/pipelineSymbol" $pipeline }} {{ end }} {{ $state := .Labels }} {{ range $k, $d := $.LabelDefs }} {{ range $v, $s := $state.GetValSet $d.AtUri.String }} {{ template "labels/fragments/label" (dict "def" $d "val" $v "withPrefix" true) }} {{ end }} {{ end }}
{{ if .StackId }} {{ $otherPulls := index $.Stacks .StackId }} {{ if gt (len $otherPulls) 0 }}
{{ $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 "stackedPullList" (list $otherPulls $) }} {{ end }}
{{ end }} {{ end }}
{{ 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 }}