diff options
author | Chri-s <Chri-s@users.noreply.github.com> | 2018-03-25 12:01:32 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-03-25 13:01:32 +0300 |
commit | 9350ba7947d8caa6e7338d7c9e54df2f3aef2146 (patch) | |
tree | e40e1f9810c03221073742040c7fc2c93b3b7546 /templates | |
parent | 04b7fd87b9d74aa6a0c559ac218546978bbf6f33 (diff) | |
download | gitea-9350ba7947d8caa6e7338d7c9e54df2f3aef2146.tar.gz gitea-9350ba7947d8caa6e7338d7c9e54df2f3aef2146.zip |
Add protected branch whitelists for merging (#3689)
* Add database migrations for merge whitelist
* Add merge whitelist settings for protected branches
* Add checks for merge whitelists
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/settings/protected_branch.tmpl | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/templates/repo/settings/protected_branch.tmpl b/templates/repo/settings/protected_branch.tmpl index a3a153eb3f..6c892b662a 100644 --- a/templates/repo/settings/protected_branch.tmpl +++ b/templates/repo/settings/protected_branch.tmpl @@ -60,6 +60,49 @@ </div> {{end}} </div> + + <div class="field"> + <div class="ui checkbox"> + <input class="enable-whitelist" name="enable_merge_whitelist" type="checkbox" data-target="#merge_whitelist_box" {{if .Branch.EnableMergeWhitelist}}checked{{end}}> + <label>{{.i18n.Tr "repo.settings.protect_merge_whitelist_committers"}}</label> + <p class="help">{{.i18n.Tr "repo.settings.protect_merge_whitelist_committers_desc"}}</p> + </div> + </div> + <div id="merge_whitelist_box" class="fields {{if not .Branch.EnableMergeWhitelist}}disabled{{end}}"> + <div class="whitelist field"> + <label>{{.i18n.Tr "repo.settings.protect_merge_whitelist_users"}}</label> + <div class="ui multiple search selection dropdown"> + <input type="hidden" name="merge_whitelist_users" value="{{.merge_whitelist_users}}"> + <div class="default text">{{.i18n.Tr "repo.settings.protect_whitelist_search_users"}}</div> + <div class="menu"> + {{range .Users}} + <div class="item" data-value="{{.ID}}"> + <img class="ui mini image" src="{{.RelAvatarLink}}"> + {{.Name}} + </div> + {{end}} + </div> + </div> + </div> + {{if .Owner.IsOrganization}} + <br> + <div class="whitelist field"> + <label>{{.i18n.Tr "repo.settings.protect_merge_whitelist_teams"}}</label> + <div class="ui multiple search selection dropdown"> + <input type="hidden" name="merge_whitelist_teams" value="{{.merge_whitelist_teams}}"> + <div class="default text">{{.i18n.Tr "repo.settings.protect_whitelist_search_teams"}}</div> + <div class="menu"> + {{range .Teams}} + <div class="item" data-value="{{.ID}}"> + <i class="octicon octicon-jersey"></i> + {{.Name}} + </div> + {{end}} + </div> + </div> + </div> + {{end}} + </div> </div> <div class="ui divider"></div> |