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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
8d493019
Commit
8d493019
authored
Feb 15, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show commits for merge request immediatly
parent
ef396d08
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
50 deletions
+40
-50
app/assets/javascripts/merge_requests.js
app/assets/javascripts/merge_requests.js
+3
-24
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+9
-0
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+6
-8
app/views/merge_requests/_commits.html.haml
app/views/merge_requests/_commits.html.haml
+12
-5
app/views/merge_requests/show.html.haml
app/views/merge_requests/show.html.haml
+10
-12
config/routes.rb
config/routes.rb
+0
-1
No files found.
app/assets/javascripts/merge_requests.js
View file @
8d493019
...
@@ -10,40 +10,19 @@ var MergeRequest = {
...
@@ -10,40 +10,19 @@ var MergeRequest = {
});
});
$
(
"
.tabs a.merge-notes-tab
"
).
live
(
"
click
"
,
function
()
{
$
(
"
.tabs a.merge-notes-tab
"
).
live
(
"
click
"
,
function
()
{
$
(
"
.merge-request-
commits, .merge-request-
diffs
"
).
hide
();
$
(
"
.merge-request-diffs
"
).
hide
();
$
(
"
.merge-request-notes
"
).
show
();
$
(
"
.merge-request-notes
"
).
show
();
});
});
$
(
"
.tabs a.merge-commits-tab
"
).
live
(
"
click
"
,
function
()
{
if
(
!
MergeRequest
.
commits_loaded
)
{
MergeRequest
.
loadCommits
();
}
$
(
"
.merge-request-notes, .merge-request-diffs
"
).
hide
();
$
(
"
.merge-request-commits
"
).
show
();
});
$
(
"
.tabs a.merge-diffs-tab
"
).
live
(
"
click
"
,
function
()
{
$
(
"
.tabs a.merge-diffs-tab
"
).
live
(
"
click
"
,
function
()
{
if
(
!
MergeRequest
.
diffs_loaded
)
{
if
(
!
MergeRequest
.
diffs_loaded
)
{
MergeRequest
.
loadDiff
();
MergeRequest
.
loadDiff
();
}
}
$
(
"
.merge-request-notes
, .merge-request-commits
"
).
hide
();
$
(
"
.merge-request-notes
"
).
hide
();
$
(
"
.merge-request-diffs
"
).
show
();
$
(
"
.merge-request-diffs
"
).
show
();
});
});
},
},
loadCommits
:
function
()
{
$
(
"
.dashboard-loader
"
).
show
();
$
.
ajax
({
type
:
"
GET
"
,
url
:
$
(
"
.merge-commits-tab
"
).
attr
(
"
data-url
"
),
complete
:
function
(){
MergeRequest
.
commits_loaded
=
true
;
$
(
"
.merge-request-notes, .merge-request-diffs
"
).
hide
();
$
(
"
.dashboard-loader
"
).
hide
()},
dataType
:
"
script
"
});
},
loadDiff
:
loadDiff
:
function
()
{
function
()
{
$
(
"
.dashboard-loader
"
).
show
();
$
(
"
.dashboard-loader
"
).
show
();
...
@@ -52,7 +31,7 @@ var MergeRequest = {
...
@@ -52,7 +31,7 @@ var MergeRequest = {
url
:
$
(
"
.merge-diffs-tab
"
).
attr
(
"
data-url
"
),
url
:
$
(
"
.merge-diffs-tab
"
).
attr
(
"
data-url
"
),
complete
:
function
(){
complete
:
function
(){
MergeRequest
.
diffs_loaded
=
true
;
MergeRequest
.
diffs_loaded
=
true
;
$
(
"
.merge-request-notes
, .merge-request-commits
"
).
hide
();
$
(
"
.merge-request-notes
"
).
hide
();
$
(
"
.dashboard-loader
"
).
hide
()},
$
(
"
.dashboard-loader
"
).
hide
()},
dataType
:
"
script
"
});
dataType
:
"
script
"
});
}
}
...
...
app/assets/stylesheets/common.scss
View file @
8d493019
...
@@ -233,6 +233,10 @@ img.lil_av {
...
@@ -233,6 +233,10 @@ img.lil_av {
@include
round-borders-all
(
4px
);
@include
round-borders-all
(
4px
);
border-color
:
#ddd
;
border-color
:
#ddd
;
ul
{
margin
:
0
;
}
h5
{
h5
{
padding
:
0
10px
;
padding
:
0
10px
;
background
:
#f5f5f5
;
background
:
#f5f5f5
;
...
@@ -247,6 +251,11 @@ img.lil_av {
...
@@ -247,6 +251,11 @@ img.lil_av {
@include
round-borders-top
(
4px
);
@include
round-borders-top
(
4px
);
border-top
:none
;
border-top
:none
;
}
}
&
:last-child
{
@include
round-borders-bottom
(
4px
);
border
:none
;
}
}
}
}
}
app/controllers/merge_requests_controller.rb
View file @
8d493019
...
@@ -40,6 +40,12 @@ class MergeRequestsController < ApplicationController
...
@@ -40,6 +40,12 @@ class MergeRequestsController < ApplicationController
@notes
=
@merge_request
.
notes
.
inc_author
.
order
(
"created_at DESC"
).
limit
(
20
)
@notes
=
@merge_request
.
notes
.
inc_author
.
order
(
"created_at DESC"
).
limit
(
20
)
@note
=
@project
.
notes
.
new
(
:noteable
=>
@merge_request
)
@note
=
@project
.
notes
.
new
(
:noteable
=>
@merge_request
)
@commits
=
@project
.
repo
.
commits_between
(
@merge_request
.
target_branch
,
@merge_request
.
source_branch
).
map
{
|
c
|
Commit
.
new
(
c
)}.
sort_by
(
&
:created_at
).
reverse
render_full_content
render_full_content
respond_to
do
|
format
|
respond_to
do
|
format
|
...
@@ -48,14 +54,6 @@ class MergeRequestsController < ApplicationController
...
@@ -48,14 +54,6 @@ class MergeRequestsController < ApplicationController
end
end
end
end
def
commits
@commits
=
@project
.
repo
.
commits_between
(
@merge_request
.
target_branch
,
@merge_request
.
source_branch
).
map
{
|
c
|
Commit
.
new
(
c
)}.
sort_by
(
&
:created_at
).
reverse
end
def
diffs
def
diffs
@diffs
=
@merge_request
.
diffs
@diffs
=
@merge_request
.
diffs
@commit
=
@merge_request
.
last_commit
@commit
=
@merge_request
.
last_commit
...
...
app/views/merge_requests/_commits.html.haml
View file @
8d493019
-
if
@commits
.
size
>
0
-
unless
@commits
.
empty?
.ui-box
%h5
Commits
.merge-request-commits
.merge-request-commits
%ul
.unstyled
=
render
@commits
%ul
.unstyled
=
render
@commits
-
if
@commits
.
empty?
-
else
%p
.cgray
Nothing to merge
%h5
Nothing to merge from
%span
.label
#{
@merge_request
.
source_branch
}
to
%span
.label
#{
@merge_request
.
target_branch
}
%br
app/views/merge_requests/show.html.haml
View file @
8d493019
...
@@ -41,14 +41,13 @@
...
@@ -41,14 +41,13 @@
%div
=
simple_format
@merge_request
.
title
%div
=
simple_format
@merge_request
.
title
=
render
"merge_requests/commits"
.tabs
-
unless
@commits
.
empty?
.tabs
%li
.active
%li
.active
=
link_to
"#notes"
,
:class
=>
"merge-notes-tab tab"
do
=
link_to
"#notes"
,
:class
=>
"merge-notes-tab tab"
do
Notes
Notes
%li
=
link_to
"#commits"
,
"data-url"
=>
commits_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-commits-tab tab"
do
Commits
%li
%li
=
link_to
"#diffs"
,
"data-url"
=>
diffs_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-diffs-tab tab"
do
=
link_to
"#diffs"
,
"data-url"
=>
diffs_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-diffs-tab tab"
do
Diff
Diff
...
@@ -61,7 +60,6 @@
...
@@ -61,7 +60,6 @@
%center
=
image_tag
"ajax-loader.gif"
%center
=
image_tag
"ajax-loader.gif"
.clear
.clear
.merge-request-commits
.merge-request-diffs
.merge-request-diffs
...
...
config/routes.rb
View file @
8d493019
...
@@ -90,7 +90,6 @@ Gitlab::Application.routes.draw do
...
@@ -90,7 +90,6 @@ Gitlab::Application.routes.draw do
resources
:merge_requests
do
resources
:merge_requests
do
member
do
member
do
get
:diffs
get
:diffs
get
:commits
end
end
end
end
...
...
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