@@ -1,314 +1,320 | |||||
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', :conditions => {:method => :get} |
|
9 | map.home '', :controller => 'welcome', :conditions => {:method => :get} | |
10 |
|
10 | |||
11 | map.signin 'login', :controller => 'account', :action => 'login', |
|
11 | map.signin 'login', :controller => 'account', :action => 'login', | |
12 | :conditions => {:method => [:get, :post]} |
|
12 | :conditions => {:method => [:get, :post]} | |
13 | map.signout 'logout', :controller => 'account', :action => 'logout', |
|
13 | map.signout 'logout', :controller => 'account', :action => 'logout', | |
14 | :conditions => {:method => :get} |
|
14 | :conditions => {:method => :get} | |
15 | map.connect 'account/register', :controller => 'account', :action => 'register', |
|
15 | map.connect 'account/register', :controller => 'account', :action => 'register', | |
16 | :conditions => {:method => [:get, :post]} |
|
16 | :conditions => {:method => [:get, :post]} | |
17 | map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password', |
|
17 | map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password', | |
18 | :conditions => {:method => [:get, :post]} |
|
18 | :conditions => {:method => [:get, :post]} | |
19 | map.connect 'account/activate', :controller => 'account', :action => 'activate', |
|
19 | map.connect 'account/activate', :controller => 'account', :action => 'activate', | |
20 | :conditions => {:method => :get} |
|
20 | :conditions => {:method => :get} | |
21 |
|
21 | |||
22 | map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' |
|
22 | map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' | |
23 |
|
23 | |||
24 | map.connect '/time_entries/destroy', |
|
24 | map.connect '/time_entries/destroy', | |
25 | :controller => 'timelog', :action => 'destroy', :conditions => { :method => :delete } |
|
25 | :controller => 'timelog', :action => 'destroy', :conditions => { :method => :delete } | |
26 | map.time_entries_context_menu '/time_entries/context_menu', |
|
26 | map.time_entries_context_menu '/time_entries/context_menu', | |
27 | :controller => 'context_menus', :action => 'time_entries' |
|
27 | :controller => 'context_menus', :action => 'time_entries' | |
28 |
|
28 | |||
29 | map.resources :time_entries, :controller => 'timelog', :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post} |
|
29 | map.resources :time_entries, :controller => 'timelog', :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post} | |
30 |
|
30 | |||
31 | map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} |
|
31 | map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} | |
32 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => [:get, :post]} |
|
32 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => [:get, :post]} | |
33 |
|
33 | |||
34 | map.with_options :controller => 'messages' do |messages_routes| |
|
34 | map.with_options :controller => 'messages' do |messages_routes| | |
35 | messages_routes.with_options :conditions => {:method => :get} do |messages_views| |
|
35 | messages_routes.with_options :conditions => {:method => :get} do |messages_views| | |
36 | messages_views.connect 'boards/:board_id/topics/new', :action => 'new' |
|
36 | messages_views.connect 'boards/:board_id/topics/new', :action => 'new' | |
37 | messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' |
|
37 | messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' | |
38 | messages_views.connect 'boards/:board_id/topics/quote/:id', :action => 'quote' |
|
38 | messages_views.connect 'boards/:board_id/topics/quote/:id', :action => 'quote' | |
39 | messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' |
|
39 | messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' | |
40 | end |
|
40 | end | |
41 | messages_routes.with_options :conditions => {:method => :post} do |messages_actions| |
|
41 | messages_routes.with_options :conditions => {:method => :post} do |messages_actions| | |
42 | messages_actions.connect 'boards/:board_id/topics/new', :action => 'new' |
|
42 | messages_actions.connect 'boards/:board_id/topics/new', :action => 'new' | |
43 | messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview' |
|
43 | messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview' | |
44 | messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply' |
|
44 | messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply' | |
45 | messages_actions.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' |
|
45 | messages_actions.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' | |
46 | messages_actions.connect 'boards/:board_id/topics/:id/destroy', :action => 'destroy' |
|
46 | messages_actions.connect 'boards/:board_id/topics/:id/destroy', :action => 'destroy' | |
47 | end |
|
47 | end | |
48 | end |
|
48 | end | |
49 |
|
49 | |||
50 | map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move' |
|
50 | map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move' | |
51 | map.resources :queries, :except => [:show] |
|
51 | map.resources :queries, :except => [:show] | |
52 |
|
52 | |||
53 | # Misc issue routes. TODO: move into resources |
|
53 | # Misc issue routes. TODO: move into resources | |
54 | map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues', :conditions => { :method => :get } |
|
54 | map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues', :conditions => { :method => :get } | |
55 | map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview |
|
55 | map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview | |
56 | map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues' |
|
56 | map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues' | |
57 | map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index' |
|
57 | map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index' | |
58 | map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', |
|
58 | map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', | |
59 | :id => /\d+/, :conditions => { :method => :post } |
|
59 | :id => /\d+/, :conditions => { :method => :post } | |
60 |
|
60 | |||
61 | map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff', |
|
61 | map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff', | |
62 | :id => /\d+/, :conditions => { :method => :get } |
|
62 | :id => /\d+/, :conditions => { :method => :get } | |
63 | map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit', |
|
63 | map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit', | |
64 | :id => /\d+/, :conditions => { :method => [:get, :post] } |
|
64 | :id => /\d+/, :conditions => { :method => [:get, :post] } | |
65 |
|
65 | |||
66 | map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes| |
|
66 | map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes| | |
67 | gantts_routes.connect '/projects/:project_id/issues/gantt' |
|
67 | gantts_routes.connect '/projects/:project_id/issues/gantt' | |
68 | gantts_routes.connect '/projects/:project_id/issues/gantt.:format' |
|
68 | gantts_routes.connect '/projects/:project_id/issues/gantt.:format' | |
69 | gantts_routes.connect '/issues/gantt.:format' |
|
69 | gantts_routes.connect '/issues/gantt.:format' | |
70 | end |
|
70 | end | |
71 |
|
71 | |||
72 | map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes| |
|
72 | map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes| | |
73 | calendars_routes.connect '/projects/:project_id/issues/calendar' |
|
73 | calendars_routes.connect '/projects/:project_id/issues/calendar' | |
74 | calendars_routes.connect '/issues/calendar' |
|
74 | calendars_routes.connect '/issues/calendar' | |
75 | end |
|
75 | end | |
76 |
|
76 | |||
77 | map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports| |
|
77 | map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports| | |
78 | reports.connect 'projects/:id/issues/report', :action => 'issue_report' |
|
78 | reports.connect 'projects/:id/issues/report', :action => 'issue_report' | |
79 | reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details' |
|
79 | reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details' | |
80 | end |
|
80 | end | |
81 |
|
81 | |||
82 | map.connect 'my/account', :controller => 'my', :action => 'account', |
|
82 | map.connect 'my/account', :controller => 'my', :action => 'account', | |
83 | :conditions => {:method => [:get, :post]} |
|
83 | :conditions => {:method => [:get, :post]} | |
84 | map.connect 'my/page', :controller => 'my', :action => 'page', |
|
84 | map.connect 'my/page', :controller => 'my', :action => 'page', | |
85 | :conditions => {:method => :get} |
|
85 | :conditions => {:method => :get} | |
86 | # Redirects to my/page |
|
86 | # Redirects to my/page | |
87 | map.connect 'my', :controller => 'my', :action => 'index', |
|
87 | map.connect 'my', :controller => 'my', :action => 'index', | |
88 | :conditions => {:method => :get} |
|
88 | :conditions => {:method => :get} | |
89 | map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', |
|
89 | map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', | |
90 | :conditions => {:method => :post} |
|
90 | :conditions => {:method => :post} | |
91 | map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', |
|
91 | map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', | |
92 | :conditions => {:method => :post} |
|
92 | :conditions => {:method => :post} | |
93 | map.connect 'my/password', :controller => 'my', :action => 'password', |
|
93 | map.connect 'my/password', :controller => 'my', :action => 'password', | |
94 | :conditions => {:method => [:get, :post]} |
|
94 | :conditions => {:method => [:get, :post]} | |
95 | map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout', |
|
95 | map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout', | |
96 | :conditions => {:method => :get} |
|
96 | :conditions => {:method => :get} | |
97 | map.connect 'my/add_block', :controller => 'my', :action => 'add_block', |
|
97 | map.connect 'my/add_block', :controller => 'my', :action => 'add_block', | |
98 | :conditions => {:method => :post} |
|
98 | :conditions => {:method => :post} | |
99 | map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block', |
|
99 | map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block', | |
100 | :conditions => {:method => :post} |
|
100 | :conditions => {:method => :post} | |
101 | map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks', |
|
101 | map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks', | |
102 | :conditions => {:method => :post} |
|
102 | :conditions => {:method => :post} | |
103 |
|
103 | |||
104 | map.resources :issues, :collection => {:bulk_edit => :get, :bulk_update => :post} do |issues| |
|
104 | map.resources :issues, :collection => {:bulk_edit => :get, :bulk_update => :post} do |issues| | |
105 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} |
|
105 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} | |
106 | issues.resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] |
|
106 | issues.resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] | |
107 | end |
|
107 | end | |
108 | # Bulk deletion |
|
108 | # Bulk deletion | |
109 | map.connect '/issues', :controller => 'issues', :action => 'destroy', :conditions => {:method => :delete} |
|
109 | map.connect '/issues', :controller => 'issues', :action => 'destroy', :conditions => {:method => :delete} | |
110 |
|
110 | |||
111 | map.connect 'projects/:id/members/new', :controller => 'members', |
|
111 | map.connect 'projects/:id/members/new', :controller => 'members', | |
112 | :action => 'new', :conditions => { :method => :post } |
|
112 | :action => 'new', :conditions => { :method => :post } | |
113 | map.connect 'members/edit/:id', :controller => 'members', |
|
113 | map.connect 'members/edit/:id', :controller => 'members', | |
114 | :action => 'edit', :id => /\d+/, :conditions => { :method => :post } |
|
114 | :action => 'edit', :id => /\d+/, :conditions => { :method => :post } | |
115 | map.connect 'members/destroy/:id', :controller => 'members', |
|
115 | map.connect 'members/destroy/:id', :controller => 'members', | |
116 | :action => 'destroy', :id => /\d+/, :conditions => { :method => :post } |
|
116 | :action => 'destroy', :id => /\d+/, :conditions => { :method => :post } | |
117 | map.connect 'members/autocomplete_for_member/:id', :controller => 'members', |
|
117 | map.connect 'members/autocomplete_for_member/:id', :controller => 'members', | |
118 | :action => 'autocomplete_for_member', :conditions => { :method => :post } |
|
118 | :action => 'autocomplete_for_member', :conditions => { :method => :post } | |
119 |
|
119 | |||
120 | map.resources :users |
|
120 | map.resources :users | |
121 | map.with_options :controller => 'users' do |users| |
|
121 | map.with_options :controller => 'users' do |users| | |
122 | users.user_memberships 'users/:id/memberships', |
|
122 | users.user_memberships 'users/:id/memberships', | |
123 | :action => 'edit_membership', |
|
123 | :action => 'edit_membership', | |
124 | :conditions => {:method => :post} |
|
124 | :conditions => {:method => :post} | |
125 | users.user_membership 'users/:id/memberships/:membership_id', |
|
125 | users.user_membership 'users/:id/memberships/:membership_id', | |
126 | :action => 'edit_membership', |
|
126 | :action => 'edit_membership', | |
127 | :conditions => {:method => :put} |
|
127 | :conditions => {:method => :put} | |
128 | users.connect 'users/:id/memberships/:membership_id', |
|
128 | users.connect 'users/:id/memberships/:membership_id', | |
129 | :action => 'destroy_membership', |
|
129 | :action => 'destroy_membership', | |
130 | :conditions => {:method => :delete} |
|
130 | :conditions => {:method => :delete} | |
131 | end |
|
131 | end | |
132 |
|
132 | |||
133 | # For nice "roadmap" in the url for the index action |
|
133 | # For nice "roadmap" in the url for the index action | |
134 | map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index' |
|
134 | map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index' | |
135 |
|
135 | |||
136 | map.connect 'news', :controller => 'news', :action => 'index' |
|
136 | map.connect 'news', :controller => 'news', :action => 'index' | |
137 | map.connect 'news.:format', :controller => 'news', :action => 'index' |
|
137 | map.connect 'news.:format', :controller => 'news', :action => 'index' | |
138 | map.preview_news '/news/preview', :controller => 'previews', :action => 'news' |
|
138 | map.preview_news '/news/preview', :controller => 'previews', :action => 'news' | |
139 | map.connect 'news/:id/comments', :controller => 'comments', |
|
139 | map.connect 'news/:id/comments', :controller => 'comments', | |
140 | :action => 'create', :conditions => {:method => :post} |
|
140 | :action => 'create', :conditions => {:method => :post} | |
141 | map.connect 'news/:id/comments/:comment_id', :controller => 'comments', |
|
141 | map.connect 'news/:id/comments/:comment_id', :controller => 'comments', | |
142 | :action => 'destroy', :conditions => {:method => :delete} |
|
142 | :action => 'destroy', :conditions => {:method => :delete} | |
143 |
|
143 | |||
144 | map.connect 'watchers/new', :controller=> 'watchers', :action => 'new', |
|
144 | map.connect 'watchers/new', :controller=> 'watchers', :action => 'new', | |
145 | :conditions => {:method => [:get, :post]} |
|
145 | :conditions => {:method => [:get, :post]} | |
146 | map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', |
|
146 | map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', | |
147 | :conditions => {:method => :post} |
|
147 | :conditions => {:method => :post} | |
148 | map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch', |
|
148 | map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch', | |
149 | :conditions => {:method => :post} |
|
149 | :conditions => {:method => :post} | |
150 | map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', |
|
150 | map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', | |
151 | :conditions => {:method => :post} |
|
151 | :conditions => {:method => :post} | |
152 |
|
152 | |||
153 | map.resources :projects, :member => { |
|
153 | map.resources :projects, :member => { | |
154 | :copy => [:get, :post], |
|
154 | :copy => [:get, :post], | |
155 | :settings => :get, |
|
155 | :settings => :get, | |
156 | :modules => :post, |
|
156 | :modules => :post, | |
157 | :archive => :post, |
|
157 | :archive => :post, | |
158 | :unarchive => :post |
|
158 | :unarchive => :post | |
159 | } do |project| |
|
159 | } do |project| | |
160 | project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy] |
|
160 | project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy] | |
161 | project.resources :issues, :only => [:index, :new, :create] do |issues| |
|
161 | project.resources :issues, :only => [:index, :new, :create] do |issues| | |
162 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} |
|
162 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} | |
163 | end |
|
163 | end | |
164 | # issue form update |
|
164 | # issue form update | |
165 | project.issue_form 'issues/new', :controller => 'issues', :action => 'new', :conditions => {:method => :post} |
|
165 | project.issue_form 'issues/new', :controller => 'issues', :action => 'new', :conditions => {:method => :post} | |
166 |
|
166 | |||
167 | project.resources :files, :only => [:index, :new, :create] |
|
167 | project.resources :files, :only => [:index, :new, :create] | |
168 | project.resources :versions, :shallow => true, :collection => {:close_completed => :put}, :member => {:status_by => :post} |
|
168 | project.resources :versions, :shallow => true, :collection => {:close_completed => :put}, :member => {:status_by => :post} | |
169 | project.resources :news, :shallow => true |
|
169 | project.resources :news, :shallow => true | |
170 | project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id', :collection => {:report => :get} |
|
170 | project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id', :collection => {:report => :get} | |
171 | project.resources :queries, :only => [:new, :create] |
|
171 | project.resources :queries, :only => [:new, :create] | |
172 | project.resources :issue_categories, :shallow => true |
|
172 | project.resources :issue_categories, :shallow => true | |
173 | project.resources :documents, :shallow => true, :member => {:add_attachment => :post} |
|
173 | project.resources :documents, :shallow => true, :member => {:add_attachment => :post} | |
174 | project.resources :boards |
|
174 | project.resources :boards | |
175 |
|
175 | |||
176 | project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get} |
|
176 | project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get} | |
177 | project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get} |
|
177 | project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get} | |
178 | project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil |
|
178 | project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil | |
179 | project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff' |
|
179 | project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff' | |
180 | project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate' |
|
180 | project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate' | |
181 | project.resources :wiki, :except => [:new, :create], :member => { |
|
181 | project.resources :wiki, :except => [:new, :create], :member => { | |
182 | :rename => [:get, :post], |
|
182 | :rename => [:get, :post], | |
183 | :history => :get, |
|
183 | :history => :get, | |
184 | :preview => :any, |
|
184 | :preview => :any, | |
185 | :protect => :post, |
|
185 | :protect => :post, | |
186 | :add_attachment => :post |
|
186 | :add_attachment => :post | |
187 | }, :collection => { |
|
187 | }, :collection => { | |
188 | :export => :get, |
|
188 | :export => :get, | |
189 | :date_index => :get |
|
189 | :date_index => :get | |
190 | } |
|
190 | } | |
191 |
|
191 | |||
192 | end |
|
192 | end | |
193 |
|
193 | |||
194 | # TODO: port to be part of the resources route(s) |
|
194 | # TODO: port to be part of the resources route(s) | |
195 | map.with_options :controller => 'projects' do |project_mapper| |
|
195 | map.with_options :controller => 'projects' do |project_mapper| | |
196 | project_mapper.with_options :conditions => {:method => :get} do |project_views| |
|
196 | project_mapper.with_options :conditions => {:method => :get} do |project_views| | |
197 | project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings' |
|
197 | project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings' | |
198 | project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new' |
|
198 | project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new' | |
199 | end |
|
199 | end | |
200 | end |
|
200 | end | |
201 |
|
201 | |||
202 | map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity| |
|
202 | map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity| | |
203 | activity.connect 'projects/:id/activity' |
|
203 | activity.connect 'projects/:id/activity' | |
204 | activity.connect 'projects/:id/activity.:format' |
|
204 | activity.connect 'projects/:id/activity.:format' | |
205 | activity.connect 'activity', :id => nil |
|
205 | activity.connect 'activity', :id => nil | |
206 | activity.connect 'activity.:format', :id => nil |
|
206 | activity.connect 'activity.:format', :id => nil | |
207 | end |
|
207 | end | |
208 |
|
208 | |||
209 | map.with_options :controller => 'repositories' do |repositories| |
|
209 | map.with_options :controller => 'repositories' do |repositories| | |
210 | repositories.with_options :conditions => {:method => :get} do |repository_views| |
|
210 | repositories.with_options :conditions => {:method => :get} do |repository_views| | |
211 | repository_views.connect 'projects/:id/repository', :action => 'show' |
|
211 | repository_views.connect 'projects/:id/repository', :action => 'show' | |
212 | repository_views.connect 'projects/:id/repository/edit', :action => 'edit' |
|
212 | repository_views.connect 'projects/:id/repository/edit', :action => 'edit' | |
213 | repository_views.connect 'projects/:id/repository/statistics', :action => 'stats' |
|
213 | repository_views.connect 'projects/:id/repository/statistics', :action => 'stats' | |
214 | repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions' |
|
214 | repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions' | |
215 | repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions' |
|
215 | repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions' | |
216 | repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' |
|
216 | repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' | |
217 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' |
|
217 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' | |
218 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' |
|
218 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' | |
219 | repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ } |
|
219 | repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ } | |
220 | repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } |
|
220 | repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } | |
221 | repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw' |
|
221 | repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw' | |
222 | repository_views.connect 'projects/:id/repository/browse/*path', :action => 'browse' |
|
222 | repository_views.connect 'projects/:id/repository/browse/*path', :action => 'browse' | |
223 | repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry' |
|
223 | repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry' | |
224 | repository_views.connect 'projects/:id/repository/changes/*path', :action => 'changes' |
|
224 | repository_views.connect 'projects/:id/repository/changes/*path', :action => 'changes' | |
225 | repository_views.connect 'projects/:id/repository/annotate/*path', :action => 'annotate' |
|
225 | repository_views.connect 'projects/:id/repository/annotate/*path', :action => 'annotate' | |
226 | repository_views.connect 'projects/:id/repository/diff/*path', :action => 'diff' |
|
226 | repository_views.connect 'projects/:id/repository/diff/*path', :action => 'diff' | |
227 | repository_views.connect 'projects/:id/repository/show/*path', :action => 'show' |
|
227 | repository_views.connect 'projects/:id/repository/show/*path', :action => 'show' | |
228 | repository_views.connect 'projects/:id/repository/graph', :action => 'graph' |
|
228 | repository_views.connect 'projects/:id/repository/graph', :action => 'graph' | |
229 | end |
|
229 | end | |
230 |
|
230 | |||
231 | repositories.connect 'projects/:id/repository/revision', :action => 'revision', :conditions => {:method => [:get, :post]} |
|
231 | repositories.connect 'projects/:id/repository/revision', :action => 'revision', :conditions => {:method => [:get, :post]} | |
232 | repositories.connect 'projects/:id/repository/committers', :action => 'committers', :conditions => {:method => [:get, :post]} |
|
232 | repositories.connect 'projects/:id/repository/committers', :action => 'committers', :conditions => {:method => [:get, :post]} | |
233 | repositories.connect 'projects/:id/repository/edit', :action => 'edit', :conditions => {:method => :post} |
|
233 | repositories.connect 'projects/:id/repository/edit', :action => 'edit', :conditions => {:method => :post} | |
234 | repositories.connect 'projects/:id/repository/destroy', :action => 'destroy', :conditions => {:method => :post} |
|
234 | repositories.connect 'projects/:id/repository/destroy', :action => 'destroy', :conditions => {:method => :post} | |
235 | end |
|
235 | end | |
236 |
|
236 | |||
237 | map.resources :attachments, :only => [:show, :destroy] |
|
237 | map.resources :attachments, :only => [:show, :destroy] | |
238 | # additional routes for having the file name at the end of url |
|
238 | # additional routes for having the file name at the end of url | |
239 | map.connect 'attachments/:id/:filename', :controller => 'attachments', |
|
239 | map.connect 'attachments/:id/:filename', :controller => 'attachments', | |
240 | :action => 'show', :id => /\d+/, :filename => /.*/, |
|
240 | :action => 'show', :id => /\d+/, :filename => /.*/, | |
241 | :conditions => {:method => :get} |
|
241 | :conditions => {:method => :get} | |
242 | map.connect 'attachments/download/:id/:filename', :controller => 'attachments', |
|
242 | map.connect 'attachments/download/:id/:filename', :controller => 'attachments', | |
243 | :action => 'download', :id => /\d+/, :filename => /.*/, |
|
243 | :action => 'download', :id => /\d+/, :filename => /.*/, | |
244 | :conditions => {:method => :get} |
|
244 | :conditions => {:method => :get} | |
245 | map.connect 'attachments/download/:id', :controller => 'attachments', |
|
245 | map.connect 'attachments/download/:id', :controller => 'attachments', | |
246 | :action => 'download', :id => /\d+/, |
|
246 | :action => 'download', :id => /\d+/, | |
247 | :conditions => {:method => :get} |
|
247 | :conditions => {:method => :get} | |
248 |
|
248 | |||
249 | map.resources :groups, :member => {:autocomplete_for_user => :get} |
|
249 | map.resources :groups, :member => {:autocomplete_for_user => :get} | |
250 | map.group_users 'groups/:id/users', :controller => 'groups', |
|
250 | map.group_users 'groups/:id/users', :controller => 'groups', | |
251 | :action => 'add_users', :id => /\d+/, |
|
251 | :action => 'add_users', :id => /\d+/, | |
252 | :conditions => {:method => :post} |
|
252 | :conditions => {:method => :post} | |
253 | map.group_user 'groups/:id/users/:user_id', :controller => 'groups', |
|
253 | map.group_user 'groups/:id/users/:user_id', :controller => 'groups', | |
254 | :action => 'remove_user', :id => /\d+/, |
|
254 | :action => 'remove_user', :id => /\d+/, | |
255 | :conditions => {:method => :delete} |
|
255 | :conditions => {:method => :delete} | |
256 | map.connect 'groups/destroy_membership/:id', :controller => 'groups', |
|
256 | map.connect 'groups/destroy_membership/:id', :controller => 'groups', | |
257 | :action => 'destroy_membership', :id => /\d+/, |
|
257 | :action => 'destroy_membership', :id => /\d+/, | |
258 | :conditions => {:method => :post} |
|
258 | :conditions => {:method => :post} | |
259 | map.connect 'groups/edit_membership/:id', :controller => 'groups', |
|
259 | map.connect 'groups/edit_membership/:id', :controller => 'groups', | |
260 | :action => 'edit_membership', :id => /\d+/, |
|
260 | :action => 'edit_membership', :id => /\d+/, | |
261 | :conditions => {:method => :post} |
|
261 | :conditions => {:method => :post} | |
262 |
|
262 | |||
263 | map.resources :trackers, :except => :show |
|
263 | map.resources :trackers, :except => :show | |
264 | map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post} |
|
264 | map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post} | |
265 | map.resources :custom_fields, :except => :show |
|
265 | map.resources :custom_fields, :except => :show | |
266 | map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]} |
|
266 | map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]} | |
267 | map.resources :enumerations, :except => :show |
|
267 | map.resources :enumerations, :except => :show | |
268 |
|
268 | |||
269 | map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get} |
|
269 | map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get} | |
270 |
|
270 | |||
271 | map.connect 'mail_handler', :controller => 'mail_handler', :action => 'index', :conditions => {:method => :post} |
|
271 | map.connect 'mail_handler', :controller => 'mail_handler', :action => 'index', :conditions => {:method => :post} | |
272 |
|
272 | |||
273 | map.connect 'admin', :controller => 'admin', :action => 'index', :conditions => {:method => :get} |
|
273 | map.connect 'admin', :controller => 'admin', :action => 'index', :conditions => {:method => :get} | |
274 | map.connect 'admin/projects', :controller => 'admin', :action => 'projects', :conditions => {:method => :get} |
|
274 | map.connect 'admin/projects', :controller => 'admin', :action => 'projects', :conditions => {:method => :get} | |
275 | map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins', :conditions => {:method => :get} |
|
275 | map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins', :conditions => {:method => :get} | |
276 | map.connect 'admin/info', :controller => 'admin', :action => 'info', :conditions => {:method => :get} |
|
276 | map.connect 'admin/info', :controller => 'admin', :action => 'info', :conditions => {:method => :get} | |
277 | map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email', :conditions => {:method => :get} |
|
277 | map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email', :conditions => {:method => :get} | |
278 | map.connect 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :conditions => {:method => :post} |
|
278 | map.connect 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :conditions => {:method => :post} | |
279 |
|
279 | |||
280 | # Used by AuthSourcesControllerTest |
|
280 | # Used by AuthSourcesControllerTest | |
281 | # TODO : refactor *AuthSourcesController to remove these routes |
|
281 | # TODO : refactor *AuthSourcesController to remove these routes | |
282 | map.connect 'auth_sources', :controller => 'auth_sources', :action => 'index', :conditions => {:method => :get} |
|
282 | map.connect 'auth_sources', :controller => 'auth_sources', :action => 'index', :conditions => {:method => :get} | |
283 | map.connect 'auth_sources/new', :controller => 'auth_sources', :action => 'new', :conditions => {:method => :get} |
|
283 | map.connect 'auth_sources/new', :controller => 'auth_sources', :action => 'new', :conditions => {:method => :get} | |
284 | map.connect 'auth_sources/create', :controller => 'auth_sources', :action => 'create', :conditions => {:method => :post} |
|
284 | map.connect 'auth_sources/create', :controller => 'auth_sources', :action => 'create', :conditions => {:method => :post} | |
285 | map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post} |
|
285 | map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post} | |
286 | map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources', :action => 'test_connection', :conditions => {:method => :get} |
|
286 | map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources', :action => 'test_connection', :conditions => {:method => :get} | |
287 | map.connect 'auth_sources/edit/:id', :controller => 'auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get} |
|
287 | map.connect 'auth_sources/edit/:id', :controller => 'auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get} | |
288 | map.connect 'auth_sources/update/:id', :controller => 'auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post} |
|
288 | map.connect 'auth_sources/update/:id', :controller => 'auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post} | |
289 |
|
289 | |||
290 | map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources', :action => 'index', :conditions => {:method => :get} |
|
290 | map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources', :action => 'index', :conditions => {:method => :get} | |
291 | map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources', :action => 'new', :conditions => {:method => :get} |
|
291 | map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources', :action => 'new', :conditions => {:method => :get} | |
292 | map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources', :action => 'create', :conditions => {:method => :post} |
|
292 | map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources', :action => 'create', :conditions => {:method => :post} | |
293 | map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post} |
|
293 | map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post} | |
294 | map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources', :action => 'test_connection', :conditions => {:method => :get} |
|
294 | map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources', :action => 'test_connection', :conditions => {:method => :get} | |
295 | map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get} |
|
295 | map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get} | |
296 | map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post} |
|
296 | map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post} | |
297 | map.connect 'workflows', :controller => 'workflows', :action => 'index', :conditions => {:method => :get} |
|
297 | map.connect 'workflows', :controller => 'workflows', :action => 'index', :conditions => {:method => :get} | |
298 | map.connect 'workflows/edit', :controller => 'workflows', :action => 'edit', :conditions => {:method => [:get, :post]} |
|
298 | map.connect 'workflows/edit', :controller => 'workflows', :action => 'edit', :conditions => {:method => [:get, :post]} | |
299 | map.connect 'workflows/copy', :controller => 'workflows', :action => 'copy', :conditions => {:method => [:get, :post]} |
|
299 | map.connect 'workflows/copy', :controller => 'workflows', :action => 'copy', :conditions => {:method => [:get, :post]} | |
300 | map.connect 'settings', :controller => 'settings', :action => 'index', :conditions => {:method => :get} |
|
300 | map.connect 'settings', :controller => 'settings', :action => 'index', :conditions => {:method => :get} | |
301 | map.connect 'settings/edit', :controller => 'settings', :action => 'edit', :conditions => {:method => [:get, :post]} |
|
301 | map.connect 'settings/edit', :controller => 'settings', :action => 'edit', :conditions => {:method => [:get, :post]} | |
302 | map.connect 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :conditions => {:method => [:get, :post]} |
|
302 | map.connect 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :conditions => {:method => [:get, :post]} | |
303 |
|
303 | |||
304 | map.with_options :controller => 'sys' do |sys| |
|
304 | map.with_options :controller => 'sys' do |sys| | |
305 | sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get} |
|
305 | sys.connect 'sys/projects.:format', | |
306 | sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post} |
|
306 | :action => 'projects', | |
307 | sys.connect 'sys/fetch_changesets', :action => 'fetch_changesets', :conditions => {:method => :get} |
|
307 | :conditions => {:method => :get} | |
|
308 | sys.connect 'sys/projects/:id/repository.:format', | |||
|
309 | :action => 'create_project_repository', | |||
|
310 | :conditions => {:method => :post} | |||
|
311 | sys.connect 'sys/fetch_changesets', | |||
|
312 | :action => 'fetch_changesets', | |||
|
313 | :conditions => {:method => :get} | |||
308 | end |
|
314 | end | |
309 |
|
315 | |||
310 | map.connect 'robots.txt', :controller => 'welcome', :action => 'robots', :conditions => {:method => :get} |
|
316 | map.connect 'robots.txt', :controller => 'welcome', :action => 'robots', :conditions => {:method => :get} | |
311 |
|
317 | |||
312 | # Used for OpenID |
|
318 | # Used for OpenID | |
313 | map.root :controller => 'account', :action => 'login' |
|
319 | map.root :controller => 'account', :action => 'login' | |
314 | end |
|
320 | end |
General Comments 0
You need to be logged in to leave comments.
Login now