Commit 264ee0c5 authored by randx's avatar randx

Tabs styled. MR Get Patch

parent 3ce629fd
No related merge requests found
......@@ -8,7 +8,7 @@ ul.main_menu {
margin:30px 0;
background:#eee;
border:1px solid #bbb;
height:36px;
height:37px;
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: -moz-linear-gradient(#eee 6.6%, #dfdfdf);
......@@ -44,6 +44,7 @@ ul.main_menu {
width: 1%;
border-right: 1px solid #DDD;
border-left: 1px solid #EEE;
border-bottom:2px solid #CFCFCF;
&:first-child{
-webkit-border-top-left-radius: 4px;
......@@ -57,7 +58,7 @@ ul.main_menu {
&.current {
background-color:#D5D5D5;
border-bottom: 1px solid #567;
border-bottom: 2px solid $style_color;
border-right: 1px solid #BBB;
border-left: 1px solid #BBB;
border-radius: 0 0 1px 1px;
......
......@@ -23,7 +23,7 @@
border-bottom:2px solid #f90;
background-color:#fff;
position:relative;
top:1px;
top:2px;
}
}
}
......
......@@ -2,8 +2,8 @@ class MergeRequestsController < ApplicationController
before_filter :authenticate_user!
before_filter :project
before_filter :module_enabled
before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check]
before_filter :validates_merge_request, :only => [:show, :diffs]
before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw]
before_filter :validates_merge_request, :only => [:show, :diffs, :raw]
before_filter :define_show_vars, :only => [:show, :diffs]
layout "project"
......@@ -43,6 +43,10 @@ class MergeRequestsController < ApplicationController
end
end
def raw
send_file @merge_request.to_raw
end
def diffs
@diffs = @merge_request.diffs
@commit = @merge_request.last_commit
......
......@@ -193,6 +193,18 @@ class MergeRequest < ActiveRecord::Base
self.mark_as_unmergable
false
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
# == Schema Information
#
......
......@@ -13,8 +13,13 @@
= "MERGED"
- if can?(current_user, :modify_merge_request, @merge_request)
- 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 edit_project_merge_request_path(@project, @merge_request), :class => "btn small padded" do
= link_to raw_project_merge_request_path(@project, @merge_request), :class => "btn 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
Edit
......
......@@ -144,6 +144,7 @@ Gitlab::Application.routes.draw do
get :diffs
get :automerge
get :automerge_check
get :raw
end
collection do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment