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
Tatuya Kamada
gitlab-ce
Commits
1af1b6c8
Commit
1af1b6c8
authored
Mar 29, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed target project update
parent
beab104d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
38 deletions
+42
-38
app/assets/javascripts/compare.js.coffee
app/assets/javascripts/compare.js.coffee
+29
-23
app/assets/stylesheets/pages/commits.scss
app/assets/stylesheets/pages/commits.scss
+4
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-3
app/views/projects/merge_requests/_new_compare.html.haml
app/views/projects/merge_requests/_new_compare.html.haml
+3
-3
app/views/projects/merge_requests/update_branches.html.haml
app/views/projects/merge_requests/update_branches.html.haml
+5
-0
app/views/projects/merge_requests/update_branches.js.haml
app/views/projects/merge_requests/update_branches.js.haml
+0
-9
No files found.
app/assets/javascripts/compare.js.coffee
View file @
1af1b6c8
...
...
@@ -30,34 +30,40 @@ class @Compare
@
getTargetHtml
()
getTargetProject
:
->
$
.
ajax
(
url
:
@
opts
.
targetProjectUrl
data
:
target_project_id
:
$
(
"input[name='merge_request[target_project_id]']"
).
val
()
beforeSend
:
->
$
(
'.mr_target_commit'
).
empty
()
success
:
(
html
)
->
$
(
'.js-target-branch-dropdown .dropdown-content'
).
html
html
)
$
.
get
@
opts
.
targetProjectUrl
,
target_project_id
:
$
(
"input[name='merge_request[
source_project
]']"
).
val
()
target_project_id
:
$
(
"input[name='merge_request[
target_project_id
]']"
).
val
()
getSourceHtml
:
->
$
.
ajax
(
url
:
@
opts
.
sourceBranchUrl
data
:
ref
:
$
(
"input[name='merge_request[source_branch]']"
).
val
()
beforeSend
:
=>
@
source_loading
.
show
()
$
(
".mr_source_commit"
).
html
""
success
:
(
html
)
=>
@
source_loading
.
hide
()
$
(
".mr_source_commit"
).
html
html
$
(
".mr_source_commit .js-timeago"
).
timeago
()
@
sendAjax
(
@
opts
.
sourceBranchUrl
,
@
source_loading
,
'.mr_source_commit'
,
ref
:
$
(
"input[name='merge_request[source_branch]']"
).
val
()
)
getTargetHtml
:
->
@
sendAjax
(
@
opts
.
targetBranchUrl
,
@
target_loading
,
'.mr_target_commit'
,
target_project_id
:
$
(
"input[name='merge_request[target_project_id]']"
).
val
()
ref
:
$
(
"input[name='merge_request[target_branch]']"
).
val
()
)
sendAjax
:
(
url
,
loading
,
target
,
data
)
->
$target
=
$
(
target
)
$
.
ajax
(
url
:
@
opts
.
targetBranchUrl
data
:
target_project_id
:
$
(
"input[name='merge_request[target_project_id]']"
).
val
()
ref
:
$
(
"input[name='merge_request[target_branch]']"
).
val
()
beforeSend
:
=>
@
target_loading
.
show
()
$
(
".mr_target_commit"
).
html
""
success
:
(
html
)
=>
@
target_loading
.
hide
()
$
(
".mr_target_commit"
).
html
html
$
(
".mr_target_commit .js-timeago"
).
timeago
()
url
:
url
data
:
data
beforeSend
:
->
loading
.
show
()
$target
.
empty
()
success
:
(
html
)
->
loading
.
hide
()
$target
.
html
html
$
(
'.js-timeago'
,
$target
).
timeago
()
)
app/assets/stylesheets/pages/commits.scss
View file @
1af1b6c8
...
...
@@ -89,6 +89,10 @@ li.commit {
padding
:
0
;
margin
:
0
;
}
a
{
color
:
$gl-dark-link-color
;
}
}
.commit-row-info
{
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
1af1b6c8
...
...
@@ -220,9 +220,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@target_project
=
selected_target_project
@target_branches
=
@target_project
.
repository
.
branch_names
respond_to
do
|
format
|
format
.
js
end
render
layout:
false
end
def
ci_status
...
...
app/views/projects/merge_requests/_new_compare.html.haml
View file @
1af1b6c8
...
...
@@ -44,7 +44,7 @@
-
projects
=
@project
.
forked_from_project
.
nil?
?
[
@project
]
:
[
@project
,
@project
.
forked_from_project
]
.merge-request-select.dropdown
=
f
.
hidden_field
:target_project_id
=
dropdown_toggle
projects
.
firs
t
.
path_with_namespace
,
{
toggle:
"dropdown"
,
field_name:
"
#{
f
.
object_name
}
[target_project_id]"
,
disabled:
@merge_request
.
persisted?
},
{
toggle_class:
"js-compare-dropdown js-target-project"
}
=
dropdown_toggle
f
.
object
.
target_projec
t
.
path_with_namespace
,
{
toggle:
"dropdown"
,
field_name:
"
#{
f
.
object_name
}
[target_project_id]"
,
disabled:
@merge_request
.
persisted?
},
{
toggle_class:
"js-compare-dropdown js-target-project"
}
.dropdown-menu.dropdown-menu-selectable
=
dropdown_title
(
"Select target project"
)
=
dropdown_filter
(
"Search projects"
)
...
...
@@ -56,8 +56,8 @@
=
project
.
path_with_namespace
.merge-request-select.dropdown
=
f
.
hidden_field
:target_branch
=
dropdown_toggle
"Select target branch"
,
{
toggle:
"dropdown"
,
field_name:
"
#{
f
.
object_name
}
[target_branch]"
},
{
toggle_class:
"js-compare-dropdown js-target-branch"
}
.dropdown-menu.dropdown-menu-selectable
=
dropdown_toggle
f
.
object
.
target_branch
,
{
toggle:
"dropdown"
,
field_name:
"
#{
f
.
object_name
}
[target_branch]"
},
{
toggle_class:
"js-compare-dropdown js-target-branch"
}
.dropdown-menu.dropdown-menu-selectable
.js-target-branch-dropdown
=
dropdown_title
(
"Select target branch"
)
=
dropdown_filter
(
"Search branches"
)
=
dropdown_content
do
...
...
app/views/projects/merge_requests/update_branches.html.haml
0 → 100644
View file @
1af1b6c8
%ul
-
@target_branches
.
each
do
|
branch
|
%li
%a
{
href:
"#"
,
class:
"#{("
is
-
active
" if "
a
" == branch)}"
,
data:
{
id:
branch
}
}
=
branch
app/views/projects/merge_requests/update_branches.js.haml
deleted
100644 → 0
View file @
beab104d
:plain
$(".target_branch").html("
#{
escape_javascript
(
options_for_select
(
@target_branches
))
}
");
$('select.target_branch').select2({
width: 'resolve',
dropdownAutoWidth: true
});
$(".mr_target_commit").html("");
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