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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
cbb44b9d
Commit
cbb44b9d
authored
Sep 12, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7662 from Razer6/disable_buttons_on_empty_form
[UX] Disable buttons if form is empty
parents
318d5d93
233d89a9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
app/views/projects/blob/_remove.html.haml
app/views/projects/blob/_remove.html.haml
+4
-1
app/views/projects/network/show.html.haml
app/views/projects/network/show.html.haml
+4
-2
app/views/projects/new_tree/show.html.haml
app/views/projects/new_tree/show.html.haml
+4
-4
No files found.
app/views/projects/blob/_remove.html.haml
View file @
cbb44b9d
...
...
@@ -19,5 +19,8 @@
.form-group
.col-sm-2
.col-sm-10
=
submit_tag
'Remove file'
,
class:
'btn btn-remove'
=
submit_tag
'Remove file'
,
class:
'btn btn-remove
btn-remove-file
'
=
link_to
"Cancel"
,
'#'
,
class:
"btn btn-cancel"
,
"data-dismiss"
=>
"modal"
:javascript
disableButtonIfEmptyField
(
'
#commit_message
'
,
'
.btn-remove-file
'
)
app/views/projects/network/show.html.haml
View file @
cbb44b9d
...
...
@@ -2,8 +2,8 @@
.project-network
.controls
=
form_tag
project_network_path
(
@project
,
@id
),
method: :get
,
class:
'form-inline network-form'
do
|
f
|
=
text_field_tag
:extended_sha1
,
@options
[
:extended_sha1
],
placeholder:
"Input an extended SHA1 syntax"
,
class:
"search-input form-control input-mx-250"
=
button_tag
type:
'submit'
,
class:
'btn btn-success'
do
=
text_field_tag
:extended_sha1
,
@options
[
:extended_sha1
],
placeholder:
"Input an extended SHA1 syntax"
,
class:
'search-input form-control input-mx-250 search-sha'
=
button_tag
type:
'submit'
,
class:
'btn btn-success
btn-search-sha
'
do
%i
.icon-search
.inline.prepend-left-20
.checkbox.light
...
...
@@ -15,6 +15,8 @@
=
spinner
nil
,
true
:javascript
disableButtonIfEmptyField
(
'
#extended_sha1
'
,
'
.btn-search-sha
'
)
network_graph
=
new
Network
({
url
:
'
#{
project_network_path
(
@project
,
@ref
,
@options
.
merge
(
format: :json
))
}
'
,
commit_url
:
'
#{
project_commit_path
(
@project
,
'ae45ca32'
).
gsub
(
"ae45ca32"
,
"%s"
)
}
'
,
...
...
app/views/projects/new_tree/show.html.haml
View file @
cbb44b9d
%h3
.page-title
New file
%hr
.file-editor
=
form_tag
(
project_new_tree_path
(
@project
,
@id
),
method: :put
,
class:
"form-horizontal"
)
do
=
form_tag
(
project_new_tree_path
(
@project
,
@id
),
method: :put
,
class:
'form-horizontal form-new-file'
)
do
.form-group.commit_message-group
=
label_tag
'file_name'
,
class:
"control-label"
do
=
label_tag
'file_name'
,
class:
'control-label'
do
File name
.col-sm-10
.input-group
...
...
@@ -24,7 +24,7 @@
=
label_tag
'commit_message'
,
class:
"control-label"
do
Commit message
.col-sm-10
=
render
'shared/commit_message_container'
,
{
textarea:
text_area_tag
(
'commit_message'
,
=
render
'shared/commit_message_container'
,
{
textarea:
text_area_tag
(
'commit_message
form-control
'
,
params
[
:commit_message
],
placeholder:
"Added new file"
,
required:
true
,
rows:
3
,
class:
'form-control'
)}
.file-holder
...
...
@@ -46,7 +46,7 @@
ace
.
config
.
set
(
"
modePath
"
,
gon
.
relative_url_root
+
"
#{
Gitlab
::
Application
.
config
.
assets
.
prefix
}
/ace-src-noconflict
"
)
var
editor
=
ace
.
edit
(
"
editor
"
);
disableButtonIf
EmptyField
(
"
#commit_message
"
,
"
.js-commit-button
"
);
disableButtonIf
AnyEmptyField
(
$
(
'
.form-new-file
'
),
'
.form-control
'
,
'
.btn-create
'
)
$
(
"
.js-commit-button
"
).
click
(
function
(){
$
(
"
#file-content
"
).
val
(
editor
.
getValue
());
...
...
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