{{ define "repo/pulls/fragments/pullActions" }} {{ $lastIdx := sub (len .Pull.Submissions) 1 }} {{ $roundNumber := .RoundNumber }} {{ $isPushAllowed := .RepoInfo.Roles.IsPushAllowed }} {{ $isMerged := .Pull.State.IsMerged }} {{ $isClosed := .Pull.State.IsClosed }} {{ $isOpen := .Pull.State.IsOpen }} {{ $isConflicted := and .MergeCheck (or .MergeCheck.Error .MergeCheck.IsConflicted) }} {{ $isPullAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Pull.OwnerDid) }} {{ $isLastRound := eq $roundNumber $lastIdx }} {{ $isSameRepoBranch := .Pull.IsBranchBased }} {{ $isUpToDate := .ResubmitCheck.No }}
{{ if and $isPushAllowed $isOpen $isLastRound }} {{ $disabled := "" }} {{ if $isConflicted }} {{ $disabled = "disabled" }} {{ end }} {{ end }} {{ if and $isPullAuthor $isOpen $isLastRound }} {{ $disabled := "" }} {{ if $isUpToDate }} {{ $disabled = "disabled" }} {{ end }} {{ end }} {{ if and (or $isPullAuthor $isPushAllowed) $isOpen $isLastRound }} {{ end }} {{ if and (or $isPullAuthor $isPushAllowed) $isClosed $isLastRound }} {{ end }}
{{ end }}