summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2020-01-16 22:01:22 +0100
committerLauris BH <lauris@nix.lv>2020-01-16 23:01:22 +0200
commit18e0447b3f65cb6aab2eec6b742edf911773097f (patch)
treeda114d81702842af266da59ca88a700dfee91c7b /templates/repo
parentd3468ed79fd9e3b29521fa6318492479041696ac (diff)
downloadgitea-18e0447b3f65cb6aab2eec6b742edf911773097f.tar.gz
gitea-18e0447b3f65cb6aab2eec6b742edf911773097f.zip
Fix admin handling at merge of PR (#9749)
* Admin shall be able to bypass merge checks. * Repository admin should not bypass if merge whitelist is set. * Add code comment about checks that PR are ready * notAllOverrideableChecksOk->notAllOverridableChecksOk * Fix merge, require signed currently not overridable. * fix Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/issue/view_content/pull.tmpl8
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index 115ea2d119..f8a82f1a0f 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -133,9 +133,9 @@
{{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
</div>
{{end}}
- {{$notAllOk := or .IsBlockedByApprovals .IsBlockedByRejection (and .RequireSigned (not .WillSign)) (and .EnableStatusCheck (not .IsRequiredStatusCheckSuccess))}}
- {{if and (or $.IsRepoAdmin (not $notAllOk)) (or (not .RequireSigned) .WillSign)}}
- {{if $notAllOk}}
+ {{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection (and .EnableStatusCheck (not .IsRequiredStatusCheckSuccess))}}
+ {{if and (or $.IsRepoAdmin (not $notAllOverridableChecksOk)) (or (not .RequireSigned) .WillSign)}}
+ {{if $notAllOverridableChecksOk}}
<div class="item text yellow">
<i class="icon icon-octicon"><span class="octicon octicon-primitive-dot"></span></i>
{{$.i18n.Tr "repo.pulls.required_status_check_administrator"}}
@@ -233,7 +233,7 @@
</form>
</div>
{{end}}
- <div class="ui {{if $notAllOk}}red{{else}}green{{end}} buttons merge-button">
+ <div class="ui {{if $notAllOverridableChecksOk}}red{{else}}green{{end}} buttons merge-button">
<button class="ui button" data-do="{{.MergeStyle}}">
<span class="octicon octicon-git-merge"></span>
<span class="button-text">