@ -75,6 +75,7 @@
{{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a>
{{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a>
<div class="content">
<div class="content">
{{template "repo/pulls/status" .}}
{{template "repo/pulls/status" .}}
{{ $ canAutoMerge := false}}
<div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}">
<div class="ui attached merge-section segment {{if not $.LatestCommitStatus}}no-header{{end}}">
{{if .Issue.PullRequest.HasMerged}}
{{if .Issue.PullRequest.HasMerged}}
<div class="item text purple">
<div class="item text purple">
@ -188,6 +189,30 @@
{{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
{{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
</div>
</div>
{{end}}
{{end}}
{{end}}
{{ $ canAutoMerge = true}}
{{if (gt .Issue.PullRequest.CommitsBehind 0)}}
<div class="ui divider"></div>
<div class="item item-section text grey">
<div class="item-section-left">
<i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i>
{{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}
</div>
<div class="item-section-right">
{{if .UpdateAllowed}}
<form action="{{.Link}}/update" method="post" class="ui update-branch-form">
{{.CsrfTokenHtml}}
<button class="ui compact button" data-do="update">
<span class="ui text">{{$.i18n.Tr "repo.pulls.update_branch"}}</span>
</button>
</form>
{{end}}
</div>
</div>
{{end}}
{{if and (or $.IsRepoAdmin (not $ notAllOverridableChecksOk )) (or (not .RequireSigned) .WillSign)}}
{{if .AllowMerge}}
{{if .AllowMerge}}
{{ $ prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
{{ $ prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
{{ $ approvers := .Issue.PullRequest.GetApprovers}}
{{ $ approvers := .Issue.PullRequest.GetApprovers}}
@ -300,6 +325,7 @@
</div>
</div>
</div>
</div>
{{else}}
{{else}}
<div class="ui divider"></div>
<div class="item text red">
<div class="item text red">
{{svg "octicon-x" 16}}
{{svg "octicon-x" 16}}
{{$.i18n.Tr "repo.pulls.no_merge_desc"}}
{{$.i18n.Tr "repo.pulls.no_merge_desc"}}
@ -310,32 +336,13 @@
</div>
</div>
{{end}}
{{end}}
{{else}}
{{else}}
<div class="ui divider"></div>
<div class="item text grey">
<div class="item text grey">
{{svg "octicon-info" 16}}
{{svg "octicon-info" 16}}
{{$.i18n.Tr "repo.pulls.no_merge_access"}}
{{$.i18n.Tr "repo.pulls.no_merge_access"}}
</div>
</div>
{{end}}
{{end}}
{{end}}
{{end}}
{{if gt .Issue.PullRequest.CommitsBehind 0}}
<div class="ui very compact branch-update grid">
<div class="row">
<div class="item text gray eleven wide left floated column">
<i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i>
{{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}
</div>
{{if .UpdateAllowed}}
<div class="item text five wide right floated column">
<form action="{{.Link}}/update" method="post">
{{.CsrfTokenHtml}}
<button class="ui button" data-do="update">
<span class="item text">{{$.i18n.Tr "repo.pulls.update_branch"}}</span>
</button>
</form>
</div>
{{end}}
</div>
</div>
{{end}}
{{else}}
{{else}}
{{/* Merge conflict without specific file. Suggest manual merge, only if all reviews and status checks OK. */}}
{{/* Merge conflict without specific file. Suggest manual merge, only if all reviews and status checks OK. */}}
{{if .IsBlockedByApprovals}}
{{if .IsBlockedByApprovals}}
@ -374,6 +381,21 @@
</div>
</div>
{{end}}
{{end}}
{{end}}
{{end}}
{{if and (gt .Issue.PullRequest.CommitsBehind 0) (not .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $ canAutoMerge )}}
<div class="item text grey">
<i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i>
{{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}
{{if .UpdateAllowed}}
<form action="{{.Link}}/update" method="post" class="ui floating right">
{{.CsrfTokenHtml}}
<button class="ui compact button" data-do="update">
<span class="ui text">{{$.i18n.Tr "repo.pulls.update_branch"}}</span>
</button>
</form>
{{end}}
</div>
{{end}}
</div>
</div>
</div>
</div>
</div>
</div>