aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@telenet.be>2020-11-22 14:58:12 +0100
committerGitHub <noreply@github.com>2020-11-22 15:58:12 +0200
commit2791cc139e809856f894cd9dfcfceb9c4a9b8865 (patch)
treeff44327a72e4aa42fca0a79d1bfdb80c4664f78c /templates/repo
parentde1e4b2da903c10687cf7d2e51ba4843796e17f2 (diff)
downloadgitea-2791cc139e809856f894cd9dfcfceb9c4a9b8865.tar.gz
gitea-2791cc139e809856f894cd9dfcfceb9c4a9b8865.zip
Don't show a dropdown menu when only 1 merge option is available (#13660) (#13670)
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/issue/view_content/pull.tmpl34
1 files changed, 18 insertions, 16 deletions
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index 347b3b15d3..f7870d60d2 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -335,23 +335,25 @@
{{end}}
</span>
</button>
- <div class="ui dropdown icon button">
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
- <div class="menu">
- {{if $prUnit.PullRequestsConfig.AllowMerge}}
- <div class="item{{if eq .MergeStyle "merge"}} active selected{{end}}" data-do="merge">{{$.i18n.Tr "repo.pulls.merge_pull_request"}}</div>
- {{end}}
- {{if $prUnit.PullRequestsConfig.AllowRebase}}
- <div class="item{{if eq .MergeStyle "rebase"}} active selected{{end}}" data-do="rebase">{{$.i18n.Tr "repo.pulls.rebase_merge_pull_request"}}</div>
- {{end}}
- {{if $prUnit.PullRequestsConfig.AllowRebaseMerge}}
- <div class="item{{if eq .MergeStyle "rebase-merge"}} active selected{{end}}" data-do="rebase-merge">{{$.i18n.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div>
- {{end}}
- {{if $prUnit.PullRequestsConfig.AllowSquash}}
- <div class="item{{if eq .MergeStyle "squash"}} active selected{{end}}" data-do="squash">{{$.i18n.Tr "repo.pulls.squash_merge_pull_request"}}</div>
- {{end}}
+ {{if gt $prUnit.PullRequestsConfig.AllowedMergeStyleCount 1}}
+ <div class="ui dropdown icon button">
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <div class="menu">
+ {{if $prUnit.PullRequestsConfig.AllowMerge}}
+ <div class="item{{if eq .MergeStyle "merge"}} active selected{{end}}" data-do="merge">{{$.i18n.Tr "repo.pulls.merge_pull_request"}}</div>
+ {{end}}
+ {{if $prUnit.PullRequestsConfig.AllowRebase}}
+ <div class="item{{if eq .MergeStyle "rebase"}} active selected{{end}}" data-do="rebase">{{$.i18n.Tr "repo.pulls.rebase_merge_pull_request"}}</div>
+ {{end}}
+ {{if $prUnit.PullRequestsConfig.AllowRebaseMerge}}
+ <div class="item{{if eq .MergeStyle "rebase-merge"}} active selected{{end}}" data-do="rebase-merge">{{$.i18n.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div>
+ {{end}}
+ {{if $prUnit.PullRequestsConfig.AllowSquash}}
+ <div class="item{{if eq .MergeStyle "squash"}} active selected{{end}}" data-do="squash">{{$.i18n.Tr "repo.pulls.squash_merge_pull_request"}}</div>
+ {{end}}
+ </div>
</div>
- </div>
+ {{end}}
</div>
{{else}}
<div class="ui divider"></div>