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
Kazuhiko Shiozaki
gitlab-ce
Commits
264ee0c5
Commit
264ee0c5
authored
Jul 05, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tabs styled. MR Get Patch
parent
3ce629fd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
7 deletions
+30
-7
app/assets/stylesheets/nav.scss
app/assets/stylesheets/nav.scss
+3
-2
app/assets/stylesheets/themes/ui_modern.scss
app/assets/stylesheets/themes/ui_modern.scss
+1
-1
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+6
-2
app/models/merge_request.rb
app/models/merge_request.rb
+12
-0
app/views/merge_requests/show/_mr_title.html.haml
app/views/merge_requests/show/_mr_title.html.haml
+7
-2
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/assets/stylesheets/nav.scss
View file @
264ee0c5
...
@@ -8,7 +8,7 @@ ul.main_menu {
...
@@ -8,7 +8,7 @@ ul.main_menu {
margin
:
30px
0
;
margin
:
30px
0
;
background
:
#eee
;
background
:
#eee
;
border
:
1px
solid
#bbb
;
border
:
1px
solid
#bbb
;
height
:
3
6
px
;
height
:
3
7
px
;
background-image
:
-webkit-gradient
(
linear
,
0
0
,
0
30
,
color-stop
(
0
.066
,
#eee
)
,
to
(
#dfdfdf
));
background-image
:
-webkit-gradient
(
linear
,
0
0
,
0
30
,
color-stop
(
0
.066
,
#eee
)
,
to
(
#dfdfdf
));
background-image
:
-webkit-linear-gradient
(
#eee
6
.6%
,
#dfdfdf
);
background-image
:
-webkit-linear-gradient
(
#eee
6
.6%
,
#dfdfdf
);
background-image
:
-moz-linear-gradient
(
#eee
6
.6%
,
#dfdfdf
);
background-image
:
-moz-linear-gradient
(
#eee
6
.6%
,
#dfdfdf
);
...
@@ -44,6 +44,7 @@ ul.main_menu {
...
@@ -44,6 +44,7 @@ ul.main_menu {
width
:
1%
;
width
:
1%
;
border-right
:
1px
solid
#DDD
;
border-right
:
1px
solid
#DDD
;
border-left
:
1px
solid
#EEE
;
border-left
:
1px
solid
#EEE
;
border-bottom
:
2px
solid
#CFCFCF
;
&
:first-child
{
&
:first-child
{
-webkit-border-top-left-radius
:
4px
;
-webkit-border-top-left-radius
:
4px
;
...
@@ -57,7 +58,7 @@ ul.main_menu {
...
@@ -57,7 +58,7 @@ ul.main_menu {
&
.current
{
&
.current
{
background-color
:
#D5D5D5
;
background-color
:
#D5D5D5
;
border-bottom
:
1px
solid
#567
;
border-bottom
:
2px
solid
$style_color
;
border-right
:
1px
solid
#BBB
;
border-right
:
1px
solid
#BBB
;
border-left
:
1px
solid
#BBB
;
border-left
:
1px
solid
#BBB
;
border-radius
:
0
0
1px
1px
;
border-radius
:
0
0
1px
1px
;
...
...
app/assets/stylesheets/themes/ui_modern.scss
View file @
264ee0c5
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
border-bottom
:
2px
solid
#f90
;
border-bottom
:
2px
solid
#f90
;
background-color
:
#fff
;
background-color
:
#fff
;
position
:relative
;
position
:relative
;
top
:
1
px
;
top
:
2
px
;
}
}
}
}
}
}
...
...
app/controllers/merge_requests_controller.rb
View file @
264ee0c5
...
@@ -2,8 +2,8 @@ class MergeRequestsController < ApplicationController
...
@@ -2,8 +2,8 @@ class MergeRequestsController < ApplicationController
before_filter
:authenticate_user!
before_filter
:authenticate_user!
before_filter
:project
before_filter
:project
before_filter
:module_enabled
before_filter
:module_enabled
before_filter
:merge_request
,
:only
=>
[
:edit
,
:update
,
:destroy
,
:show
,
:commits
,
:diffs
,
:automerge
,
:automerge_check
]
before_filter
:merge_request
,
:only
=>
[
:edit
,
:update
,
:destroy
,
:show
,
:commits
,
:diffs
,
:automerge
,
:automerge_check
,
:raw
]
before_filter
:validates_merge_request
,
:only
=>
[
:show
,
:diffs
]
before_filter
:validates_merge_request
,
:only
=>
[
:show
,
:diffs
,
:raw
]
before_filter
:define_show_vars
,
:only
=>
[
:show
,
:diffs
]
before_filter
:define_show_vars
,
:only
=>
[
:show
,
:diffs
]
layout
"project"
layout
"project"
...
@@ -43,6 +43,10 @@ class MergeRequestsController < ApplicationController
...
@@ -43,6 +43,10 @@ class MergeRequestsController < ApplicationController
end
end
end
end
def
raw
send_file
@merge_request
.
to_raw
end
def
diffs
def
diffs
@diffs
=
@merge_request
.
diffs
@diffs
=
@merge_request
.
diffs
@commit
=
@merge_request
.
last_commit
@commit
=
@merge_request
.
last_commit
...
...
app/models/merge_request.rb
View file @
264ee0c5
...
@@ -193,6 +193,18 @@ class MergeRequest < ActiveRecord::Base
...
@@ -193,6 +193,18 @@ class MergeRequest < ActiveRecord::Base
self
.
mark_as_unmergable
self
.
mark_as_unmergable
false
false
end
end
def
to_raw
FileUtils
.
mkdir_p
(
Rails
.
root
.
join
(
"tmp"
,
"patches"
))
patch_path
=
Rails
.
root
.
join
(
"tmp"
,
"patches"
,
"merge_request_
#{
self
.
id
}
.patch"
)
from
=
commits
.
last
.
id
to
=
source_branch
project
.
repo
.
git
.
run
(
''
,
"format-patch"
,
" >
#{
patch_path
.
to_s
}
"
,
{},
[
"
#{
from
}
..
#{
to
}
"
,
"--stdout"
])
patch_path
end
end
end
# == Schema Information
# == Schema Information
#
#
...
...
app/views/merge_requests/show/_mr_title.html.haml
View file @
264ee0c5
...
@@ -13,8 +13,13 @@
...
@@ -13,8 +13,13 @@
=
"MERGED"
=
"MERGED"
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
if
@merge_request
.
open?
-
if
@merge_request
.
open?
=
link_to
'Close'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"btn small padded danger"
,
:title
=>
"Close merge request"
=
link_to
raw_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"btn padded"
do
=
link_to
edit_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"btn small padded"
do
%i
.icon-download-alt
Get Patch
=
link_to
'Close'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"btn padded danger"
,
:title
=>
"Close merge request"
=
link_to
edit_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"btn padded"
do
%i
.icon-edit
%i
.icon-edit
Edit
Edit
...
...
config/routes.rb
View file @
264ee0c5
...
@@ -144,6 +144,7 @@ Gitlab::Application.routes.draw do
...
@@ -144,6 +144,7 @@ Gitlab::Application.routes.draw do
get
:diffs
get
:diffs
get
:automerge
get
:automerge
get
:automerge_check
get
:automerge_check
get
:raw
end
end
collection
do
collection
do
...
...
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