diff --git a/app/views/projects/base/_submenu.html.haml b/app/views/projects/base/_submenu.html.haml index 7ff21a0f0..62ea614a0 100644 --- a/app/views/projects/base/_submenu.html.haml +++ b/app/views/projects/base/_submenu.html.haml @@ -16,4 +16,14 @@ %li= link_to t("project_menu.readme"), "#" #pending - if can? :update, @project %li= link_to t("project_menu.settings"), edit_project_path(@project), :class => (act == :edit && contr == :projects ? 'active' : nil) - %li= link_to t("project_menu.pull_requests"), project_pull_requests_path(@project), :class => (contr == :pull_requests ? 'active' : nil) + %li=link_to t("project_menu.pull_requests"), '#', :class => (contr == :pull_requests ? 'active' : nil), :id => 'send_pull_request' + + =form_for PullRequest.new, :url => new_project_pull_requests_path, :html => { :method => :post, :class => :form } do |f| + =hidden_field_tag :ref, @treeish + +:javascript + $(function () { + $('#send_pull_request').click(function(){ + $('#new_pull_request').submit(); + }); + }) diff --git a/app/views/projects/pull_requests/_commit_diff.html.haml b/app/views/projects/pull_requests/_commit_diff.html.haml index 1cb3b7e8e..fd030b93d 100644 --- a/app/views/projects/pull_requests/_commit_diff.html.haml +++ b/app/views/projects/pull_requests/_commit_diff.html.haml @@ -3,7 +3,7 @@ %a{:name => h(commit_diff.a_path)} .top .l= h(commit_diff.a_path) - -# if commit_diff.b_path.present? + - if commit_diff.b_path.present? .r= link_to "view file @ #{short_hash_id(commit_id)}", blob_path(@project, commit_id, commit_diff.b_path) .clear diff --git a/config/routes.rb b/config/routes.rb index b445da1eb..92bad0fc0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -163,7 +163,10 @@ Rosa::Application.routes.draw do resources :collaborators do get :find, :on => :collection end - resources :pull_requests, :except => :destroy + resources :pull_requests, :except => [:destroy, :new] do + post '/new' => 'pull_requests#new', :on => :collection + end + end scope ':project_name', :module => 'projects' do # Resource