Commit 264ee0c5a1809a76f09649ac071fa6933c6da763
1 parent
3ce629fd
Exists in
master
and in
4 other branches
Tabs styled. MR Get Patch
Showing
6 changed files
with
30 additions
and
7 deletions
Show diff stats
app/assets/stylesheets/nav.scss
... | ... | @@ -8,7 +8,7 @@ ul.main_menu { |
8 | 8 | margin:30px 0; |
9 | 9 | background:#eee; |
10 | 10 | border:1px solid #bbb; |
11 | - height:36px; | |
11 | + height:37px; | |
12 | 12 | background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf)); |
13 | 13 | background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf); |
14 | 14 | background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf); |
... | ... | @@ -44,6 +44,7 @@ ul.main_menu { |
44 | 44 | width: 1%; |
45 | 45 | border-right: 1px solid #DDD; |
46 | 46 | border-left: 1px solid #EEE; |
47 | + border-bottom:2px solid #CFCFCF; | |
47 | 48 | |
48 | 49 | &:first-child{ |
49 | 50 | -webkit-border-top-left-radius: 4px; |
... | ... | @@ -57,7 +58,7 @@ ul.main_menu { |
57 | 58 | |
58 | 59 | &.current { |
59 | 60 | background-color:#D5D5D5; |
60 | - border-bottom: 1px solid #567; | |
61 | + border-bottom: 2px solid $style_color; | |
61 | 62 | border-right: 1px solid #BBB; |
62 | 63 | border-left: 1px solid #BBB; |
63 | 64 | border-radius: 0 0 1px 1px; | ... | ... |
app/assets/stylesheets/themes/ui_modern.scss
app/controllers/merge_requests_controller.rb
... | ... | @@ -2,8 +2,8 @@ class MergeRequestsController < ApplicationController |
2 | 2 | before_filter :authenticate_user! |
3 | 3 | before_filter :project |
4 | 4 | before_filter :module_enabled |
5 | - before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check] | |
6 | - before_filter :validates_merge_request, :only => [:show, :diffs] | |
5 | + before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw] | |
6 | + before_filter :validates_merge_request, :only => [:show, :diffs, :raw] | |
7 | 7 | before_filter :define_show_vars, :only => [:show, :diffs] |
8 | 8 | layout "project" |
9 | 9 | |
... | ... | @@ -43,6 +43,10 @@ class MergeRequestsController < ApplicationController |
43 | 43 | end |
44 | 44 | end |
45 | 45 | |
46 | + def raw | |
47 | + send_file @merge_request.to_raw | |
48 | + end | |
49 | + | |
46 | 50 | def diffs |
47 | 51 | @diffs = @merge_request.diffs |
48 | 52 | @commit = @merge_request.last_commit | ... | ... |
app/models/merge_request.rb
... | ... | @@ -193,6 +193,18 @@ class MergeRequest < ActiveRecord::Base |
193 | 193 | self.mark_as_unmergable |
194 | 194 | false |
195 | 195 | end |
196 | + | |
197 | + def to_raw | |
198 | + FileUtils.mkdir_p(Rails.root.join("tmp", "patches")) | |
199 | + patch_path = Rails.root.join("tmp", "patches", "merge_request_#{self.id}.patch") | |
200 | + | |
201 | + from = commits.last.id | |
202 | + to = source_branch | |
203 | + | |
204 | + project.repo.git.run('', "format-patch" , " > #{patch_path.to_s}", {}, ["#{from}..#{to}", "--stdout"]) | |
205 | + | |
206 | + patch_path | |
207 | + end | |
196 | 208 | end |
197 | 209 | # == Schema Information |
198 | 210 | # | ... | ... |
app/views/merge_requests/show/_mr_title.html.haml
... | ... | @@ -13,8 +13,13 @@ |
13 | 13 | = "MERGED" |
14 | 14 | - if can?(current_user, :modify_merge_request, @merge_request) |
15 | 15 | - if @merge_request.open? |
16 | - = 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" | |
17 | - = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small padded" do | |
16 | + = link_to raw_project_merge_request_path(@project, @merge_request), :class => "btn padded" do | |
17 | + %i.icon-download-alt | |
18 | + Get Patch | |
19 | + | |
20 | + = 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" | |
21 | + | |
22 | + = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn padded" do | |
18 | 23 | %i.icon-edit |
19 | 24 | Edit |
20 | 25 | ... | ... |