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