summaryrefslogtreecommitdiffstats
path: root/templates/repo/settings/options.tmpl
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-01-05 20:56:50 +0200
committerGitHub <noreply@github.com>2018-01-05 20:56:50 +0200
commit8ac1501ad7f8b350bd9c1bf01b25f994fd3560f9 (patch)
treecf9b661996134da3e39aa6ddd2af4e13f7dbf30f /templates/repo/settings/options.tmpl
parenta192f3052ed9b59d1404fdcebf2b5c156d6d6969 (diff)
downloadgitea-8ac1501ad7f8b350bd9c1bf01b25f994fd3560f9.tar.gz
gitea-8ac1501ad7f8b350bd9c1bf01b25f994fd3560f9.zip
Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge (#3188)
* Pull request options migration and UI in settings * Add ignore whitespace functionality * Fix settings if pull requests are disabled * Fix migration transaction * Merge with Rebase functionality * UI changes and related functionality for pull request merging button * Implement squash functionality * Fix rebase merging * Fix pull request merge tests * Add squash and rebase tests * Fix API method to reuse default message functions * Some refactoring and small fixes * Remove more hardcoded values from tests * Remove unneeded check from API method * Fix variable name and comment typo * Fix reset commit count after PR merge
Diffstat (limited to 'templates/repo/settings/options.tmpl')
-rw-r--r--templates/repo/settings/options.tmpl31
1 files changed, 29 insertions, 2 deletions
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 41a91ea26e..3bc1a209f0 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -192,14 +192,41 @@
{{if .Repository.CanEnablePulls}}
<div class="ui divider"></div>
-
+ {{$pullRequestEnabled := .Repository.UnitEnabled $.UnitTypePullRequests}}
+ {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
<div class="inline field">
<label>{{.i18n.Tr "repo.pulls"}}</label>
<div class="ui checkbox">
- <input name="enable_pulls" type="checkbox" {{if .Repository.UnitEnabled $.UnitTypePullRequests}}checked{{end}}>
+ <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}>
<label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
</div>
</div>
+ <div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box">
+ <div class="field">
+ <div class="ui checkbox">
+ <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
+ </div>
+ </div>
+ <div class="field">
+ <div class="ui checkbox">
+ <input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.pulls.allow_merge_commits"}}</label>
+ </div>
+ </div>
+ <div class="field">
+ <div class="ui checkbox">
+ <input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.pulls.allow_rebase_merge"}}</label>
+ </div>
+ </div>
+ <div class="field">
+ <div class="ui checkbox">
+ <input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.pulls.allow_squash_commits"}}</label>
+ </div>
+ </div>
+ </div>
{{end}}
<div class="ui divider"></div>