@@ -0,0 +1,11 | |||||
|
1 | api.array :relations do | |||
|
2 | @relations.each do |relation| | |||
|
3 | api.relation do | |||
|
4 | api.id relation.id | |||
|
5 | api.issue_id relation.issue_from_id | |||
|
6 | api.issue_to_id relation.issue_to_id | |||
|
7 | api.relation_type relation.relation_type | |||
|
8 | api.delay relation.delay | |||
|
9 | end | |||
|
10 | end | |||
|
11 | end |
@@ -1,87 +1,96 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
6 | # as published by the Free Software Foundation; either version 2 |
|
6 | # as published by the Free Software Foundation; either version 2 | |
7 | # of the License, or (at your option) any later version. |
|
7 | # of the License, or (at your option) any later version. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | class IssueRelationsController < ApplicationController |
|
18 | class IssueRelationsController < ApplicationController | |
19 | before_filter :find_issue, :find_project_from_association, :authorize |
|
19 | before_filter :find_issue, :find_project_from_association, :authorize | |
20 | accept_key_auth :show, :create, :destroy |
|
20 | accept_key_auth :index, :show, :create, :destroy | |
|
21 | ||||
|
22 | def index | |||
|
23 | @relations = @issue.relations | |||
|
24 | ||||
|
25 | respond_to do |format| | |||
|
26 | format.html { render :nothing => true } | |||
|
27 | format.api | |||
|
28 | end | |||
|
29 | end | |||
21 |
|
30 | |||
22 | def show |
|
31 | def show | |
23 | @relation = @issue.find_relation(params[:id]) |
|
32 | @relation = @issue.find_relation(params[:id]) | |
24 |
|
33 | |||
25 | respond_to do |format| |
|
34 | respond_to do |format| | |
26 | format.html { render :nothing => true } |
|
35 | format.html { render :nothing => true } | |
27 | format.api |
|
36 | format.api | |
28 | end |
|
37 | end | |
29 | rescue ActiveRecord::RecordNotFound |
|
38 | rescue ActiveRecord::RecordNotFound | |
30 | render_404 |
|
39 | render_404 | |
31 | end |
|
40 | end | |
32 |
|
41 | |||
33 | verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed } |
|
42 | verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed } | |
34 | def create |
|
43 | def create | |
35 | @relation = IssueRelation.new(params[:relation]) |
|
44 | @relation = IssueRelation.new(params[:relation]) | |
36 | @relation.issue_from = @issue |
|
45 | @relation.issue_from = @issue | |
37 | if params[:relation] && m = params[:relation][:issue_to_id].to_s.match(/^#?(\d+)$/) |
|
46 | if params[:relation] && m = params[:relation][:issue_to_id].to_s.match(/^#?(\d+)$/) | |
38 | @relation.issue_to = Issue.visible.find_by_id(m[1].to_i) |
|
47 | @relation.issue_to = Issue.visible.find_by_id(m[1].to_i) | |
39 | end |
|
48 | end | |
40 | saved = @relation.save |
|
49 | saved = @relation.save | |
41 |
|
50 | |||
42 | respond_to do |format| |
|
51 | respond_to do |format| | |
43 | format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue } |
|
52 | format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue } | |
44 | format.js do |
|
53 | format.js do | |
45 | @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } |
|
54 | @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } | |
46 | render :update do |page| |
|
55 | render :update do |page| | |
47 | page.replace_html "relations", :partial => 'issues/relations' |
|
56 | page.replace_html "relations", :partial => 'issues/relations' | |
48 | if @relation.errors.empty? |
|
57 | if @relation.errors.empty? | |
49 | page << "$('relation_delay').value = ''" |
|
58 | page << "$('relation_delay').value = ''" | |
50 | page << "$('relation_issue_to_id').value = ''" |
|
59 | page << "$('relation_issue_to_id').value = ''" | |
51 | end |
|
60 | end | |
52 | end |
|
61 | end | |
53 | end |
|
62 | end | |
54 | format.api { |
|
63 | format.api { | |
55 | if saved |
|
64 | if saved | |
56 | render :action => 'show', :status => :created, :location => issue_relation_url(@issue, @relation) |
|
65 | render :action => 'show', :status => :created, :location => issue_relation_url(@issue, @relation) | |
57 | else |
|
66 | else | |
58 | render_validation_errors(@relation) |
|
67 | render_validation_errors(@relation) | |
59 | end |
|
68 | end | |
60 | } |
|
69 | } | |
61 | end |
|
70 | end | |
62 | end |
|
71 | end | |
63 |
|
72 | |||
64 | verify :method => :delete, :only => :destroy, :render => {:nothing => true, :status => :method_not_allowed } |
|
73 | verify :method => :delete, :only => :destroy, :render => {:nothing => true, :status => :method_not_allowed } | |
65 | def destroy |
|
74 | def destroy | |
66 | relation = @issue.find_relation(params[:id]) |
|
75 | relation = @issue.find_relation(params[:id]) | |
67 | relation.destroy |
|
76 | relation.destroy | |
68 |
|
77 | |||
69 | respond_to do |format| |
|
78 | respond_to do |format| | |
70 | format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue } |
|
79 | format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue } | |
71 | format.js { |
|
80 | format.js { | |
72 | @relations = @issue.reload.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } |
|
81 | @relations = @issue.reload.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } | |
73 | render(:update) {|page| page.replace_html "relations", :partial => 'issues/relations'} |
|
82 | render(:update) {|page| page.replace_html "relations", :partial => 'issues/relations'} | |
74 | } |
|
83 | } | |
75 | format.api { head :ok } |
|
84 | format.api { head :ok } | |
76 | end |
|
85 | end | |
77 | rescue ActiveRecord::RecordNotFound |
|
86 | rescue ActiveRecord::RecordNotFound | |
78 | render_404 |
|
87 | render_404 | |
79 | end |
|
88 | end | |
80 |
|
89 | |||
81 | private |
|
90 | private | |
82 | def find_issue |
|
91 | def find_issue | |
83 | @issue = @object = Issue.find(params[:issue_id]) |
|
92 | @issue = @object = Issue.find(params[:issue_id]) | |
84 | rescue ActiveRecord::RecordNotFound |
|
93 | rescue ActiveRecord::RecordNotFound | |
85 | render_404 |
|
94 | render_404 | |
86 | end |
|
95 | end | |
87 | end |
|
96 | end |
@@ -1,61 +1,61 | |||||
1 | api.issue do |
|
1 | api.issue do | |
2 | api.id @issue.id |
|
2 | api.id @issue.id | |
3 | api.project(:id => @issue.project_id, :name => @issue.project.name) unless @issue.project.nil? |
|
3 | api.project(:id => @issue.project_id, :name => @issue.project.name) unless @issue.project.nil? | |
4 | api.tracker(:id => @issue.tracker_id, :name => @issue.tracker.name) unless @issue.tracker.nil? |
|
4 | api.tracker(:id => @issue.tracker_id, :name => @issue.tracker.name) unless @issue.tracker.nil? | |
5 | api.status(:id => @issue.status_id, :name => @issue.status.name) unless @issue.status.nil? |
|
5 | api.status(:id => @issue.status_id, :name => @issue.status.name) unless @issue.status.nil? | |
6 | api.priority(:id => @issue.priority_id, :name => @issue.priority.name) unless @issue.priority.nil? |
|
6 | api.priority(:id => @issue.priority_id, :name => @issue.priority.name) unless @issue.priority.nil? | |
7 | api.author(:id => @issue.author_id, :name => @issue.author.name) unless @issue.author.nil? |
|
7 | api.author(:id => @issue.author_id, :name => @issue.author.name) unless @issue.author.nil? | |
8 | api.assigned_to(:id => @issue.assigned_to_id, :name => @issue.assigned_to.name) unless @issue.assigned_to.nil? |
|
8 | api.assigned_to(:id => @issue.assigned_to_id, :name => @issue.assigned_to.name) unless @issue.assigned_to.nil? | |
9 | api.category(:id => @issue.category_id, :name => @issue.category.name) unless @issue.category.nil? |
|
9 | api.category(:id => @issue.category_id, :name => @issue.category.name) unless @issue.category.nil? | |
10 | api.fixed_version(:id => @issue.fixed_version_id, :name => @issue.fixed_version.name) unless @issue.fixed_version.nil? |
|
10 | api.fixed_version(:id => @issue.fixed_version_id, :name => @issue.fixed_version.name) unless @issue.fixed_version.nil? | |
11 | api.parent(:id => @issue.parent_id) unless @issue.parent.nil? |
|
11 | api.parent(:id => @issue.parent_id) unless @issue.parent.nil? | |
12 |
|
12 | |||
13 | api.subject @issue.subject |
|
13 | api.subject @issue.subject | |
14 | api.description @issue.description |
|
14 | api.description @issue.description | |
15 | api.start_date @issue.start_date |
|
15 | api.start_date @issue.start_date | |
16 | api.due_date @issue.due_date |
|
16 | api.due_date @issue.due_date | |
17 | api.done_ratio @issue.done_ratio |
|
17 | api.done_ratio @issue.done_ratio | |
18 | api.estimated_hours @issue.estimated_hours |
|
18 | api.estimated_hours @issue.estimated_hours | |
19 | api.spent_hours(@issue.spent_hours) if User.current.allowed_to?(:view_time_entries, @project) |
|
19 | api.spent_hours(@issue.spent_hours) if User.current.allowed_to?(:view_time_entries, @project) | |
20 |
|
20 | |||
21 | render_api_custom_values @issue.custom_field_values, api |
|
21 | render_api_custom_values @issue.custom_field_values, api | |
22 |
|
22 | |||
23 | api.created_on @issue.created_on |
|
23 | api.created_on @issue.created_on | |
24 | api.updated_on @issue.updated_on |
|
24 | api.updated_on @issue.updated_on | |
25 |
|
25 | |||
26 | render_api_issue_children(@issue, api) if include_in_api_response?('children') |
|
26 | render_api_issue_children(@issue, api) if include_in_api_response?('children') | |
27 |
|
27 | |||
28 | api.array :relations do |
|
28 | api.array :relations do | |
29 | @relations.each do |relation| |
|
29 | @relations.each do |relation| | |
30 |
api.relation(:id => relation.id, :issue_id => relation.issue_from_id, :issue_to_id => relation.issue_to_id, :relation_type => relation.relation_type |
|
30 | api.relation(:id => relation.id, :issue_id => relation.issue_from_id, :issue_to_id => relation.issue_to_id, :relation_type => relation.relation_type, :delay => relation.delay) | |
31 | end |
|
31 | end | |
32 | end if include_in_api_response?('relations') && @relations.present? |
|
32 | end if include_in_api_response?('relations') && @relations.present? | |
33 |
|
33 | |||
34 | api.array :changesets do |
|
34 | api.array :changesets do | |
35 | @issue.changesets.each do |changeset| |
|
35 | @issue.changesets.each do |changeset| | |
36 | api.changeset :revision => changeset.revision do |
|
36 | api.changeset :revision => changeset.revision do | |
37 | api.user(:id => changeset.user_id, :name => changeset.user.name) unless changeset.user.nil? |
|
37 | api.user(:id => changeset.user_id, :name => changeset.user.name) unless changeset.user.nil? | |
38 | api.comments changeset.comments |
|
38 | api.comments changeset.comments | |
39 | api.committed_on changeset.committed_on |
|
39 | api.committed_on changeset.committed_on | |
40 | end |
|
40 | end | |
41 | end |
|
41 | end | |
42 | end if include_in_api_response?('changesets') && User.current.allowed_to?(:view_changesets, @project) |
|
42 | end if include_in_api_response?('changesets') && User.current.allowed_to?(:view_changesets, @project) | |
43 |
|
43 | |||
44 | api.array :journals do |
|
44 | api.array :journals do | |
45 | @issue.journals.each do |journal| |
|
45 | @issue.journals.each do |journal| | |
46 | api.journal :id => journal.id do |
|
46 | api.journal :id => journal.id do | |
47 | api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil? |
|
47 | api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil? | |
48 | api.notes journal.notes |
|
48 | api.notes journal.notes | |
49 | api.created_on journal.created_on |
|
49 | api.created_on journal.created_on | |
50 | api.array :details do |
|
50 | api.array :details do | |
51 | journal.details.each do |detail| |
|
51 | journal.details.each do |detail| | |
52 | api.detail :property => detail.property, :name => detail.prop_key do |
|
52 | api.detail :property => detail.property, :name => detail.prop_key do | |
53 | api.old_value detail.old_value |
|
53 | api.old_value detail.old_value | |
54 | api.new_value detail.value |
|
54 | api.new_value detail.value | |
55 | end |
|
55 | end | |
56 | end |
|
56 | end | |
57 | end |
|
57 | end | |
58 | end |
|
58 | end | |
59 | end |
|
59 | end | |
60 | end if include_in_api_response?('journals') |
|
60 | end if include_in_api_response?('journals') | |
61 | end |
|
61 | end |
@@ -1,255 +1,255 | |||||
1 | ActionController::Routing::Routes.draw do |map| |
|
1 | ActionController::Routing::Routes.draw do |map| | |
2 | # Add your own custom routes here. |
|
2 | # Add your own custom routes here. | |
3 | # The priority is based upon order of creation: first created -> highest priority. |
|
3 | # The priority is based upon order of creation: first created -> highest priority. | |
4 |
|
4 | |||
5 | # Here's a sample route: |
|
5 | # Here's a sample route: | |
6 | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' |
|
6 | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' | |
7 | # Keep in mind you can assign values other than :controller and :action |
|
7 | # Keep in mind you can assign values other than :controller and :action | |
8 |
|
8 | |||
9 | map.home '', :controller => 'welcome' |
|
9 | map.home '', :controller => 'welcome' | |
10 |
|
10 | |||
11 | map.signin 'login', :controller => 'account', :action => 'login' |
|
11 | map.signin 'login', :controller => 'account', :action => 'login' | |
12 | map.signout 'logout', :controller => 'account', :action => 'logout' |
|
12 | map.signout 'logout', :controller => 'account', :action => 'logout' | |
13 |
|
13 | |||
14 | map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' |
|
14 | map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' | |
15 | map.connect 'help/:ctrl/:page', :controller => 'help' |
|
15 | map.connect 'help/:ctrl/:page', :controller => 'help' | |
16 |
|
16 | |||
17 | map.with_options :controller => 'time_entry_reports', :action => 'report',:conditions => {:method => :get} do |time_report| |
|
17 | map.with_options :controller => 'time_entry_reports', :action => 'report',:conditions => {:method => :get} do |time_report| | |
18 | time_report.connect 'projects/:project_id/issues/:issue_id/time_entries/report' |
|
18 | time_report.connect 'projects/:project_id/issues/:issue_id/time_entries/report' | |
19 | time_report.connect 'projects/:project_id/issues/:issue_id/time_entries/report.:format' |
|
19 | time_report.connect 'projects/:project_id/issues/:issue_id/time_entries/report.:format' | |
20 | time_report.connect 'projects/:project_id/time_entries/report' |
|
20 | time_report.connect 'projects/:project_id/time_entries/report' | |
21 | time_report.connect 'projects/:project_id/time_entries/report.:format' |
|
21 | time_report.connect 'projects/:project_id/time_entries/report.:format' | |
22 | time_report.connect 'time_entries/report' |
|
22 | time_report.connect 'time_entries/report' | |
23 | time_report.connect 'time_entries/report.:format' |
|
23 | time_report.connect 'time_entries/report.:format' | |
24 | end |
|
24 | end | |
25 |
|
25 | |||
26 | map.bulk_edit_time_entry 'time_entries/bulk_edit', |
|
26 | map.bulk_edit_time_entry 'time_entries/bulk_edit', | |
27 | :controller => 'timelog', :action => 'bulk_edit', :conditions => { :method => :get } |
|
27 | :controller => 'timelog', :action => 'bulk_edit', :conditions => { :method => :get } | |
28 | map.bulk_update_time_entry 'time_entries/bulk_edit', |
|
28 | map.bulk_update_time_entry 'time_entries/bulk_edit', | |
29 | :controller => 'timelog', :action => 'bulk_update', :conditions => { :method => :post } |
|
29 | :controller => 'timelog', :action => 'bulk_update', :conditions => { :method => :post } | |
30 | map.time_entries_context_menu '/time_entries/context_menu', |
|
30 | map.time_entries_context_menu '/time_entries/context_menu', | |
31 | :controller => 'context_menus', :action => 'time_entries' |
|
31 | :controller => 'context_menus', :action => 'time_entries' | |
32 | # TODO: wasteful since this is also nested under issues, projects, and projects/issues |
|
32 | # TODO: wasteful since this is also nested under issues, projects, and projects/issues | |
33 | map.resources :time_entries, :controller => 'timelog' |
|
33 | map.resources :time_entries, :controller => 'timelog' | |
34 |
|
34 | |||
35 | map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} |
|
35 | map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} | |
36 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get} |
|
36 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get} | |
37 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post} |
|
37 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post} | |
38 |
|
38 | |||
39 | map.with_options :controller => 'messages' do |messages_routes| |
|
39 | map.with_options :controller => 'messages' do |messages_routes| | |
40 | messages_routes.with_options :conditions => {:method => :get} do |messages_views| |
|
40 | messages_routes.with_options :conditions => {:method => :get} do |messages_views| | |
41 | messages_views.connect 'boards/:board_id/topics/new', :action => 'new' |
|
41 | messages_views.connect 'boards/:board_id/topics/new', :action => 'new' | |
42 | messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' |
|
42 | messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' | |
43 | messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' |
|
43 | messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' | |
44 | end |
|
44 | end | |
45 | messages_routes.with_options :conditions => {:method => :post} do |messages_actions| |
|
45 | messages_routes.with_options :conditions => {:method => :post} do |messages_actions| | |
46 | messages_actions.connect 'boards/:board_id/topics/new', :action => 'new' |
|
46 | messages_actions.connect 'boards/:board_id/topics/new', :action => 'new' | |
47 | messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply' |
|
47 | messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply' | |
48 | messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/ |
|
48 | messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/ | |
49 | end |
|
49 | end | |
50 | end |
|
50 | end | |
51 |
|
51 | |||
52 | map.with_options :controller => 'boards' do |board_routes| |
|
52 | map.with_options :controller => 'boards' do |board_routes| | |
53 | board_routes.with_options :conditions => {:method => :get} do |board_views| |
|
53 | board_routes.with_options :conditions => {:method => :get} do |board_views| | |
54 | board_views.connect 'projects/:project_id/boards', :action => 'index' |
|
54 | board_views.connect 'projects/:project_id/boards', :action => 'index' | |
55 | board_views.connect 'projects/:project_id/boards/new', :action => 'new' |
|
55 | board_views.connect 'projects/:project_id/boards/new', :action => 'new' | |
56 | board_views.connect 'projects/:project_id/boards/:id', :action => 'show' |
|
56 | board_views.connect 'projects/:project_id/boards/:id', :action => 'show' | |
57 | board_views.connect 'projects/:project_id/boards/:id.:format', :action => 'show' |
|
57 | board_views.connect 'projects/:project_id/boards/:id.:format', :action => 'show' | |
58 | board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit' |
|
58 | board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit' | |
59 | end |
|
59 | end | |
60 | board_routes.with_options :conditions => {:method => :post} do |board_actions| |
|
60 | board_routes.with_options :conditions => {:method => :post} do |board_actions| | |
61 | board_actions.connect 'projects/:project_id/boards', :action => 'new' |
|
61 | board_actions.connect 'projects/:project_id/boards', :action => 'new' | |
62 | board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/ |
|
62 | board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/ | |
63 | end |
|
63 | end | |
64 | end |
|
64 | end | |
65 |
|
65 | |||
66 | map.with_options :controller => 'documents' do |document_routes| |
|
66 | map.with_options :controller => 'documents' do |document_routes| | |
67 | document_routes.with_options :conditions => {:method => :get} do |document_views| |
|
67 | document_routes.with_options :conditions => {:method => :get} do |document_views| | |
68 | document_views.connect 'projects/:project_id/documents', :action => 'index' |
|
68 | document_views.connect 'projects/:project_id/documents', :action => 'index' | |
69 | document_views.connect 'projects/:project_id/documents/new', :action => 'new' |
|
69 | document_views.connect 'projects/:project_id/documents/new', :action => 'new' | |
70 | document_views.connect 'documents/:id', :action => 'show' |
|
70 | document_views.connect 'documents/:id', :action => 'show' | |
71 | document_views.connect 'documents/:id/edit', :action => 'edit' |
|
71 | document_views.connect 'documents/:id/edit', :action => 'edit' | |
72 | end |
|
72 | end | |
73 | document_routes.with_options :conditions => {:method => :post} do |document_actions| |
|
73 | document_routes.with_options :conditions => {:method => :post} do |document_actions| | |
74 | document_actions.connect 'projects/:project_id/documents', :action => 'new' |
|
74 | document_actions.connect 'projects/:project_id/documents', :action => 'new' | |
75 | document_actions.connect 'documents/:id/:action', :action => /destroy|edit/ |
|
75 | document_actions.connect 'documents/:id/:action', :action => /destroy|edit/ | |
76 | end |
|
76 | end | |
77 | end |
|
77 | end | |
78 |
|
78 | |||
79 | map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move' |
|
79 | map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move' | |
80 |
|
80 | |||
81 | # Misc issue routes. TODO: move into resources |
|
81 | # Misc issue routes. TODO: move into resources | |
82 | map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues' |
|
82 | map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues' | |
83 | map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview |
|
83 | map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview | |
84 | map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues' |
|
84 | map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues' | |
85 | map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index' |
|
85 | map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index' | |
86 | map.bulk_edit_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_edit', :conditions => { :method => :get } |
|
86 | map.bulk_edit_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_edit', :conditions => { :method => :get } | |
87 | map.bulk_update_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_update', :conditions => { :method => :post } |
|
87 | map.bulk_update_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_update', :conditions => { :method => :post } | |
88 | map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post } |
|
88 | map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post } | |
89 | map.connect '/issues/:id/destroy', :controller => 'issues', :action => 'destroy', :conditions => { :method => :post } # legacy |
|
89 | map.connect '/issues/:id/destroy', :controller => 'issues', :action => 'destroy', :conditions => { :method => :post } # legacy | |
90 |
|
90 | |||
91 | map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes| |
|
91 | map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes| | |
92 | gantts_routes.connect '/projects/:project_id/issues/gantt' |
|
92 | gantts_routes.connect '/projects/:project_id/issues/gantt' | |
93 | gantts_routes.connect '/projects/:project_id/issues/gantt.:format' |
|
93 | gantts_routes.connect '/projects/:project_id/issues/gantt.:format' | |
94 | gantts_routes.connect '/issues/gantt.:format' |
|
94 | gantts_routes.connect '/issues/gantt.:format' | |
95 | end |
|
95 | end | |
96 |
|
96 | |||
97 | map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes| |
|
97 | map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes| | |
98 | calendars_routes.connect '/projects/:project_id/issues/calendar' |
|
98 | calendars_routes.connect '/projects/:project_id/issues/calendar' | |
99 | calendars_routes.connect '/issues/calendar' |
|
99 | calendars_routes.connect '/issues/calendar' | |
100 | end |
|
100 | end | |
101 |
|
101 | |||
102 | map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports| |
|
102 | map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports| | |
103 | reports.connect 'projects/:id/issues/report', :action => 'issue_report' |
|
103 | reports.connect 'projects/:id/issues/report', :action => 'issue_report' | |
104 | reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details' |
|
104 | reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details' | |
105 | end |
|
105 | end | |
106 |
|
106 | |||
107 | # Following two routes conflict with the resources because #index allows POST |
|
107 | # Following two routes conflict with the resources because #index allows POST | |
108 | map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post } |
|
108 | map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post } | |
109 | map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post } |
|
109 | map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post } | |
110 |
|
110 | |||
111 | map.resources :issues, :member => { :edit => :post }, :collection => {} do |issues| |
|
111 | map.resources :issues, :member => { :edit => :post }, :collection => {} do |issues| | |
112 | issues.resources :time_entries, :controller => 'timelog' |
|
112 | issues.resources :time_entries, :controller => 'timelog' | |
113 | issues.resources :relations, :controller => 'issue_relations', :only => [:show, :create, :destroy] |
|
113 | issues.resources :relations, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] | |
114 | end |
|
114 | end | |
115 |
|
115 | |||
116 | map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post } do |issues| |
|
116 | map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post } do |issues| | |
117 | issues.resources :time_entries, :controller => 'timelog' |
|
117 | issues.resources :time_entries, :controller => 'timelog' | |
118 | end |
|
118 | end | |
119 |
|
119 | |||
120 | map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new' |
|
120 | map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new' | |
121 |
|
121 | |||
122 | map.with_options :controller => 'users' do |users| |
|
122 | map.with_options :controller => 'users' do |users| | |
123 | users.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil, :conditions => {:method => :get} |
|
123 | users.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil, :conditions => {:method => :get} | |
124 |
|
124 | |||
125 | users.with_options :conditions => {:method => :post} do |user_actions| |
|
125 | users.with_options :conditions => {:method => :post} do |user_actions| | |
126 | user_actions.connect 'users/:id/memberships', :action => 'edit_membership' |
|
126 | user_actions.connect 'users/:id/memberships', :action => 'edit_membership' | |
127 | user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership' |
|
127 | user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership' | |
128 | user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership' |
|
128 | user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership' | |
129 | end |
|
129 | end | |
130 | end |
|
130 | end | |
131 |
|
131 | |||
132 | map.resources :users, :member => { |
|
132 | map.resources :users, :member => { | |
133 | :edit_membership => :post, |
|
133 | :edit_membership => :post, | |
134 | :destroy_membership => :post |
|
134 | :destroy_membership => :post | |
135 | } |
|
135 | } | |
136 |
|
136 | |||
137 | # For nice "roadmap" in the url for the index action |
|
137 | # For nice "roadmap" in the url for the index action | |
138 | map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index' |
|
138 | map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index' | |
139 |
|
139 | |||
140 | map.all_news 'news', :controller => 'news', :action => 'index' |
|
140 | map.all_news 'news', :controller => 'news', :action => 'index' | |
141 | map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index' |
|
141 | map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index' | |
142 | map.preview_news '/news/preview', :controller => 'previews', :action => 'news' |
|
142 | map.preview_news '/news/preview', :controller => 'previews', :action => 'news' | |
143 | map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post} |
|
143 | map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post} | |
144 | map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete} |
|
144 | map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete} | |
145 |
|
145 | |||
146 | map.resources :projects, :member => { |
|
146 | map.resources :projects, :member => { | |
147 | :copy => [:get, :post], |
|
147 | :copy => [:get, :post], | |
148 | :settings => :get, |
|
148 | :settings => :get, | |
149 | :modules => :post, |
|
149 | :modules => :post, | |
150 | :archive => :post, |
|
150 | :archive => :post, | |
151 | :unarchive => :post |
|
151 | :unarchive => :post | |
152 | } do |project| |
|
152 | } do |project| | |
153 | project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy] |
|
153 | project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy] | |
154 | project.resources :files, :only => [:index, :new, :create] |
|
154 | project.resources :files, :only => [:index, :new, :create] | |
155 | project.resources :versions, :collection => {:close_completed => :put}, :member => {:status_by => :post} |
|
155 | project.resources :versions, :collection => {:close_completed => :put}, :member => {:status_by => :post} | |
156 | project.resources :news, :shallow => true |
|
156 | project.resources :news, :shallow => true | |
157 | project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id' |
|
157 | project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id' | |
158 |
|
158 | |||
159 | project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get} |
|
159 | project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get} | |
160 | project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get} |
|
160 | project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get} | |
161 | project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil |
|
161 | project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil | |
162 | project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff' |
|
162 | project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff' | |
163 | project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate' |
|
163 | project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate' | |
164 | project.resources :wiki, :except => [:new, :create], :member => { |
|
164 | project.resources :wiki, :except => [:new, :create], :member => { | |
165 | :rename => [:get, :post], |
|
165 | :rename => [:get, :post], | |
166 | :history => :get, |
|
166 | :history => :get, | |
167 | :preview => :any, |
|
167 | :preview => :any, | |
168 | :protect => :post, |
|
168 | :protect => :post, | |
169 | :add_attachment => :post |
|
169 | :add_attachment => :post | |
170 | }, :collection => { |
|
170 | }, :collection => { | |
171 | :export => :get, |
|
171 | :export => :get, | |
172 | :date_index => :get |
|
172 | :date_index => :get | |
173 | } |
|
173 | } | |
174 |
|
174 | |||
175 | end |
|
175 | end | |
176 |
|
176 | |||
177 | # Destroy uses a get request to prompt the user before the actual DELETE request |
|
177 | # Destroy uses a get request to prompt the user before the actual DELETE request | |
178 | map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get} |
|
178 | map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get} | |
179 |
|
179 | |||
180 | # TODO: port to be part of the resources route(s) |
|
180 | # TODO: port to be part of the resources route(s) | |
181 | map.with_options :controller => 'projects' do |project_mapper| |
|
181 | map.with_options :controller => 'projects' do |project_mapper| | |
182 | project_mapper.with_options :conditions => {:method => :get} do |project_views| |
|
182 | project_mapper.with_options :conditions => {:method => :get} do |project_views| | |
183 | project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings' |
|
183 | project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings' | |
184 | project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new' |
|
184 | project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new' | |
185 | end |
|
185 | end | |
186 | end |
|
186 | end | |
187 |
|
187 | |||
188 | map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity| |
|
188 | map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity| | |
189 | activity.connect 'projects/:id/activity' |
|
189 | activity.connect 'projects/:id/activity' | |
190 | activity.connect 'projects/:id/activity.:format' |
|
190 | activity.connect 'projects/:id/activity.:format' | |
191 | activity.connect 'activity', :id => nil |
|
191 | activity.connect 'activity', :id => nil | |
192 | activity.connect 'activity.:format', :id => nil |
|
192 | activity.connect 'activity.:format', :id => nil | |
193 | end |
|
193 | end | |
194 |
|
194 | |||
195 |
|
195 | |||
196 | map.with_options :controller => 'issue_categories' do |categories| |
|
196 | map.with_options :controller => 'issue_categories' do |categories| | |
197 | categories.connect 'projects/:project_id/issue_categories/new', :action => 'new' |
|
197 | categories.connect 'projects/:project_id/issue_categories/new', :action => 'new' | |
198 | end |
|
198 | end | |
199 |
|
199 | |||
200 | map.with_options :controller => 'repositories' do |repositories| |
|
200 | map.with_options :controller => 'repositories' do |repositories| | |
201 | repositories.with_options :conditions => {:method => :get} do |repository_views| |
|
201 | repositories.with_options :conditions => {:method => :get} do |repository_views| | |
202 | repository_views.connect 'projects/:id/repository', :action => 'show' |
|
202 | repository_views.connect 'projects/:id/repository', :action => 'show' | |
203 | repository_views.connect 'projects/:id/repository/edit', :action => 'edit' |
|
203 | repository_views.connect 'projects/:id/repository/edit', :action => 'edit' | |
204 | repository_views.connect 'projects/:id/repository/statistics', :action => 'stats' |
|
204 | repository_views.connect 'projects/:id/repository/statistics', :action => 'stats' | |
205 | repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions' |
|
205 | repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions' | |
206 | repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions' |
|
206 | repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions' | |
207 | repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' |
|
207 | repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' | |
208 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' |
|
208 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' | |
209 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' |
|
209 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' | |
210 | repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ } |
|
210 | repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ } | |
211 | repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } |
|
211 | repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } | |
212 | repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw' |
|
212 | repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw' | |
213 | # TODO: why the following route is required? |
|
213 | # TODO: why the following route is required? | |
214 | repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry' |
|
214 | repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry' | |
215 | repository_views.connect 'projects/:id/repository/:action/*path' |
|
215 | repository_views.connect 'projects/:id/repository/:action/*path' | |
216 | end |
|
216 | end | |
217 |
|
217 | |||
218 | repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post} |
|
218 | repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post} | |
219 | end |
|
219 | end | |
220 |
|
220 | |||
221 | map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/ |
|
221 | map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/ | |
222 | map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/ |
|
222 | map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/ | |
223 | map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/ |
|
223 | map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/ | |
224 |
|
224 | |||
225 | map.resources :groups |
|
225 | map.resources :groups | |
226 |
|
226 | |||
227 | #left old routes at the bottom for backwards compat |
|
227 | #left old routes at the bottom for backwards compat | |
228 | map.connect 'projects/:project_id/queries/:action', :controller => 'queries' |
|
228 | map.connect 'projects/:project_id/queries/:action', :controller => 'queries' | |
229 | map.connect 'projects/:project_id/issues/:action', :controller => 'issues' |
|
229 | map.connect 'projects/:project_id/issues/:action', :controller => 'issues' | |
230 | map.connect 'projects/:project_id/documents/:action', :controller => 'documents' |
|
230 | map.connect 'projects/:project_id/documents/:action', :controller => 'documents' | |
231 | map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards' |
|
231 | map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards' | |
232 | map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages' |
|
232 | map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages' | |
233 | map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki' |
|
233 | map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki' | |
234 | map.connect 'projects/:project_id/news/:action', :controller => 'news' |
|
234 | map.connect 'projects/:project_id/news/:action', :controller => 'news' | |
235 | map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/ |
|
235 | map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/ | |
236 | map.with_options :controller => 'repositories' do |omap| |
|
236 | map.with_options :controller => 'repositories' do |omap| | |
237 | omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse' |
|
237 | omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse' | |
238 | omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes' |
|
238 | omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes' | |
239 | omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff' |
|
239 | omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff' | |
240 | omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry' |
|
240 | omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry' | |
241 | omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate' |
|
241 | omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate' | |
242 | omap.connect 'repositories/revision/:id/:rev', :action => 'revision' |
|
242 | omap.connect 'repositories/revision/:id/:rev', :action => 'revision' | |
243 | end |
|
243 | end | |
244 |
|
244 | |||
245 | map.with_options :controller => 'sys' do |sys| |
|
245 | map.with_options :controller => 'sys' do |sys| | |
246 | sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get} |
|
246 | sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get} | |
247 | sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post} |
|
247 | sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post} | |
248 | end |
|
248 | end | |
249 |
|
249 | |||
250 | # Install the default route as the lowest priority. |
|
250 | # Install the default route as the lowest priority. | |
251 | map.connect ':controller/:action/:id' |
|
251 | map.connect ':controller/:action/:id' | |
252 | map.connect 'robots.txt', :controller => 'welcome', :action => 'robots' |
|
252 | map.connect 'robots.txt', :controller => 'welcome', :action => 'robots' | |
253 | # Used for OpenID |
|
253 | # Used for OpenID | |
254 | map.root :controller => 'account', :action => 'login' |
|
254 | map.root :controller => 'account', :action => 'login' | |
255 | end |
|
255 | end |
@@ -1,237 +1,237 | |||||
1 | require 'redmine/access_control' |
|
1 | require 'redmine/access_control' | |
2 | require 'redmine/menu_manager' |
|
2 | require 'redmine/menu_manager' | |
3 | require 'redmine/activity' |
|
3 | require 'redmine/activity' | |
4 | require 'redmine/search' |
|
4 | require 'redmine/search' | |
5 | require 'redmine/custom_field_format' |
|
5 | require 'redmine/custom_field_format' | |
6 | require 'redmine/mime_type' |
|
6 | require 'redmine/mime_type' | |
7 | require 'redmine/core_ext' |
|
7 | require 'redmine/core_ext' | |
8 | require 'redmine/themes' |
|
8 | require 'redmine/themes' | |
9 | require 'redmine/hook' |
|
9 | require 'redmine/hook' | |
10 | require 'redmine/plugin' |
|
10 | require 'redmine/plugin' | |
11 | require 'redmine/notifiable' |
|
11 | require 'redmine/notifiable' | |
12 | require 'redmine/wiki_formatting' |
|
12 | require 'redmine/wiki_formatting' | |
13 | require 'redmine/scm/base' |
|
13 | require 'redmine/scm/base' | |
14 |
|
14 | |||
15 | begin |
|
15 | begin | |
16 | require_library_or_gem 'RMagick' unless Object.const_defined?(:Magick) |
|
16 | require_library_or_gem 'RMagick' unless Object.const_defined?(:Magick) | |
17 | rescue LoadError |
|
17 | rescue LoadError | |
18 | # RMagick is not available |
|
18 | # RMagick is not available | |
19 | end |
|
19 | end | |
20 |
|
20 | |||
21 | if RUBY_VERSION < '1.9' |
|
21 | if RUBY_VERSION < '1.9' | |
22 | require 'faster_csv' |
|
22 | require 'faster_csv' | |
23 | else |
|
23 | else | |
24 | require 'csv' |
|
24 | require 'csv' | |
25 | FCSV = CSV |
|
25 | FCSV = CSV | |
26 | end |
|
26 | end | |
27 |
|
27 | |||
28 | Redmine::Scm::Base.add "Subversion" |
|
28 | Redmine::Scm::Base.add "Subversion" | |
29 | Redmine::Scm::Base.add "Darcs" |
|
29 | Redmine::Scm::Base.add "Darcs" | |
30 | Redmine::Scm::Base.add "Mercurial" |
|
30 | Redmine::Scm::Base.add "Mercurial" | |
31 | Redmine::Scm::Base.add "Cvs" |
|
31 | Redmine::Scm::Base.add "Cvs" | |
32 | Redmine::Scm::Base.add "Bazaar" |
|
32 | Redmine::Scm::Base.add "Bazaar" | |
33 | Redmine::Scm::Base.add "Git" |
|
33 | Redmine::Scm::Base.add "Git" | |
34 | Redmine::Scm::Base.add "Filesystem" |
|
34 | Redmine::Scm::Base.add "Filesystem" | |
35 |
|
35 | |||
36 | Redmine::CustomFieldFormat.map do |fields| |
|
36 | Redmine::CustomFieldFormat.map do |fields| | |
37 | fields.register Redmine::CustomFieldFormat.new('string', :label => :label_string, :order => 1) |
|
37 | fields.register Redmine::CustomFieldFormat.new('string', :label => :label_string, :order => 1) | |
38 | fields.register Redmine::CustomFieldFormat.new('text', :label => :label_text, :order => 2) |
|
38 | fields.register Redmine::CustomFieldFormat.new('text', :label => :label_text, :order => 2) | |
39 | fields.register Redmine::CustomFieldFormat.new('int', :label => :label_integer, :order => 3) |
|
39 | fields.register Redmine::CustomFieldFormat.new('int', :label => :label_integer, :order => 3) | |
40 | fields.register Redmine::CustomFieldFormat.new('float', :label => :label_float, :order => 4) |
|
40 | fields.register Redmine::CustomFieldFormat.new('float', :label => :label_float, :order => 4) | |
41 | fields.register Redmine::CustomFieldFormat.new('list', :label => :label_list, :order => 5) |
|
41 | fields.register Redmine::CustomFieldFormat.new('list', :label => :label_list, :order => 5) | |
42 | fields.register Redmine::CustomFieldFormat.new('date', :label => :label_date, :order => 6) |
|
42 | fields.register Redmine::CustomFieldFormat.new('date', :label => :label_date, :order => 6) | |
43 | fields.register Redmine::CustomFieldFormat.new('bool', :label => :label_boolean, :order => 7) |
|
43 | fields.register Redmine::CustomFieldFormat.new('bool', :label => :label_boolean, :order => 7) | |
44 | fields.register Redmine::CustomFieldFormat.new('user', :label => :label_user, :only => %w(Issue TimeEntry Version Project), :edit_as => 'list', :order => 8) |
|
44 | fields.register Redmine::CustomFieldFormat.new('user', :label => :label_user, :only => %w(Issue TimeEntry Version Project), :edit_as => 'list', :order => 8) | |
45 | fields.register Redmine::CustomFieldFormat.new('version', :label => :label_version, :only => %w(Issue TimeEntry Version Project), :edit_as => 'list', :order => 9) |
|
45 | fields.register Redmine::CustomFieldFormat.new('version', :label => :label_version, :only => %w(Issue TimeEntry Version Project), :edit_as => 'list', :order => 9) | |
46 | end |
|
46 | end | |
47 |
|
47 | |||
48 | # Permissions |
|
48 | # Permissions | |
49 | Redmine::AccessControl.map do |map| |
|
49 | Redmine::AccessControl.map do |map| | |
50 | map.permission :view_project, {:projects => [:show], :activities => [:index]}, :public => true |
|
50 | map.permission :view_project, {:projects => [:show], :activities => [:index]}, :public => true | |
51 | map.permission :search_project, {:search => :index}, :public => true |
|
51 | map.permission :search_project, {:search => :index}, :public => true | |
52 | map.permission :add_project, {:projects => [:new, :create]}, :require => :loggedin |
|
52 | map.permission :add_project, {:projects => [:new, :create]}, :require => :loggedin | |
53 | map.permission :edit_project, {:projects => [:settings, :edit, :update]}, :require => :member |
|
53 | map.permission :edit_project, {:projects => [:settings, :edit, :update]}, :require => :member | |
54 | map.permission :select_project_modules, {:projects => :modules}, :require => :member |
|
54 | map.permission :select_project_modules, {:projects => :modules}, :require => :member | |
55 | map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy, :autocomplete_for_member]}, :require => :member |
|
55 | map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy, :autocomplete_for_member]}, :require => :member | |
56 | map.permission :manage_versions, {:projects => :settings, :versions => [:new, :create, :edit, :update, :close_completed, :destroy]}, :require => :member |
|
56 | map.permission :manage_versions, {:projects => :settings, :versions => [:new, :create, :edit, :update, :close_completed, :destroy]}, :require => :member | |
57 | map.permission :add_subprojects, {:projects => [:new, :create]}, :require => :member |
|
57 | map.permission :add_subprojects, {:projects => [:new, :create]}, :require => :member | |
58 |
|
58 | |||
59 | map.project_module :issue_tracking do |map| |
|
59 | map.project_module :issue_tracking do |map| | |
60 | # Issue categories |
|
60 | # Issue categories | |
61 | map.permission :manage_categories, {:projects => :settings, :issue_categories => [:new, :edit, :destroy]}, :require => :member |
|
61 | map.permission :manage_categories, {:projects => :settings, :issue_categories => [:new, :edit, :destroy]}, :require => :member | |
62 | # Issues |
|
62 | # Issues | |
63 | map.permission :view_issues, {:issues => [:index, :show], |
|
63 | map.permission :view_issues, {:issues => [:index, :show], | |
64 | :auto_complete => [:issues], |
|
64 | :auto_complete => [:issues], | |
65 | :context_menus => [:issues], |
|
65 | :context_menus => [:issues], | |
66 | :versions => [:index, :show, :status_by], |
|
66 | :versions => [:index, :show, :status_by], | |
67 | :journals => [:index, :diff], |
|
67 | :journals => [:index, :diff], | |
68 | :queries => :index, |
|
68 | :queries => :index, | |
69 | :reports => [:issue_report, :issue_report_details]} |
|
69 | :reports => [:issue_report, :issue_report_details]} | |
70 | map.permission :add_issues, {:issues => [:new, :create, :update_form]} |
|
70 | map.permission :add_issues, {:issues => [:new, :create, :update_form]} | |
71 | map.permission :edit_issues, {:issues => [:edit, :update, :bulk_edit, :bulk_update, :update_form], :journals => [:new]} |
|
71 | map.permission :edit_issues, {:issues => [:edit, :update, :bulk_edit, :bulk_update, :update_form], :journals => [:new]} | |
72 | map.permission :manage_issue_relations, {:issue_relations => [:show, :create, :destroy]} |
|
72 | map.permission :manage_issue_relations, {:issue_relations => [:index, :show, :create, :destroy]} | |
73 | map.permission :manage_subtasks, {} |
|
73 | map.permission :manage_subtasks, {} | |
74 | map.permission :set_issues_private, {} |
|
74 | map.permission :set_issues_private, {} | |
75 | map.permission :set_own_issues_private, {}, :require => :loggedin |
|
75 | map.permission :set_own_issues_private, {}, :require => :loggedin | |
76 | map.permission :add_issue_notes, {:issues => [:edit, :update], :journals => [:new]} |
|
76 | map.permission :add_issue_notes, {:issues => [:edit, :update], :journals => [:new]} | |
77 | map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin |
|
77 | map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin | |
78 | map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin |
|
78 | map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin | |
79 | map.permission :move_issues, {:issue_moves => [:new, :create]}, :require => :loggedin |
|
79 | map.permission :move_issues, {:issue_moves => [:new, :create]}, :require => :loggedin | |
80 | map.permission :delete_issues, {:issues => :destroy}, :require => :member |
|
80 | map.permission :delete_issues, {:issues => :destroy}, :require => :member | |
81 | # Queries |
|
81 | # Queries | |
82 | map.permission :manage_public_queries, {:queries => [:new, :edit, :destroy]}, :require => :member |
|
82 | map.permission :manage_public_queries, {:queries => [:new, :edit, :destroy]}, :require => :member | |
83 | map.permission :save_queries, {:queries => [:new, :edit, :destroy]}, :require => :loggedin |
|
83 | map.permission :save_queries, {:queries => [:new, :edit, :destroy]}, :require => :loggedin | |
84 | # Watchers |
|
84 | # Watchers | |
85 | map.permission :view_issue_watchers, {} |
|
85 | map.permission :view_issue_watchers, {} | |
86 | map.permission :add_issue_watchers, {:watchers => :new} |
|
86 | map.permission :add_issue_watchers, {:watchers => :new} | |
87 | map.permission :delete_issue_watchers, {:watchers => :destroy} |
|
87 | map.permission :delete_issue_watchers, {:watchers => :destroy} | |
88 | end |
|
88 | end | |
89 |
|
89 | |||
90 | map.project_module :time_tracking do |map| |
|
90 | map.project_module :time_tracking do |map| | |
91 | map.permission :log_time, {:timelog => [:new, :create, :edit, :update, :bulk_edit, :bulk_update]}, :require => :loggedin |
|
91 | map.permission :log_time, {:timelog => [:new, :create, :edit, :update, :bulk_edit, :bulk_update]}, :require => :loggedin | |
92 | map.permission :view_time_entries, :timelog => [:index, :show], :time_entry_reports => [:report] |
|
92 | map.permission :view_time_entries, :timelog => [:index, :show], :time_entry_reports => [:report] | |
93 | map.permission :edit_time_entries, {:timelog => [:new, :create, :edit, :update, :destroy, :bulk_edit, :bulk_update]}, :require => :member |
|
93 | map.permission :edit_time_entries, {:timelog => [:new, :create, :edit, :update, :destroy, :bulk_edit, :bulk_update]}, :require => :member | |
94 | map.permission :edit_own_time_entries, {:timelog => [:new, :create, :edit, :update, :destroy,:bulk_edit, :bulk_update]}, :require => :loggedin |
|
94 | map.permission :edit_own_time_entries, {:timelog => [:new, :create, :edit, :update, :destroy,:bulk_edit, :bulk_update]}, :require => :loggedin | |
95 | map.permission :manage_project_activities, {:project_enumerations => [:update, :destroy]}, :require => :member |
|
95 | map.permission :manage_project_activities, {:project_enumerations => [:update, :destroy]}, :require => :member | |
96 | end |
|
96 | end | |
97 |
|
97 | |||
98 | map.project_module :news do |map| |
|
98 | map.project_module :news do |map| | |
99 | map.permission :manage_news, {:news => [:new, :create, :edit, :update, :destroy], :comments => [:destroy]}, :require => :member |
|
99 | map.permission :manage_news, {:news => [:new, :create, :edit, :update, :destroy], :comments => [:destroy]}, :require => :member | |
100 | map.permission :view_news, {:news => [:index, :show]}, :public => true |
|
100 | map.permission :view_news, {:news => [:index, :show]}, :public => true | |
101 | map.permission :comment_news, {:comments => :create} |
|
101 | map.permission :comment_news, {:comments => :create} | |
102 | end |
|
102 | end | |
103 |
|
103 | |||
104 | map.project_module :documents do |map| |
|
104 | map.project_module :documents do |map| | |
105 | map.permission :manage_documents, {:documents => [:new, :edit, :destroy, :add_attachment]}, :require => :loggedin |
|
105 | map.permission :manage_documents, {:documents => [:new, :edit, :destroy, :add_attachment]}, :require => :loggedin | |
106 | map.permission :view_documents, :documents => [:index, :show, :download] |
|
106 | map.permission :view_documents, :documents => [:index, :show, :download] | |
107 | end |
|
107 | end | |
108 |
|
108 | |||
109 | map.project_module :files do |map| |
|
109 | map.project_module :files do |map| | |
110 | map.permission :manage_files, {:files => [:new, :create]}, :require => :loggedin |
|
110 | map.permission :manage_files, {:files => [:new, :create]}, :require => :loggedin | |
111 | map.permission :view_files, :files => :index, :versions => :download |
|
111 | map.permission :view_files, :files => :index, :versions => :download | |
112 | end |
|
112 | end | |
113 |
|
113 | |||
114 | map.project_module :wiki do |map| |
|
114 | map.project_module :wiki do |map| | |
115 | map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member |
|
115 | map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member | |
116 | map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member |
|
116 | map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member | |
117 | map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member |
|
117 | map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member | |
118 | map.permission :view_wiki_pages, :wiki => [:index, :show, :special, :date_index] |
|
118 | map.permission :view_wiki_pages, :wiki => [:index, :show, :special, :date_index] | |
119 | map.permission :export_wiki_pages, :wiki => [:export] |
|
119 | map.permission :export_wiki_pages, :wiki => [:export] | |
120 | map.permission :view_wiki_edits, :wiki => [:history, :diff, :annotate] |
|
120 | map.permission :view_wiki_edits, :wiki => [:history, :diff, :annotate] | |
121 | map.permission :edit_wiki_pages, :wiki => [:edit, :update, :preview, :add_attachment] |
|
121 | map.permission :edit_wiki_pages, :wiki => [:edit, :update, :preview, :add_attachment] | |
122 | map.permission :delete_wiki_pages_attachments, {} |
|
122 | map.permission :delete_wiki_pages_attachments, {} | |
123 | map.permission :protect_wiki_pages, {:wiki => :protect}, :require => :member |
|
123 | map.permission :protect_wiki_pages, {:wiki => :protect}, :require => :member | |
124 | end |
|
124 | end | |
125 |
|
125 | |||
126 | map.project_module :repository do |map| |
|
126 | map.project_module :repository do |map| | |
127 | map.permission :manage_repository, {:repositories => [:edit, :committers, :destroy]}, :require => :member |
|
127 | map.permission :manage_repository, {:repositories => [:edit, :committers, :destroy]}, :require => :member | |
128 | map.permission :browse_repository, :repositories => [:show, :browse, :entry, :annotate, :changes, :diff, :stats, :graph] |
|
128 | map.permission :browse_repository, :repositories => [:show, :browse, :entry, :annotate, :changes, :diff, :stats, :graph] | |
129 | map.permission :view_changesets, :repositories => [:show, :revisions, :revision] |
|
129 | map.permission :view_changesets, :repositories => [:show, :revisions, :revision] | |
130 | map.permission :commit_access, {} |
|
130 | map.permission :commit_access, {} | |
131 | end |
|
131 | end | |
132 |
|
132 | |||
133 | map.project_module :boards do |map| |
|
133 | map.project_module :boards do |map| | |
134 | map.permission :manage_boards, {:boards => [:new, :edit, :destroy]}, :require => :member |
|
134 | map.permission :manage_boards, {:boards => [:new, :edit, :destroy]}, :require => :member | |
135 | map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true |
|
135 | map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true | |
136 | map.permission :add_messages, {:messages => [:new, :reply, :quote]} |
|
136 | map.permission :add_messages, {:messages => [:new, :reply, :quote]} | |
137 | map.permission :edit_messages, {:messages => :edit}, :require => :member |
|
137 | map.permission :edit_messages, {:messages => :edit}, :require => :member | |
138 | map.permission :edit_own_messages, {:messages => :edit}, :require => :loggedin |
|
138 | map.permission :edit_own_messages, {:messages => :edit}, :require => :loggedin | |
139 | map.permission :delete_messages, {:messages => :destroy}, :require => :member |
|
139 | map.permission :delete_messages, {:messages => :destroy}, :require => :member | |
140 | map.permission :delete_own_messages, {:messages => :destroy}, :require => :loggedin |
|
140 | map.permission :delete_own_messages, {:messages => :destroy}, :require => :loggedin | |
141 | end |
|
141 | end | |
142 |
|
142 | |||
143 | map.project_module :calendar do |map| |
|
143 | map.project_module :calendar do |map| | |
144 | map.permission :view_calendar, :calendars => [:show, :update] |
|
144 | map.permission :view_calendar, :calendars => [:show, :update] | |
145 | end |
|
145 | end | |
146 |
|
146 | |||
147 | map.project_module :gantt do |map| |
|
147 | map.project_module :gantt do |map| | |
148 | map.permission :view_gantt, :gantts => [:show, :update] |
|
148 | map.permission :view_gantt, :gantts => [:show, :update] | |
149 | end |
|
149 | end | |
150 | end |
|
150 | end | |
151 |
|
151 | |||
152 | Redmine::MenuManager.map :top_menu do |menu| |
|
152 | Redmine::MenuManager.map :top_menu do |menu| | |
153 | menu.push :home, :home_path |
|
153 | menu.push :home, :home_path | |
154 | menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } |
|
154 | menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } | |
155 | menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural |
|
155 | menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural | |
156 | menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true |
|
156 | menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true | |
157 | menu.push :help, Redmine::Info.help_url, :last => true |
|
157 | menu.push :help, Redmine::Info.help_url, :last => true | |
158 | end |
|
158 | end | |
159 |
|
159 | |||
160 | Redmine::MenuManager.map :account_menu do |menu| |
|
160 | Redmine::MenuManager.map :account_menu do |menu| | |
161 | menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? } |
|
161 | menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? } | |
162 | menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? } |
|
162 | menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? } | |
163 | menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? } |
|
163 | menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? } | |
164 | menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? } |
|
164 | menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? } | |
165 | end |
|
165 | end | |
166 |
|
166 | |||
167 | Redmine::MenuManager.map :application_menu do |menu| |
|
167 | Redmine::MenuManager.map :application_menu do |menu| | |
168 | # Empty |
|
168 | # Empty | |
169 | end |
|
169 | end | |
170 |
|
170 | |||
171 | Redmine::MenuManager.map :admin_menu do |menu| |
|
171 | Redmine::MenuManager.map :admin_menu do |menu| | |
172 | menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural |
|
172 | menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural | |
173 | menu.push :users, {:controller => 'users'}, :caption => :label_user_plural |
|
173 | menu.push :users, {:controller => 'users'}, :caption => :label_user_plural | |
174 | menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural |
|
174 | menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural | |
175 | menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions |
|
175 | menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions | |
176 | menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural |
|
176 | menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural | |
177 | menu.push :issue_statuses, {:controller => 'issue_statuses'}, :caption => :label_issue_status_plural, |
|
177 | menu.push :issue_statuses, {:controller => 'issue_statuses'}, :caption => :label_issue_status_plural, | |
178 | :html => {:class => 'issue_statuses'} |
|
178 | :html => {:class => 'issue_statuses'} | |
179 | menu.push :workflows, {:controller => 'workflows', :action => 'edit'}, :caption => :label_workflow |
|
179 | menu.push :workflows, {:controller => 'workflows', :action => 'edit'}, :caption => :label_workflow | |
180 | menu.push :custom_fields, {:controller => 'custom_fields'}, :caption => :label_custom_field_plural, |
|
180 | menu.push :custom_fields, {:controller => 'custom_fields'}, :caption => :label_custom_field_plural, | |
181 | :html => {:class => 'custom_fields'} |
|
181 | :html => {:class => 'custom_fields'} | |
182 | menu.push :enumerations, {:controller => 'enumerations'} |
|
182 | menu.push :enumerations, {:controller => 'enumerations'} | |
183 | menu.push :settings, {:controller => 'settings'} |
|
183 | menu.push :settings, {:controller => 'settings'} | |
184 | menu.push :ldap_authentication, {:controller => 'ldap_auth_sources', :action => 'index'}, |
|
184 | menu.push :ldap_authentication, {:controller => 'ldap_auth_sources', :action => 'index'}, | |
185 | :html => {:class => 'server_authentication'} |
|
185 | :html => {:class => 'server_authentication'} | |
186 | menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true |
|
186 | menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true | |
187 | menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true |
|
187 | menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true | |
188 | end |
|
188 | end | |
189 |
|
189 | |||
190 | Redmine::MenuManager.map :project_menu do |menu| |
|
190 | Redmine::MenuManager.map :project_menu do |menu| | |
191 | menu.push :overview, { :controller => 'projects', :action => 'show' } |
|
191 | menu.push :overview, { :controller => 'projects', :action => 'show' } | |
192 | menu.push :activity, { :controller => 'activities', :action => 'index' } |
|
192 | menu.push :activity, { :controller => 'activities', :action => 'index' } | |
193 | menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id, |
|
193 | menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id, | |
194 | :if => Proc.new { |p| p.shared_versions.any? } |
|
194 | :if => Proc.new { |p| p.shared_versions.any? } | |
195 | menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural |
|
195 | menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural | |
196 | menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new, |
|
196 | menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new, | |
197 | :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } |
|
197 | :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } | |
198 | menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt |
|
198 | menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt | |
199 | menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar |
|
199 | menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar | |
200 | menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural |
|
200 | menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural | |
201 | menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural |
|
201 | menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural | |
202 | menu.push :wiki, { :controller => 'wiki', :action => 'show', :id => nil }, :param => :project_id, |
|
202 | menu.push :wiki, { :controller => 'wiki', :action => 'show', :id => nil }, :param => :project_id, | |
203 | :if => Proc.new { |p| p.wiki && !p.wiki.new_record? } |
|
203 | :if => Proc.new { |p| p.wiki && !p.wiki.new_record? } | |
204 | menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, |
|
204 | menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, | |
205 | :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural |
|
205 | :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural | |
206 | menu.push :files, { :controller => 'files', :action => 'index' }, :caption => :label_file_plural, :param => :project_id |
|
206 | menu.push :files, { :controller => 'files', :action => 'index' }, :caption => :label_file_plural, :param => :project_id | |
207 | menu.push :repository, { :controller => 'repositories', :action => 'show' }, |
|
207 | menu.push :repository, { :controller => 'repositories', :action => 'show' }, | |
208 | :if => Proc.new { |p| p.repository && !p.repository.new_record? } |
|
208 | :if => Proc.new { |p| p.repository && !p.repository.new_record? } | |
209 | menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true |
|
209 | menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true | |
210 | end |
|
210 | end | |
211 |
|
211 | |||
212 | Redmine::Activity.map do |activity| |
|
212 | Redmine::Activity.map do |activity| | |
213 | activity.register :issues, :class_name => %w(Issue Journal) |
|
213 | activity.register :issues, :class_name => %w(Issue Journal) | |
214 | activity.register :changesets |
|
214 | activity.register :changesets | |
215 | activity.register :news |
|
215 | activity.register :news | |
216 | activity.register :documents, :class_name => %w(Document Attachment) |
|
216 | activity.register :documents, :class_name => %w(Document Attachment) | |
217 | activity.register :files, :class_name => 'Attachment' |
|
217 | activity.register :files, :class_name => 'Attachment' | |
218 | activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false |
|
218 | activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false | |
219 | activity.register :messages, :default => false |
|
219 | activity.register :messages, :default => false | |
220 | activity.register :time_entries, :default => false |
|
220 | activity.register :time_entries, :default => false | |
221 | end |
|
221 | end | |
222 |
|
222 | |||
223 | Redmine::Search.map do |search| |
|
223 | Redmine::Search.map do |search| | |
224 | search.register :issues |
|
224 | search.register :issues | |
225 | search.register :news |
|
225 | search.register :news | |
226 | search.register :documents |
|
226 | search.register :documents | |
227 | search.register :changesets |
|
227 | search.register :changesets | |
228 | search.register :wiki_pages |
|
228 | search.register :wiki_pages | |
229 | search.register :messages |
|
229 | search.register :messages | |
230 | search.register :projects |
|
230 | search.register :projects | |
231 | end |
|
231 | end | |
232 |
|
232 | |||
233 | Redmine::WikiFormatting.map do |format| |
|
233 | Redmine::WikiFormatting.map do |format| | |
234 | format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper |
|
234 | format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper | |
235 | end |
|
235 | end | |
236 |
|
236 | |||
237 | ActionView::Template.register_template_handler :rsb, Redmine::Views::ApiTemplateHandler |
|
237 | ActionView::Template.register_template_handler :rsb, Redmine::Views::ApiTemplateHandler |
@@ -1,83 +1,102 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
6 | # as published by the Free Software Foundation; either version 2 |
|
6 | # as published by the Free Software Foundation; either version 2 | |
7 | # of the License, or (at your option) any later version. |
|
7 | # of the License, or (at your option) any later version. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | require File.expand_path('../../../test_helper', __FILE__) |
|
18 | require File.expand_path('../../../test_helper', __FILE__) | |
19 |
|
19 | |||
20 | class ApiTest::IssueRelationsTest < ActionController::IntegrationTest |
|
20 | class ApiTest::IssueRelationsTest < ActionController::IntegrationTest | |
21 | fixtures :all |
|
21 | fixtures :all | |
22 |
|
22 | |||
23 | def setup |
|
23 | def setup | |
24 | Setting.rest_api_enabled = '1' |
|
24 | Setting.rest_api_enabled = '1' | |
25 | end |
|
25 | end | |
26 |
|
26 | |||
27 | context "/issues/:issue_id/relations" do |
|
27 | context "/issues/:issue_id/relations" do | |
|
28 | context "GET" do | |||
|
29 | should "return issue relations" do | |||
|
30 | get '/issues/9/relations.xml', {}, :authorization => credentials('jsmith') | |||
|
31 | ||||
|
32 | assert_response :success | |||
|
33 | assert_equal 'application/xml', @response.content_type | |||
|
34 | ||||
|
35 | assert_tag :tag => 'relations', | |||
|
36 | :attributes => { :type => 'array' }, | |||
|
37 | :child => { | |||
|
38 | :tag => 'relation', | |||
|
39 | :child => { | |||
|
40 | :tag => 'id', | |||
|
41 | :content => '1' | |||
|
42 | } | |||
|
43 | } | |||
|
44 | end | |||
|
45 | end | |||
|
46 | ||||
28 | context "POST" do |
|
47 | context "POST" do | |
29 | should "create a relation" do |
|
48 | should "create a relation" do | |
30 | assert_difference('IssueRelation.count') do |
|
49 | assert_difference('IssueRelation.count') do | |
31 | post '/issues/2/relations.xml', {:relation => {:issue_to_id => 7, :relation_type => 'relates'}}, :authorization => credentials('jsmith') |
|
50 | post '/issues/2/relations.xml', {:relation => {:issue_to_id => 7, :relation_type => 'relates'}}, :authorization => credentials('jsmith') | |
32 | end |
|
51 | end | |
33 |
|
52 | |||
34 | relation = IssueRelation.first(:order => 'id DESC') |
|
53 | relation = IssueRelation.first(:order => 'id DESC') | |
35 | assert_equal 2, relation.issue_from_id |
|
54 | assert_equal 2, relation.issue_from_id | |
36 | assert_equal 7, relation.issue_to_id |
|
55 | assert_equal 7, relation.issue_to_id | |
37 | assert_equal 'relates', relation.relation_type |
|
56 | assert_equal 'relates', relation.relation_type | |
38 |
|
57 | |||
39 | assert_response :created |
|
58 | assert_response :created | |
40 | assert_equal 'application/xml', @response.content_type |
|
59 | assert_equal 'application/xml', @response.content_type | |
41 | assert_tag 'relation', :child => {:tag => 'id', :content => relation.id.to_s} |
|
60 | assert_tag 'relation', :child => {:tag => 'id', :content => relation.id.to_s} | |
42 | end |
|
61 | end | |
43 |
|
62 | |||
44 | context "with failure" do |
|
63 | context "with failure" do | |
45 | should "return the errors" do |
|
64 | should "return the errors" do | |
46 | assert_no_difference('IssueRelation.count') do |
|
65 | assert_no_difference('IssueRelation.count') do | |
47 | post '/issues/2/relations.xml', {:relation => {:issue_to_id => 7, :relation_type => 'foo'}}, :authorization => credentials('jsmith') |
|
66 | post '/issues/2/relations.xml', {:relation => {:issue_to_id => 7, :relation_type => 'foo'}}, :authorization => credentials('jsmith') | |
48 | end |
|
67 | end | |
49 |
|
68 | |||
50 | assert_response :unprocessable_entity |
|
69 | assert_response :unprocessable_entity | |
51 | assert_tag :errors, :child => {:tag => 'error', :content => 'relation_type is not included in the list'} |
|
70 | assert_tag :errors, :child => {:tag => 'error', :content => 'relation_type is not included in the list'} | |
52 | end |
|
71 | end | |
53 | end |
|
72 | end | |
54 | end |
|
73 | end | |
55 | end |
|
74 | end | |
56 |
|
75 | |||
57 | context "/issues/:issue_id/relations/:id" do |
|
76 | context "/issues/:issue_id/relations/:id" do | |
58 | context "GET" do |
|
77 | context "GET" do | |
59 | should "return the relation" do |
|
78 | should "return the relation" do | |
60 | get '/issues/3/relations/2.xml', {}, :authorization => credentials('jsmith') |
|
79 | get '/issues/3/relations/2.xml', {}, :authorization => credentials('jsmith') | |
61 |
|
80 | |||
62 | assert_response :success |
|
81 | assert_response :success | |
63 | assert_equal 'application/xml', @response.content_type |
|
82 | assert_equal 'application/xml', @response.content_type | |
64 | assert_tag 'relation', :child => {:tag => 'id', :content => '2'} |
|
83 | assert_tag 'relation', :child => {:tag => 'id', :content => '2'} | |
65 | end |
|
84 | end | |
66 | end |
|
85 | end | |
67 |
|
86 | |||
68 | context "DELETE" do |
|
87 | context "DELETE" do | |
69 | should "delete the relation" do |
|
88 | should "delete the relation" do | |
70 | assert_difference('IssueRelation.count', -1) do |
|
89 | assert_difference('IssueRelation.count', -1) do | |
71 | delete '/issues/3/relations/2.xml', {}, :authorization => credentials('jsmith') |
|
90 | delete '/issues/3/relations/2.xml', {}, :authorization => credentials('jsmith') | |
72 | end |
|
91 | end | |
73 |
|
92 | |||
74 | assert_response :ok |
|
93 | assert_response :ok | |
75 | assert_nil IssueRelation.find_by_id(2) |
|
94 | assert_nil IssueRelation.find_by_id(2) | |
76 | end |
|
95 | end | |
77 | end |
|
96 | end | |
78 | end |
|
97 | end | |
79 |
|
98 | |||
80 | def credentials(user, password=nil) |
|
99 | def credentials(user, password=nil) | |
81 | ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user) |
|
100 | ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user) | |
82 | end |
|
101 | end | |
83 | end |
|
102 | end |
@@ -1,371 +1,375 | |||||
1 | # redMine - project management software |
|
1 | # redMine - project management software | |
2 | # Copyright (C) 2006-2010 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006-2010 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
6 | # as published by the Free Software Foundation; either version 2 |
|
6 | # as published by the Free Software Foundation; either version 2 | |
7 | # of the License, or (at your option) any later version. |
|
7 | # of the License, or (at your option) any later version. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | require File.expand_path('../../test_helper', __FILE__) |
|
18 | require File.expand_path('../../test_helper', __FILE__) | |
19 |
|
19 | |||
20 | class RoutingTest < ActionController::IntegrationTest |
|
20 | class RoutingTest < ActionController::IntegrationTest | |
21 | context "activities" do |
|
21 | context "activities" do | |
22 | should_route :get, "/activity", :controller => 'activities', :action => 'index', :id => nil |
|
22 | should_route :get, "/activity", :controller => 'activities', :action => 'index', :id => nil | |
23 | should_route :get, "/activity.atom", :controller => 'activities', :action => 'index', :id => nil, :format => 'atom' |
|
23 | should_route :get, "/activity.atom", :controller => 'activities', :action => 'index', :id => nil, :format => 'atom' | |
24 | end |
|
24 | end | |
25 |
|
25 | |||
26 | context "attachments" do |
|
26 | context "attachments" do | |
27 | should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1' |
|
27 | should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1' | |
28 | should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext' |
|
28 | should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext' | |
29 | should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1' |
|
29 | should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1' | |
30 | should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext' |
|
30 | should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext' | |
31 | end |
|
31 | end | |
32 |
|
32 | |||
33 | context "boards" do |
|
33 | context "boards" do | |
34 | should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination' |
|
34 | should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination' | |
35 | should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination' |
|
35 | should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination' | |
36 | should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44' |
|
36 | should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44' | |
37 | should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom' |
|
37 | should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom' | |
38 | should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44' |
|
38 | should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44' | |
39 |
|
39 | |||
40 | should_route :post, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination' |
|
40 | should_route :post, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination' | |
41 | should_route :post, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44' |
|
41 | should_route :post, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44' | |
42 | should_route :post, "/projects/world_domination/boards/44/destroy", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44' |
|
42 | should_route :post, "/projects/world_domination/boards/44/destroy", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44' | |
43 |
|
43 | |||
44 | end |
|
44 | end | |
45 |
|
45 | |||
46 | context "documents" do |
|
46 | context "documents" do | |
47 | should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567' |
|
47 | should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567' | |
48 | should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567' |
|
48 | should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567' | |
49 | should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22' |
|
49 | should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22' | |
50 | should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22' |
|
50 | should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22' | |
51 |
|
51 | |||
52 | should_route :post, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567' |
|
52 | should_route :post, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567' | |
53 | should_route :post, "/documents/567/edit", :controller => 'documents', :action => 'edit', :id => '567' |
|
53 | should_route :post, "/documents/567/edit", :controller => 'documents', :action => 'edit', :id => '567' | |
54 | should_route :post, "/documents/567/destroy", :controller => 'documents', :action => 'destroy', :id => '567' |
|
54 | should_route :post, "/documents/567/destroy", :controller => 'documents', :action => 'destroy', :id => '567' | |
55 | end |
|
55 | end | |
56 |
|
56 | |||
57 | context "issues" do |
|
57 | context "issues" do | |
58 | # REST actions |
|
58 | # REST actions | |
59 | should_route :get, "/issues", :controller => 'issues', :action => 'index' |
|
59 | should_route :get, "/issues", :controller => 'issues', :action => 'index' | |
60 | should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf' |
|
60 | should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf' | |
61 | should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom' |
|
61 | should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom' | |
62 | should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml' |
|
62 | should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml' | |
63 | should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23' |
|
63 | should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23' | |
64 | should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf' |
|
64 | should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf' | |
65 | should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom' |
|
65 | should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom' | |
66 | should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml' |
|
66 | should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml' | |
67 | should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64' |
|
67 | should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64' | |
68 | should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf' |
|
68 | should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf' | |
69 | should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom' |
|
69 | should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom' | |
70 | should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml' |
|
70 | should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml' | |
71 |
|
71 | |||
72 | should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' |
|
72 | should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' | |
73 | should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23' |
|
73 | should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23' | |
74 | should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml' |
|
74 | should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml' | |
75 |
|
75 | |||
76 | should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64' |
|
76 | should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64' | |
77 | # TODO: Should use PUT |
|
77 | # TODO: Should use PUT | |
78 | should_route :post, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64' |
|
78 | should_route :post, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64' | |
79 | should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml' |
|
79 | should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml' | |
80 |
|
80 | |||
81 | # TODO: Should use DELETE |
|
81 | # TODO: Should use DELETE | |
82 | should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64' |
|
82 | should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64' | |
83 | should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml' |
|
83 | should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml' | |
84 |
|
84 | |||
85 | # Extra actions |
|
85 | # Extra actions | |
86 | should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64' |
|
86 | should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64' | |
87 |
|
87 | |||
88 | should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new' |
|
88 | should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new' | |
89 | should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create' |
|
89 | should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create' | |
90 |
|
90 | |||
91 | should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1' |
|
91 | should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1' | |
92 |
|
92 | |||
93 | should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show' |
|
93 | should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show' | |
94 | should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name' |
|
94 | should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name' | |
95 |
|
95 | |||
96 | should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show' |
|
96 | should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show' | |
97 | should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf' |
|
97 | should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf' | |
98 | should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name' |
|
98 | should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name' | |
99 | should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf' |
|
99 | should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf' | |
100 |
|
100 | |||
101 | should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues' |
|
101 | should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues' | |
102 |
|
102 | |||
103 | should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' |
|
103 | should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' | |
104 | should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' |
|
104 | should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' | |
105 | should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' |
|
105 | should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' | |
106 | should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' |
|
106 | should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' | |
107 |
|
107 | |||
108 | should_route :get, "/issues/changes", :controller => 'journals', :action => 'index' |
|
108 | should_route :get, "/issues/changes", :controller => 'journals', :action => 'index' | |
109 |
|
109 | |||
110 | should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit' |
|
110 | should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit' | |
111 | should_route :post, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_update' |
|
111 | should_route :post, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_update' | |
112 | end |
|
112 | end | |
113 |
|
113 | |||
114 | context "issue categories" do |
|
114 | context "issue categories" do | |
115 | should_route :get, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test' |
|
115 | should_route :get, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test' | |
116 |
|
116 | |||
117 | should_route :post, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test' |
|
117 | should_route :post, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test' | |
118 | end |
|
118 | end | |
119 |
|
119 | |||
120 | context "issue relations" do |
|
120 | context "issue relations" do | |
|
121 | should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1' | |||
|
122 | should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml' | |||
|
123 | should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json' | |||
|
124 | ||||
121 | should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1' |
|
125 | should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1' | |
122 | should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml' |
|
126 | should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml' | |
123 | should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json' |
|
127 | should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json' | |
124 |
|
128 | |||
125 | should_route :get, "/issues/1/relations/23", :controller => 'issue_relations', :action => 'show', :issue_id => '1', :id => '23' |
|
129 | should_route :get, "/issues/1/relations/23", :controller => 'issue_relations', :action => 'show', :issue_id => '1', :id => '23' | |
126 | should_route :get, "/issues/1/relations/23.xml", :controller => 'issue_relations', :action => 'show', :issue_id => '1', :id => '23', :format => 'xml' |
|
130 | should_route :get, "/issues/1/relations/23.xml", :controller => 'issue_relations', :action => 'show', :issue_id => '1', :id => '23', :format => 'xml' | |
127 | should_route :get, "/issues/1/relations/23.json", :controller => 'issue_relations', :action => 'show', :issue_id => '1', :id => '23', :format => 'json' |
|
131 | should_route :get, "/issues/1/relations/23.json", :controller => 'issue_relations', :action => 'show', :issue_id => '1', :id => '23', :format => 'json' | |
128 |
|
132 | |||
129 | should_route :delete, "/issues/1/relations/23", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23' |
|
133 | should_route :delete, "/issues/1/relations/23", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23' | |
130 | should_route :delete, "/issues/1/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23', :format => 'xml' |
|
134 | should_route :delete, "/issues/1/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23', :format => 'xml' | |
131 | should_route :delete, "/issues/1/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23', :format => 'json' |
|
135 | should_route :delete, "/issues/1/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23', :format => 'json' | |
132 | end |
|
136 | end | |
133 |
|
137 | |||
134 | context "issue reports" do |
|
138 | context "issue reports" do | |
135 | should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567' |
|
139 | should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567' | |
136 | should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to' |
|
140 | should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to' | |
137 | end |
|
141 | end | |
138 |
|
142 | |||
139 | context "members" do |
|
143 | context "members" do | |
140 | should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234' |
|
144 | should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234' | |
141 | end |
|
145 | end | |
142 |
|
146 | |||
143 | context "messages" do |
|
147 | context "messages" do | |
144 | should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22' |
|
148 | should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22' | |
145 | should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
149 | should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' | |
146 | should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' |
|
150 | should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' | |
147 |
|
151 | |||
148 | should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
152 | should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' | |
149 | should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' |
|
153 | should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' | |
150 | should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22' |
|
154 | should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22' | |
151 | should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22' |
|
155 | should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22' | |
152 | end |
|
156 | end | |
153 |
|
157 | |||
154 | context "news" do |
|
158 | context "news" do | |
155 | should_route :get, "/news", :controller => 'news', :action => 'index' |
|
159 | should_route :get, "/news", :controller => 'news', :action => 'index' | |
156 | should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom' |
|
160 | should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom' | |
157 | should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml' |
|
161 | should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml' | |
158 | should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json' |
|
162 | should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json' | |
159 | should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567' |
|
163 | should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567' | |
160 | should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567' |
|
164 | should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567' | |
161 | should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567' |
|
165 | should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567' | |
162 | should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567' |
|
166 | should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567' | |
163 | should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2' |
|
167 | should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2' | |
164 | should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567' |
|
168 | should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567' | |
165 | should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234' |
|
169 | should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234' | |
166 | should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567' |
|
170 | should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567' | |
167 | should_route :get, "/news/preview", :controller => 'previews', :action => 'news' |
|
171 | should_route :get, "/news/preview", :controller => 'previews', :action => 'news' | |
168 |
|
172 | |||
169 | should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567' |
|
173 | should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567' | |
170 | should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567' |
|
174 | should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567' | |
171 |
|
175 | |||
172 | should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567' |
|
176 | should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567' | |
173 |
|
177 | |||
174 | should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567' |
|
178 | should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567' | |
175 | should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15' |
|
179 | should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15' | |
176 | end |
|
180 | end | |
177 |
|
181 | |||
178 | context "projects" do |
|
182 | context "projects" do | |
179 | should_route :get, "/projects", :controller => 'projects', :action => 'index' |
|
183 | should_route :get, "/projects", :controller => 'projects', :action => 'index' | |
180 | should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom' |
|
184 | should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom' | |
181 | should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml' |
|
185 | should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml' | |
182 | should_route :get, "/projects/new", :controller => 'projects', :action => 'new' |
|
186 | should_route :get, "/projects/new", :controller => 'projects', :action => 'new' | |
183 | should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test' |
|
187 | should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test' | |
184 | should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml' |
|
188 | should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml' | |
185 | should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223' |
|
189 | should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223' | |
186 | should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members' |
|
190 | should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members' | |
187 | should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33' |
|
191 | should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33' | |
188 | should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33' |
|
192 | should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33' | |
189 | should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33' |
|
193 | should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33' | |
190 | should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33' |
|
194 | should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33' | |
191 | should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom' |
|
195 | should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom' | |
192 |
|
196 | |||
193 | should_route :post, "/projects", :controller => 'projects', :action => 'create' |
|
197 | should_route :post, "/projects", :controller => 'projects', :action => 'create' | |
194 | should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml' |
|
198 | should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml' | |
195 | should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33' |
|
199 | should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33' | |
196 | should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64' |
|
200 | should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64' | |
197 | should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64' |
|
201 | should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64' | |
198 |
|
202 | |||
199 | should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64' |
|
203 | should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64' | |
200 | should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223' |
|
204 | should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223' | |
201 | should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml' |
|
205 | should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml' | |
202 |
|
206 | |||
203 | should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64' |
|
207 | should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64' | |
204 | should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml' |
|
208 | should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml' | |
205 | should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64' |
|
209 | should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64' | |
206 | end |
|
210 | end | |
207 |
|
211 | |||
208 | context "queries" do |
|
212 | context "queries" do | |
209 | should_route :get, "/queries/new", :controller => 'queries', :action => 'new' |
|
213 | should_route :get, "/queries/new", :controller => 'queries', :action => 'new' | |
210 | should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' |
|
214 | should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' | |
211 |
|
215 | |||
212 | should_route :post, "/queries/new", :controller => 'queries', :action => 'new' |
|
216 | should_route :post, "/queries/new", :controller => 'queries', :action => 'new' | |
213 | should_route :post, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' |
|
217 | should_route :post, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' | |
214 | end |
|
218 | end | |
215 |
|
219 | |||
216 | context "repositories" do |
|
220 | context "repositories" do | |
217 | should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine' |
|
221 | should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine' | |
218 | should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' |
|
222 | should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' | |
219 | should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine' |
|
223 | should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine' | |
220 | should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom' |
|
224 | should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom' | |
221 | should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457' |
|
225 | should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457' | |
222 | should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457' |
|
226 | should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457' | |
223 | should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff' |
|
227 | should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff' | |
224 | should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c] |
|
228 | should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c] | |
225 | should_route :get, "/projects/redmine/repository/revisions/2/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c], :rev => '2' |
|
229 | should_route :get, "/projects/redmine/repository/revisions/2/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c], :rev => '2' | |
226 | should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c] |
|
230 | should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c] | |
227 | should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c] |
|
231 | should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c] | |
228 | should_route :get, "/projects/redmine/repository/revisions/2/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2' |
|
232 | should_route :get, "/projects/redmine/repository/revisions/2/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2' | |
229 | should_route :get, "/projects/redmine/repository/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :format => 'raw' |
|
233 | should_route :get, "/projects/redmine/repository/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :format => 'raw' | |
230 | should_route :get, "/projects/redmine/repository/revisions/2/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2', :format => 'raw' |
|
234 | should_route :get, "/projects/redmine/repository/revisions/2/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2', :format => 'raw' | |
231 | should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c] |
|
235 | should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c] | |
232 | should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c] |
|
236 | should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c] | |
233 | should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine' |
|
237 | should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine' | |
234 |
|
238 | |||
235 |
|
239 | |||
236 | should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' |
|
240 | should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' | |
237 | end |
|
241 | end | |
238 |
|
242 | |||
239 | context "timelogs (global)" do |
|
243 | context "timelogs (global)" do | |
240 | should_route :get, "/time_entries", :controller => 'timelog', :action => 'index' |
|
244 | should_route :get, "/time_entries", :controller => 'timelog', :action => 'index' | |
241 | should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv' |
|
245 | should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv' | |
242 | should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom' |
|
246 | should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom' | |
243 | should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new' |
|
247 | should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new' | |
244 | should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22' |
|
248 | should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22' | |
245 |
|
249 | |||
246 | should_route :post, "/time_entries", :controller => 'timelog', :action => 'create' |
|
250 | should_route :post, "/time_entries", :controller => 'timelog', :action => 'create' | |
247 |
|
251 | |||
248 | should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22' |
|
252 | should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22' | |
249 |
|
253 | |||
250 | should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55' |
|
254 | should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55' | |
251 | end |
|
255 | end | |
252 |
|
256 | |||
253 | context "timelogs (scoped under project)" do |
|
257 | context "timelogs (scoped under project)" do | |
254 | should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567' |
|
258 | should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567' | |
255 | should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv' |
|
259 | should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv' | |
256 | should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom' |
|
260 | should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom' | |
257 | should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567' |
|
261 | should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567' | |
258 | should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567' |
|
262 | should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567' | |
259 |
|
263 | |||
260 | should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567' |
|
264 | should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567' | |
261 |
|
265 | |||
262 | should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567' |
|
266 | should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567' | |
263 |
|
267 | |||
264 | should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567' |
|
268 | should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567' | |
265 | end |
|
269 | end | |
266 |
|
270 | |||
267 | context "timelogs (scoped under issues)" do |
|
271 | context "timelogs (scoped under issues)" do | |
268 | should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234' |
|
272 | should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234' | |
269 | should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv' |
|
273 | should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv' | |
270 | should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom' |
|
274 | should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom' | |
271 | should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234' |
|
275 | should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234' | |
272 | should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234' |
|
276 | should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234' | |
273 |
|
277 | |||
274 | should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234' |
|
278 | should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234' | |
275 |
|
279 | |||
276 | should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234' |
|
280 | should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234' | |
277 |
|
281 | |||
278 | should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234' |
|
282 | should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234' | |
279 | end |
|
283 | end | |
280 |
|
284 | |||
281 | context "timelogs (scoped under project and issues)" do |
|
285 | context "timelogs (scoped under project and issues)" do | |
282 | should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook' |
|
286 | should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook' | |
283 | should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' |
|
287 | should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' | |
284 | should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' |
|
288 | should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' | |
285 | should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook' |
|
289 | should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook' | |
286 | should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook' |
|
290 | should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook' | |
287 |
|
291 | |||
288 | should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook' |
|
292 | should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook' | |
289 |
|
293 | |||
290 | should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook' |
|
294 | should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook' | |
291 |
|
295 | |||
292 | should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook' |
|
296 | should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook' | |
293 | end |
|
297 | end | |
294 |
|
298 | |||
295 | context "time_entry_reports" do |
|
299 | context "time_entry_reports" do | |
296 | should_route :get, "/time_entries/report", :controller => 'time_entry_reports', :action => 'report' |
|
300 | should_route :get, "/time_entries/report", :controller => 'time_entry_reports', :action => 'report' | |
297 | should_route :get, "/projects/567/time_entries/report", :controller => 'time_entry_reports', :action => 'report', :project_id => '567' |
|
301 | should_route :get, "/projects/567/time_entries/report", :controller => 'time_entry_reports', :action => 'report', :project_id => '567' | |
298 | should_route :get, "/projects/567/time_entries/report.csv", :controller => 'time_entry_reports', :action => 'report', :project_id => '567', :format => 'csv' |
|
302 | should_route :get, "/projects/567/time_entries/report.csv", :controller => 'time_entry_reports', :action => 'report', :project_id => '567', :format => 'csv' | |
299 | end |
|
303 | end | |
300 |
|
304 | |||
301 | context "users" do |
|
305 | context "users" do | |
302 | should_route :get, "/users", :controller => 'users', :action => 'index' |
|
306 | should_route :get, "/users", :controller => 'users', :action => 'index' | |
303 | should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml' |
|
307 | should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml' | |
304 | should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44' |
|
308 | should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44' | |
305 | should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml' |
|
309 | should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml' | |
306 | should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current' |
|
310 | should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current' | |
307 | should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml' |
|
311 | should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml' | |
308 | should_route :get, "/users/new", :controller => 'users', :action => 'new' |
|
312 | should_route :get, "/users/new", :controller => 'users', :action => 'new' | |
309 | should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' |
|
313 | should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' | |
310 | should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership' |
|
314 | should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership' | |
311 |
|
315 | |||
312 | should_route :post, "/users", :controller => 'users', :action => 'create' |
|
316 | should_route :post, "/users", :controller => 'users', :action => 'create' | |
313 | should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml' |
|
317 | should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml' | |
314 | should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123' |
|
318 | should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123' | |
315 | should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55' |
|
319 | should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55' | |
316 | should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12' |
|
320 | should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12' | |
317 |
|
321 | |||
318 | should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444' |
|
322 | should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444' | |
319 | should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml' |
|
323 | should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml' | |
320 |
|
324 | |||
321 | should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44' |
|
325 | should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44' | |
322 | should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml' |
|
326 | should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml' | |
323 | end |
|
327 | end | |
324 |
|
328 | |||
325 | # TODO: should they all be scoped under /projects/:project_id ? |
|
329 | # TODO: should they all be scoped under /projects/:project_id ? | |
326 | context "versions" do |
|
330 | context "versions" do | |
327 | should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo' |
|
331 | should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo' | |
328 | should_route :get, "/versions/show/1", :controller => 'versions', :action => 'show', :id => '1' |
|
332 | should_route :get, "/versions/show/1", :controller => 'versions', :action => 'show', :id => '1' | |
329 | should_route :get, "/versions/edit/1", :controller => 'versions', :action => 'edit', :id => '1' |
|
333 | should_route :get, "/versions/edit/1", :controller => 'versions', :action => 'edit', :id => '1' | |
330 |
|
334 | |||
331 | should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo' |
|
335 | should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo' | |
332 | should_route :post, "/versions/update/1", :controller => 'versions', :action => 'update', :id => '1' |
|
336 | should_route :post, "/versions/update/1", :controller => 'versions', :action => 'update', :id => '1' | |
333 |
|
337 | |||
334 | should_route :delete, "/versions/destroy/1", :controller => 'versions', :action => 'destroy', :id => '1' |
|
338 | should_route :delete, "/versions/destroy/1", :controller => 'versions', :action => 'destroy', :id => '1' | |
335 | end |
|
339 | end | |
336 |
|
340 | |||
337 | context "wiki (singular, project's pages)" do |
|
341 | context "wiki (singular, project's pages)" do | |
338 | should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567' |
|
342 | should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567' | |
339 | should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala' |
|
343 | should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala' | |
340 | should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page' |
|
344 | should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page' | |
341 | should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation' |
|
345 | should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation' | |
342 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation' |
|
346 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation' | |
343 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2' |
|
347 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2' | |
344 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1' |
|
348 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1' | |
345 | should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2' |
|
349 | should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2' | |
346 | should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' |
|
350 | should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' | |
347 | should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567' |
|
351 | should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567' | |
348 | should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567' |
|
352 | should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567' | |
349 | should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567' |
|
353 | should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567' | |
350 |
|
354 | |||
351 | should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation' |
|
355 | should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation' | |
352 | should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' |
|
356 | should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' | |
353 | should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida' |
|
357 | should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida' | |
354 | should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida' |
|
358 | should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida' | |
355 |
|
359 | |||
356 | should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page' |
|
360 | should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page' | |
357 |
|
361 | |||
358 | should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida' |
|
362 | should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida' | |
359 | end |
|
363 | end | |
360 |
|
364 | |||
361 | context "wikis (plural, admin setup)" do |
|
365 | context "wikis (plural, admin setup)" do | |
362 | should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' |
|
366 | should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' | |
363 |
|
367 | |||
364 | should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida' |
|
368 | should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida' | |
365 | should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' |
|
369 | should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' | |
366 | end |
|
370 | end | |
367 |
|
371 | |||
368 | context "administration panel" do |
|
372 | context "administration panel" do | |
369 | should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects' |
|
373 | should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects' | |
370 | end |
|
374 | end | |
371 | end |
|
375 | end |
General Comments 0
You need to be logged in to leave comments.
Login now