[refs #90] change route

This commit is contained in:
Alexander Machehin 2012-05-10 22:57:59 +06:00
parent 4040a486fe
commit 3e0ebdc929
3 changed files with 16 additions and 3 deletions

View File

@ -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();
});
})

View File

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

View File

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