summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-17 16:59:15 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-17 17:17:37 -0200
commit1757e6ef65a1cedbfe5d5b5da894d6d0d3d5ef16 (patch)
treeae3512b6b49c95451869d9e486d94155448bd3e3 /app/views
parentc91cf1f66b3ed4329b313b7b75fca816fc5c6076 (diff)
downloadgitlab-ce-1757e6ef65a1cedbfe5d5b5da894d6d0d3d5ef16.tar.gz
Add JS validation for invalid characters in branch name
More info about valid ref names: https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.ht ml
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/branches/new.html.haml10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml
index 31943a2407a..c659af6338c 100644
--- a/app/views/projects/branches/new.html.haml
+++ b/app/views/projects/branches/new.html.haml
@@ -9,11 +9,12 @@
New Branch
%hr
-= form_tag namespace_project_branches_path, method: :post, id: "new-branch-form", class: "form-horizontal js-requires-input" do
+= form_tag namespace_project_branches_path, method: :post, id: "new-branch-form", class: "form-horizontal js-create-branch-form js-requires-input" do
.form-group
= label_tag :branch_name, nil, class: 'control-label'
.col-sm-10
- = text_field_tag :branch_name, params[:branch_name], required: true, tabindex: 1, autofocus: true, class: 'form-control'
+ = text_field_tag :branch_name, params[:branch_name], required: true, tabindex: 1, autofocus: true, class: 'form-control js-branch-name'
+ .help-block.text-danger.js-branch-name-error
.form-group
= label_tag :ref, 'Create from', class: 'control-label'
.col-sm-10
@@ -26,7 +27,4 @@
:javascript
var availableRefs = #{@project.repository.ref_names.to_json};
- $("#ref").autocomplete({
- source: availableRefs,
- minLength: 1
- });
+ new NewBranchForm($('.js-create-branch-form'), availableRefs)