diff options
author | 6543 <6543@obermui.de> | 2020-04-17 03:00:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-16 22:00:36 -0300 |
commit | c52d48aae46af879fdfcfd94d03b7072878b5441 (patch) | |
tree | 8a3c5e7ab477059ceabd96a73ecb702602227c19 /templates/repo/issue | |
parent | 2cb5878529992c1ffa6de2143d4a1e4673e33b1a (diff) | |
download | gitea-c52d48aae46af879fdfcfd94d03b7072878b5441.tar.gz gitea-c52d48aae46af879fdfcfd94d03b7072878b5441.zip |
Prevent merge of outdated PRs on protected branches (#11012)
* Block PR on Outdated Branch
* finalize
* cleanup
* fix typo and sentences
thanks @guillep2k
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'templates/repo/issue')
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 73a6d695ff..e66c2f6a9a 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -66,6 +66,7 @@ {{- else if .IsPullRequestBroken}}red {{- else if .IsBlockedByApprovals}}red {{- else if .IsBlockedByRejection}}red + {{- else if .IsBlockedByOutdatedBranch}}red {{- else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsFailure .RequiredStatusCheckState.IsError)}}red {{- else if and .EnableStatusCheck (or (not $.LatestCommitStatus) .RequiredStatusCheckState.IsPending .RequiredStatusCheckState.IsWarning)}}yellow {{- else if and .RequireSigned (not .WillSign)}}}red @@ -138,6 +139,11 @@ <i class="icon icon-octicon">{{svg "octicon-x" 16}}</i> {{$.i18n.Tr "repo.pulls.blocked_by_rejection"}} </div> + {{else if .IsBlockedByOutdatedBranch}} + <div class="item text red"> + <i class="icon icon-octicon">{{svg "octicon-x" 16}}</i> + {{$.i18n.Tr "repo.pulls.blocked_by_outdated_branch"}} + </div> {{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}} <div class="item text red"> <i class="icon icon-octicon">{{svg "octicon-x" 16}}</i> @@ -158,7 +164,7 @@ {{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }} </div> {{end}} - {{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}} + {{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOutdatedBranch (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}} {{if and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .RequireSigned) .WillSign)}} {{if $notAllOverridableChecksOk}} <div class="item text yellow"> @@ -342,6 +348,11 @@ {{svg "octicon-x" 16}} {{$.i18n.Tr "repo.pulls.blocked_by_rejection"}} </div> + {{else if .IsBlockedByOutdatedBranch}} + <div class="item text red"> + <i class="icon icon-octicon">{{svg "octicon-x" 16}}</i> + {{$.i18n.Tr "repo.pulls.blocked_by_outdated_branch"}} + </div> {{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}} <div class="item text red"> {{svg "octicon-x" 16}} |