Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
b34e83d2
Commit
b34e83d2
authored
Aug 27, 2014
by
uran
Committed by
yglukhov
Dec 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected validation of 'Create branch' and 'Create tag' buttons
parent
554719d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
17 deletions
+13
-17
app/assets/javascripts/application.js.coffee
app/assets/javascripts/application.js.coffee
+9
-15
app/views/projects/branches/new.html.haml
app/views/projects/branches/new.html.haml
+2
-1
app/views/projects/tags/new.html.haml
app/views/projects/tags/new.html.haml
+2
-1
No files found.
app/assets/javascripts/application.js.coffee
View file @
b34e83d2
...
@@ -76,24 +76,18 @@ window.disableButtonIfEmptyField = (field_selector, button_selector) ->
...
@@ -76,24 +76,18 @@ window.disableButtonIfEmptyField = (field_selector, button_selector) ->
# Disable button if any input field with given selector is empty
# Disable button if any input field with given selector is empty
window
.
disableButtonIfAnyEmptyField
=
(
form
,
form_selector
,
button_selector
)
->
window
.
disableButtonIfAnyEmptyField
=
(
form
,
form_selector
,
button_selector
)
->
closest_submit
=
form
.
find
(
button_selector
)
closest_submit
=
form
.
find
(
button_selector
)
empty
=
false
updateButtons
=
->
form
.
find
(
'input'
).
filter
(
form_selector
).
each
->
filled
=
true
empty
=
true
if
rstrip
(
$
(
this
).
val
())
is
""
if
empty
closest_submit
.
disable
()
else
closest_submit
.
enable
()
form
.
keyup
->
empty
=
false
form
.
find
(
'input'
).
filter
(
form_selector
).
each
->
form
.
find
(
'input'
).
filter
(
form_selector
).
each
->
empty
=
true
if
rstrip
(
$
(
this
).
val
())
is
""
filled
=
rstrip
(
$
(
this
).
val
())
!=
""
||
!
$
(
this
).
attr
(
'required'
)
if
empty
if
filled
closest_submit
.
disable
()
else
closest_submit
.
enable
()
closest_submit
.
enable
()
else
closest_submit
.
disable
()
updateButtons
()
form
.
keyup
(
updateButtons
)
window
.
sanitize
=
(
str
)
->
window
.
sanitize
=
(
str
)
->
return
str
.
replace
(
/<(?:.|\n)*?>/gm
,
''
)
return
str
.
replace
(
/<(?:.|\n)*?>/gm
,
''
)
...
...
app/views/projects/branches/new.html.haml
View file @
b34e83d2
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
%h3
.page-title
%h3
.page-title
%i
.fa.fa-code-fork
%i
.fa.fa-code-fork
New branch
New branch
=
form_tag
project_branches_path
,
method: :post
,
class:
"form-horizontal"
do
=
form_tag
project_branches_path
,
method: :post
,
id:
"new-branch-form"
,
class:
"form-horizontal"
do
.form-group
.form-group
=
label_tag
:branch_name
,
'Name for new branch'
,
class:
'control-label'
=
label_tag
:branch_name
,
'Name for new branch'
,
class:
'control-label'
.col-sm-10
.col-sm-10
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
=
link_to
'Cancel'
,
project_branches_path
(
@project
),
class:
'btn btn-cancel'
=
link_to
'Cancel'
,
project_branches_path
(
@project
),
class:
'btn btn-cancel'
:javascript
:javascript
disableButtonIfAnyEmptyField
(
$
(
"
#new-branch-form
"
),
"
.form-control
"
,
"
.btn-create
"
);
var
availableTags
=
#{
@project
.
repository
.
ref_names
.
to_json
}
;
var
availableTags
=
#{
@project
.
repository
.
ref_names
.
to_json
}
;
$
(
"
#ref
"
).
autocomplete
({
$
(
"
#ref
"
).
autocomplete
({
...
...
app/views/projects/tags/new.html.haml
View file @
b34e83d2
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
%h3
.page-title
%h3
.page-title
%i
.fa.fa-code-fork
%i
.fa.fa-code-fork
New tag
New tag
=
form_tag
project_tags_path
,
method: :post
,
class:
"form-horizontal"
do
=
form_tag
project_tags_path
,
method: :post
,
id:
"new-tag-form"
,
class:
"form-horizontal"
do
.form-group
.form-group
=
label_tag
:tag_name
,
'Name for new tag'
,
class:
'control-label'
=
label_tag
:tag_name
,
'Name for new tag'
,
class:
'control-label'
.col-sm-10
.col-sm-10
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
=
link_to
'Cancel'
,
project_tags_path
(
@project
),
class:
'btn btn-cancel'
=
link_to
'Cancel'
,
project_tags_path
(
@project
),
class:
'btn btn-cancel'
:javascript
:javascript
disableButtonIfAnyEmptyField
(
$
(
"
#new-tag-form
"
),
"
.form-control
"
,
"
.btn-create
"
);
var
availableTags
=
#{
@project
.
repository
.
ref_names
.
to_json
}
;
var
availableTags
=
#{
@project
.
repository
.
ref_names
.
to_json
}
;
$
(
"
#ref
"
).
autocomplete
({
$
(
"
#ref
"
).
autocomplete
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment