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
Boxiang Sun
gitlab-ce
Commits
b4fccf8a
Commit
b4fccf8a
authored
Jul 25, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes staging files to show only when commitable
parent
40fd91b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
app/assets/javascripts/repo/repo_commit_section.vue
app/assets/javascripts/repo/repo_commit_section.vue
+14
-4
app/views/projects/tree/_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+1
-1
No files found.
app/assets/javascripts/repo/repo_commit_section.vue
View file @
b4fccf8a
...
@@ -13,12 +13,22 @@ const RepoCommitSection = {
...
@@ -13,12 +13,22 @@ const RepoCommitSection = {
// actions[]
// actions[]
// author_email
// author_email
// author_name
// author_name
const
branch
Name
=
$
(
"
button.dropdown-menu-toggle
"
).
attr
(
'
data-ref
'
);
const
branch
=
$
(
"
button.dropdown-menu-toggle
"
).
attr
(
'
data-ref
'
);
const
commitMessage
=
this
.
commitMessage
;
const
commitMessage
=
this
.
commitMessage
;
const
actions
=
this
.
changedFiles
.
map
(
f
=>
{
const
actions
=
this
.
changedFiles
.
map
(
f
=>
{
return
f
.
url
.
split
(
branchName
)[
1
];
const
filePath
=
f
.
url
.
split
(
branch
)[
1
];
return
{
action
:
'
update
'
,
file_path
:
filePath
,
content
:
f
.
newContent
,
};
});
});
console
.
log
(
branchName
,
commitMessage
,
actions
);
const
payload
=
{
branch
:
branch
,
commit_message
:
commitMessage
,
actions
:
actions
,
}
console
.
log
(
branch
,
commitMessage
,
actions
);
}
}
},
},
...
@@ -94,7 +104,7 @@ export default RepoCommitSection;
...
@@ -94,7 +104,7 @@ export default RepoCommitSection;
</div>
</div>
</div>
</div>
<div
class=
"col-md-offset-4 col-md-4"
>
<div
class=
"col-md-offset-4 col-md-4"
>
<button
type=
"submit"
class=
"btn btn-success"
@
click.prevent=
"makeCommit"
>
Commit
{{
changedFiles
.
length
}}
Files
</button>
<button
type=
"submit"
:disabled=
"!commitMessage"
class=
"btn btn-success"
@
click.prevent=
"makeCommit"
>
Commit
{{
changedFiles
.
length
}}
Files
</button>
</div>
</div>
</fieldset>
</fieldset>
</form>
</form>
...
...
app/views/projects/tree/_tree_content.html.haml
View file @
b4fccf8a
#repo
{
data:
{
url:
repo_url
(
@project
),
'project-name'
=>
@project
.
name
,
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
,
format:
"json"
)
}
}
#repo
{
data:
{
url:
repo_url
(
@project
),
'project-name'
=>
@project
.
name
,
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
,
format:
"json"
)
,
project_url:
namespace_project_path
(
@project
.
namespace
,
@project
)
}
}
-
if
can_edit_tree?
-
if
can_edit_tree?
=
render
'projects/blob/upload'
,
title:
_
(
'Upload New File'
),
placeholder:
_
(
'Upload New File'
),
button_title:
_
(
'Upload file'
),
form_path:
project_create_blob_path
(
@project
,
@id
),
method: :post
=
render
'projects/blob/upload'
,
title:
_
(
'Upload New File'
),
placeholder:
_
(
'Upload New File'
),
button_title:
_
(
'Upload file'
),
form_path:
project_create_blob_path
(
@project
,
@id
),
method: :post
...
...
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