{{ define "repo/pulls/fragments/pullStack" }}

STACK

{{ block "pullList" (list .Stack $) }} {{ end }} {{ if gt (len .AbandonedPulls) 0 }}

ABANDONED PULLS

{{ block "pullList" (list .AbandonedPulls $) }} {{ end }} {{ end }} {{ end }} {{ define "summarizedHeader" }}
{{ block "summarizedPullState" . }} {{ end }}
#{{ .PullId }} {{ .Title }}
{{ $latestRound := .LastRoundNumber }} {{ $lastSubmission := index .Submissions $latestRound }} {{ $commentCount := len $lastSubmission.Comments }}
{{ i "message-square" "w-3 h-3 md:hidden" }} {{ $commentCount }}
#{{ $latestRound }}
{{ end }} {{ define "summarizedPullState" }} {{ $fgColor := "text-gray-600 dark:text-gray-300" }} {{ $icon := "ban" }} {{ if .State.IsOpen }} {{ $fgColor = "text-green-600 dark:text-green-500" }} {{ $icon = "git-pull-request" }} {{ else if .State.IsMerged }} {{ $fgColor = "text-purple-600 dark:text-purple-500" }} {{ $icon = "git-merge" }} {{ else if .State.IsDeleted }} {{ $fgColor = "text-red-600 dark:text-red-500" }} {{ $icon = "git-pull-request-closed" }} {{ end }} {{ $style := printf "w-4 h-4 %s" $fgColor }} {{ i $icon $style }} {{ end }} {{ define "pullList" }} {{ $list := index . 0 }} {{ $root := index . 1 }}
{{ range $pull := $list }} {{ $isCurrent := false }} {{ with $root.Pull }} {{ $isCurrent = eq $pull.PullId $root.Pull.PullId }} {{ end }}
{{ if $isCurrent }}
{{ i "arrow-right" "w-4 h-4" }}
{{ end }}
{{ block "summarizedHeader" $pull }} {{ end }}
{{ end }}
{{ end }}