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