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
Jérome Perrin
gitlab-ce
Commits
18be3e4c
Commit
18be3e4c
authored
Dec 13, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge request show page refactored
parent
4e00330b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
105 additions
and
52 deletions
+105
-52
app/assets/images/.directory
app/assets/images/.directory
+1
-1
app/assets/javascripts/merge_requests.js
app/assets/javascripts/merge_requests.js
+28
-5
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+24
-1
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+0
-3
app/views/merge_requests/_form.html.haml
app/views/merge_requests/_form.html.haml
+6
-1
app/views/merge_requests/_merge_request.html.haml
app/views/merge_requests/_merge_request.html.haml
+1
-1
app/views/merge_requests/commits.js.haml
app/views/merge_requests/commits.js.haml
+4
-0
app/views/merge_requests/diffs.js.haml
app/views/merge_requests/diffs.js.haml
+4
-0
app/views/merge_requests/show.html.haml
app/views/merge_requests/show.html.haml
+37
-40
No files found.
app/assets/images/.directory
View file @
18be3e4c
[Dolphin]
ShowPreview=true
Timestamp=2011,12,1
2,23,25,14
Timestamp=2011,12,1
3,12,22,12
Version=2
app/assets/javascripts/merge_requests.js
View file @
18be3e4c
var
MergeRequest
=
{
diff_loaded
:
false
,
diff
s
_loaded
:
false
,
commits_loaded
:
false
,
init
:
...
...
@@ -9,12 +9,25 @@ var MergeRequest = {
$
(
this
).
addClass
(
"
active
"
);
});
$
(
"
.merge-tabs a.merge-notes-tab
"
).
live
(
"
click
"
,
function
()
{
$
(
"
.merge-request-commits, .merge-request-diffs
"
).
hide
();
$
(
"
.merge-request-notes
"
).
show
();
});
$
(
"
.merge-tabs a.merge-commits-tab
"
).
live
(
"
click
"
,
function
()
{
if
(
MergeRequest
.
commits_loaded
)
{
$
(
"
.merge-request-commits
"
).
show
();
}
else
{
if
(
!
MergeRequest
.
commits_loaded
)
{
MergeRequest
.
loadCommits
();
}
$
(
"
.merge-request-notes, .merge-request-diffs
"
).
hide
();
$
(
"
.merge-request-commits
"
).
show
();
});
$
(
"
.merge-tabs a.merge-diffs-tab
"
).
live
(
"
click
"
,
function
()
{
if
(
!
MergeRequest
.
diffs_loaded
)
{
MergeRequest
.
loadDiff
();
}
$
(
"
.merge-request-notes, .merge-request-commits
"
).
hide
();
$
(
"
.merge-request-diffs
"
).
show
();
});
},
...
...
@@ -23,14 +36,24 @@ var MergeRequest = {
$
(
"
.dashboard-loader
"
).
show
();
$
.
ajax
({
type
:
"
GET
"
,
url
:
location
.
href
+
"
/commits
"
,
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
:
function
()
{
$
(
"
.dashboard-loader
"
).
show
();
$
.
ajax
({
type
:
"
GET
"
,
url
:
$
(
"
.merge-diffs-tab
"
).
attr
(
"
data-url
"
),
complete
:
function
(){
MergeRequest
.
diffs_loaded
=
true
;
$
(
"
.merge-request-notes, .merge-request-commits
"
).
hide
();
$
(
"
.dashboard-loader
"
).
hide
()},
dataType
:
"
script
"
});
}
}
app/assets/stylesheets/projects.css.scss
View file @
18be3e4c
...
...
@@ -552,7 +552,7 @@ h4.middle-panel {
display
:none
;
}
ul
.merge-tabs
{
.merge-tabs
{
margin
:
0
;
border
:
1px
solid
#ccc
;
padding
:
10px
;
...
...
@@ -567,9 +567,32 @@ ul.merge-tabs {
border
:
1px
solid
#ddd
;
background
:none
;
padding
:
4px
10px
;
width
:
160px
;
&
.active
{
background
:
#eaeaea
;
}
}
}
.merge-tabs
.reopen-request
{
@include
round-borders-all
(
4px
);
padding
:
2px
4px
;
border
:
1px
solid
#aaa
;
text-shadow
:none
;
background
:
#D12F19
;
color
:white
;
}
.merge-tabs
.close-request
{
@include
round-borders-all
(
4px
);
padding
:
2px
4px
;
border
:
1px
solid
#aaa
;
text-shadow
:none
;
background
:
#44aa22
;
color
:white
;
}
.user-mention
{
color
:
#2FA0BB
;
font-weight
:
bold
;
}
app/controllers/merge_requests_controller.rb
View file @
18be3e4c
...
...
@@ -30,14 +30,11 @@ class MergeRequestsController < ApplicationController
def
commits
@commits
=
@project
.
repo
.
commits_between
(
@merge_request
.
target_branch
,
@merge_request
.
source_branch
).
map
{
|
c
|
Commit
.
new
(
c
)}
render
:template
=>
"merge_requests/_commits"
,
:layout
=>
false
end
def
diffs
@diffs
=
@merge_request
.
diffs
@commit
=
@merge_request
.
last_commit
render
:template
=>
"merge_requests/_diffs"
,
:layout
=>
false
end
def
new
...
...
app/views/merge_requests/_form.html.haml
View file @
18be3e4c
...
...
@@ -28,7 +28,12 @@
%td
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
.buttons
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
.right
=
link_to
'Back'
,
project_merge_requests_path
(
@project
),
:class
=>
"grey-button"
=
link_to
'Back'
,
project_merge_requests_path
(
@project
),
:class
=>
"grey-button"
-
unless
@merge_request
.
new_record?
.right
=
link_to
'Remove'
,
[
@project
,
@merge_request
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"grey-button"
:javascript
$
(
function
(){
...
...
app/views/merge_requests/_merge_request.html.haml
View file @
18be3e4c
%a
.update-item
{
:href
=>
project_merge_request_path
(
merge_request
.
project
,
merge_request
)}
=
image_tag
gravatar_icon
(
merge_request
.
author_email
),
:class
=>
"left"
,
:width
=>
40
%span
.update-title
=
merge_request
.
title
=
truncate
(
merge_request
.
title
,
:length
=>
60
)
%span
.update-author
%strong
=
merge_request
.
author_name
authored
...
...
app/views/merge_requests/commits.js.haml
0 → 100644
View file @
18be3e4c
:plain
$(".merge-request-commits").html("
#{
escape_javascript
(
render
(
:partial
=>
"commits"
))
}
");
app/views/merge_requests/diffs.js.haml
0 → 100644
View file @
18be3e4c
:plain
$(".merge-request-diffs").html("
#{
escape_javascript
(
render
(
:partial
=>
"diffs"
))
}
");
app/views/merge_requests/show.html.haml
View file @
18be3e4c
.merge-request-show-holder.ui-box.width-100p
%h3
=
"Merge Request #
#{
@merge_request
.
id
}
:"
.tag.commit.inline
=
@merge_request
.
source_branch
→
.tag.commit.inline
=
@merge_request
.
target_branch
.right
-
if
@merge_request
.
closed
%span
.tag.high
Closed
-
else
%span
.tag.today
Open
.data
%p
=
@merge_request
.
title
-
if
@merge_request
.
author
==
@merge_request
.
assignee
=
image_tag
gravatar_icon
(
@merge_request
.
assignee_email
),
:width
=>
20
,
:style
=>
"padding:0 5px;"
=
@merge_request
.
assignee_name
-
else
=
image_tag
gravatar_icon
(
@merge_request
.
author_email
),
:width
=>
20
,
:style
=>
"padding:0 5px;"
=
@merge_request
.
author_name
%div
%span
.entity-info
-
if
can?
(
current_user
,
:admin_project
,
@project
)
||
@merge_request
.
author
==
current_user
=
link_to
edit_project_merge_request_path
(
@project
,
@merge_request
)
do
.entity-button
Edit Merge Request
%i
=
image_tag
gravatar_icon
(
@merge_request
.
author_email
),
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
%span
.commit-title
%strong
=
"Merge Request #
#{
@merge_request
.
id
}
:"
.tag.commit.inline
=
@merge_request
.
source_branch
→
=
image_tag
gravatar_icon
(
@merge_request
.
assignee_email
),
:width
=>
20
,
:style
=>
"padding:0 5px;"
=
@merge_request
.
assignee_name
.right
%cite
.cgray
=
@merge_request
.
created_at
.
stamp
(
"21 Aug 2011, 11:15pm"
)
.clear
.tag.commit.inline
=
@merge_request
.
target_branch
%span
.commit-author
%strong
=
link_to
project_team_member_path
(
@project
,
@project
.
users_projects
.
find
(
@merge_request
.
author
.
id
))
do
=
@merge_request
.
author_name
→
=
link_to
project_team_member_path
(
@project
,
@project
.
users_projects
.
find
(
@merge_request
.
assignee
.
id
))
do
=
@merge_request
.
assignee_name
.buttons
-
if
can?
current_user
,
:write_project
,
@project
-
if
@merge_request
.
closed
=
link_to
'Reopen'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
false
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"grey-button"
-
else
=
link_to
'Close'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"grey-button"
.right
=
link_to
'Edit'
,
edit_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"grey-button positive"
=
@merge_request
.
created_at
.
stamp
(
"Aug 21, 2011 9:23pm"
)
%hr
%h3
=
@merge_request
.
title
.clear
%br
%br
%ul
.merge-tabs
=
link_to
"Notes"
,
"#"
,
:class
=>
"merge-notes-tab"
=
link_to
"Commits"
,
"#"
,
"data-url"
=>
commits_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-commits-tab"
=
link_to
"Diff"
,
diffs_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-diffs-tab"
.merge-tabs
=
link_to
"Notes"
,
"#notes"
,
:class
=>
"merge-notes-tab active"
=
link_to
"Commits"
,
"#commits"
,
"data-url"
=>
commits_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-commits-tab"
=
link_to
"Diff"
,
"#diffs"
,
"data-url"
=>
diffs_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-diffs-tab"
-
if
can?
(
current_user
,
:admin_project
,
@project
)
||
@merge_request
.
author
==
current_user
.right
-
if
@merge_request
.
closed
=
link_to
'Reopen'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
false
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"reopen-request"
-
else
=
link_to
'Close'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"close-request"
,
:title
=>
"Close merge request"
%img
{
:src
=>
"/assets/ajax-loader-facebook.gif"
,
:class
=>
"dashboard-loader"
}
.merge-request-notes
...
...
@@ -53,7 +51,6 @@
.clear
.merge-request-commits
.merge-request-diffs
...
...
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