mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-27 07:56:13 +00:00
This commit is contained in:
parent
de1e4b2da9
commit
2791cc139e
@ -113,6 +113,24 @@ func (cfg *PullRequestsConfig) IsMergeStyleAllowed(mergeStyle MergeStyle) bool {
|
|||||||
mergeStyle == MergeStyleSquash && cfg.AllowSquash
|
mergeStyle == MergeStyleSquash && cfg.AllowSquash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AllowedMergeStyleCount returns the total count of allowed merge styles for the PullRequestsConfig
|
||||||
|
func (cfg *PullRequestsConfig) AllowedMergeStyleCount() int {
|
||||||
|
count := 0
|
||||||
|
if cfg.AllowMerge {
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
if cfg.AllowRebase {
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
if cfg.AllowRebaseMerge {
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
if cfg.AllowSquash {
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
return count
|
||||||
|
}
|
||||||
|
|
||||||
// BeforeSet is invoked from XORM before setting the value of a field of this object.
|
// BeforeSet is invoked from XORM before setting the value of a field of this object.
|
||||||
func (r *RepoUnit) BeforeSet(colName string, val xorm.Cell) {
|
func (r *RepoUnit) BeforeSet(colName string, val xorm.Cell) {
|
||||||
switch colName {
|
switch colName {
|
||||||
|
@ -335,6 +335,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
{{if gt $prUnit.PullRequestsConfig.AllowedMergeStyleCount 1}}
|
||||||
<div class="ui dropdown icon button">
|
<div class="ui dropdown icon button">
|
||||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
@ -352,6 +353,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
Loading…
Reference in New Issue
Block a user