Tabs styled. MR Get Patch

This commit is contained in:
randx 2012-07-05 01:26:23 +03:00
parent 3ce629fded
commit 264ee0c5a1
6 changed files with 30 additions and 7 deletions

View file

@ -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:36px; height:37px;
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 {
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 {
&.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;

View file

@ -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:1px; top:2px;
} }
} }
} }

View file

@ -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
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

View file

@ -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
# #

View file

@ -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

View file

@ -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