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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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]
[Dolphin]
ShowPreview=true
ShowPreview=true
Timestamp=2011,12,1
2,23,25,14
Timestamp=2011,12,1
3,12,22,12
Version=2
Version=2
app/assets/javascripts/merge_requests.js
View file @
18be3e4c
var
MergeRequest
=
{
var
MergeRequest
=
{
diff_loaded
:
false
,
diff
s
_loaded
:
false
,
commits_loaded
:
false
,
commits_loaded
:
false
,
init
:
init
:
...
@@ -9,12 +9,25 @@ var MergeRequest = {
...
@@ -9,12 +9,25 @@ var MergeRequest = {
$
(
this
).
addClass
(
"
active
"
);
$
(
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
()
{
$
(
"
.merge-tabs a.merge-commits-tab
"
).
live
(
"
click
"
,
function
()
{
if
(
MergeRequest
.
commits_loaded
)
{
if
(
!
MergeRequest
.
commits_loaded
)
{
$
(
"
.merge-request-commits
"
).
show
();
}
else
{
MergeRequest
.
loadCommits
();
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 = {
...
@@ -23,14 +36,24 @@ var MergeRequest = {
$
(
"
.dashboard-loader
"
).
show
();
$
(
"
.dashboard-loader
"
).
show
();
$
.
ajax
({
$
.
ajax
({
type
:
"
GET
"
,
type
:
"
GET
"
,
url
:
location
.
href
+
"
/commits
"
,
url
:
$
(
"
.merge-commits-tab
"
).
attr
(
"
data-url
"
)
,
complete
:
function
(){
complete
:
function
(){
MergeRequest
.
commits_loaded
=
true
;
MergeRequest
.
commits_loaded
=
true
;
$
(
"
.merge-request-notes, .merge-request-diffs
"
).
hide
();
$
(
"
.dashboard-loader
"
).
hide
()},
$
(
"
.dashboard-loader
"
).
hide
()},
dataType
:
"
script
"
});
dataType
:
"
script
"
});
},
},
loadDiff
:
loadDiff
:
function
()
{
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 {
...
@@ -552,7 +552,7 @@ h4.middle-panel {
display
:none
;
display
:none
;
}
}
ul
.merge-tabs
{
.merge-tabs
{
margin
:
0
;
margin
:
0
;
border
:
1px
solid
#ccc
;
border
:
1px
solid
#ccc
;
padding
:
10px
;
padding
:
10px
;
...
@@ -567,9 +567,32 @@ ul.merge-tabs {
...
@@ -567,9 +567,32 @@ ul.merge-tabs {
border
:
1px
solid
#ddd
;
border
:
1px
solid
#ddd
;
background
:none
;
background
:none
;
padding
:
4px
10px
;
padding
:
4px
10px
;
width
:
160px
;
&
.active
{
&
.active
{
background
:
#eaeaea
;
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
...
@@ -30,14 +30,11 @@ class MergeRequestsController < ApplicationController
def
commits
def
commits
@commits
=
@project
.
repo
.
commits_between
(
@merge_request
.
target_branch
,
@merge_request
.
source_branch
).
map
{
|
c
|
Commit
.
new
(
c
)}
@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
end
def
diffs
def
diffs
@diffs
=
@merge_request
.
diffs
@diffs
=
@merge_request
.
diffs
@commit
=
@merge_request
.
last_commit
@commit
=
@merge_request
.
last_commit
render
:template
=>
"merge_requests/_diffs"
,
:layout
=>
false
end
end
def
new
def
new
...
...
app/views/merge_requests/_form.html.haml
View file @
18be3e4c
...
@@ -28,7 +28,12 @@
...
@@ -28,7 +28,12 @@
%td
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
%td
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
.buttons
.buttons
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
=
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
:javascript
$
(
function
(){
$
(
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
)}
%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
=
image_tag
gravatar_icon
(
merge_request
.
author_email
),
:class
=>
"left"
,
:width
=>
40
%span
.update-title
%span
.update-title
=
merge_request
.
title
=
truncate
(
merge_request
.
title
,
:length
=>
60
)
%span
.update-author
%span
.update-author
%strong
=
merge_request
.
author_name
%strong
=
merge_request
.
author_name
authored
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
%div
%h3
%span
.entity-info
=
"Merge Request #
#{
@merge_request
.
id
}
:"
-
if
can?
(
current_user
,
:admin_project
,
@project
)
||
@merge_request
.
author
==
current_user
=
link_to
edit_project_merge_request_path
(
@project
,
@merge_request
)
do
.tag.commit.inline
=
@merge_request
.
source_branch
.entity-button
→
Edit Merge Request
.tag.commit.inline
=
@merge_request
.
target_branch
%i
.right
=
image_tag
gravatar_icon
(
@merge_request
.
author_email
),
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
-
if
@merge_request
.
closed
%span
.commit-title
%span
.tag.high
Closed
%strong
-
else
=
"Merge Request #
#{
@merge_request
.
id
}
:"
%span
.tag.today
Open
.tag.commit.inline
=
@merge_request
.
source_branch
.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
→
→
=
image_tag
gravatar_icon
(
@merge_request
.
assignee_email
),
:width
=>
20
,
:style
=>
"padding:0 5px;"
.tag.commit.inline
=
@merge_request
.
target_branch
=
@merge_request
.
assignee_name
%span
.commit-author
.right
%strong
%cite
.cgray
=
@merge_request
.
created_at
.
stamp
(
"21 Aug 2011, 11:15pm"
)
=
link_to
project_team_member_path
(
@project
,
@project
.
users_projects
.
find
(
@merge_request
.
author
.
id
))
do
.clear
=
@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
=
@merge_request
.
created_at
.
stamp
(
"Aug 21, 2011 9:23pm"
)
=
link_to
'Reopen'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
false
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"grey-button"
-
else
%hr
=
link_to
'Close'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"grey-button"
%h3
=
@merge_request
.
title
.right
=
link_to
'Edit'
,
edit_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"grey-button positive"
.clear
.clear
%br
%br
%br
%br
%ul
.merge-tabs
.merge-tabs
=
link_to
"Notes"
,
"#"
,
:class
=>
"merge-notes-tab"
=
link_to
"Notes"
,
"#notes"
,
:class
=>
"merge-notes-tab active"
=
link_to
"Commits"
,
"#"
,
"data-url"
=>
commits_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-commits-tab"
=
link_to
"Commits"
,
"#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"
=
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"
}
%img
{
:src
=>
"/assets/ajax-loader-facebook.gif"
,
:class
=>
"dashboard-loader"
}
.merge-request-notes
.merge-request-notes
...
@@ -53,7 +51,6 @@
...
@@ -53,7 +51,6 @@
.clear
.clear
.merge-request-commits
.merge-request-commits
.merge-request-diffs
.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