Do not allow commiting to protected branch from online editor (#1502)

* Do not allow commiting to protected branch from online editor

* Add editor integration tests for adding new file and not allowing to add new file to protected branch
This commit is contained in:
Lauris BH 2017-05-02 03:49:55 +03:00 committed by Lunny Xiao
parent 3ebbdfaa75
commit 0144817971
10 changed files with 386 additions and 15 deletions

View file

@ -10,7 +10,7 @@
</div>
<div class="quick-pull-choice js-quick-pull-choice">
<div class="field">
<div class="ui radio checkbox">
<div class="ui radio checkbox {{if not .CanCommitToBranch}}disabled{{end}}">
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" {{if eq .commit_choice "direct"}}checked{{end}}>
<label>
<i class="octicon octicon-git-commit" height="16" width="14"></i>
@ -40,4 +40,4 @@
{{.i18n.Tr "repo.editor.commit_changes"}}
</button>
<a class="ui button red" href="{{EscapePound $.BranchLink}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.editor.cancel"}}</a>
</div>
</div>