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