diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index 3a89cd184f..c66e7734a6 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -75,6 +75,7 @@
{{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}
{{template "repo/pulls/status" .}}
+ {{$canAutoMerge := false}}
{{else}}
+
{{svg "octicon-x" 16}}
{{$.i18n.Tr "repo.pulls.no_merge_desc"}}
@@ -310,32 +336,13 @@
{{end}}
{{else}}
+
{{svg "octicon-info" 16}}
{{$.i18n.Tr "repo.pulls.no_merge_access"}}
{{end}}
{{end}}
- {{if gt .Issue.PullRequest.CommitsBehind 0}}
-
-
-
- {{svg "octicon-alert" 16}}
- {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}
-
- {{if .UpdateAllowed}}
-
-
-
- {{end}}
-
-
- {{end}}
{{else}}
{{/* Merge conflict without specific file. Suggest manual merge, only if all reviews and status checks OK. */}}
{{if .IsBlockedByApprovals}}
@@ -374,6 +381,21 @@
{{end}}
{{end}}
+
+ {{if and (gt .Issue.PullRequest.CommitsBehind 0) (not .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $canAutoMerge)}}
+
+ {{svg "octicon-alert" 16}}
+ {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}}
+ {{if .UpdateAllowed}}
+
+ {{end}}
+
+ {{end}}
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less
index 2414a4f13b..0687347efd 100644
--- a/web_src/less/_repository.less
+++ b/web_src/less/_repository.less
@@ -995,8 +995,17 @@
> .merge-section {
background-color: #f7f7f7;
- .item + .item {
- padding-top: .5rem;
+ .item {
+ padding: .25rem 0;
+ }
+
+ .item-section {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0;
+ margin-top: -.25rem;
+ margin-bottom: -.25rem;
}
.divider {