##// END OF EJS Templates
route: repository: move :repository_id routes before non :repository_id routes...
Toshi MARUYAMA -
r8598:f49d8d8c5f5f
parent child
Show More
@@ -1,410 +1,413
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_issue '/issues/preview/:id', :controller => 'previews',
47 map.preview_issue '/issues/preview/:id', :controller => 'previews',
48 :action => 'issue'
48 :action => 'issue'
49 map.issues_context_menu '/issues/context_menu',
49 map.issues_context_menu '/issues/context_menu',
50 :controller => 'context_menus', :action => 'issues'
50 :controller => 'context_menus', :action => 'issues'
51
51
52 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
52 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
53 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new',
53 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new',
54 :id => /\d+/, :conditions => { :method => :post }
54 :id => /\d+/, :conditions => { :method => :post }
55
55
56 map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff',
56 map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff',
57 :id => /\d+/, :conditions => { :method => :get }
57 :id => /\d+/, :conditions => { :method => :get }
58 map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit',
58 map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit',
59 :id => /\d+/, :conditions => { :method => [:get, :post] }
59 :id => /\d+/, :conditions => { :method => [:get, :post] }
60
60
61 map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
61 map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
62 gantts_routes.connect '/projects/:project_id/issues/gantt'
62 gantts_routes.connect '/projects/:project_id/issues/gantt'
63 gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
63 gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
64 gantts_routes.connect '/issues/gantt.:format'
64 gantts_routes.connect '/issues/gantt.:format'
65 end
65 end
66
66
67 map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
67 map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
68 calendars_routes.connect '/projects/:project_id/issues/calendar'
68 calendars_routes.connect '/projects/:project_id/issues/calendar'
69 calendars_routes.connect '/issues/calendar'
69 calendars_routes.connect '/issues/calendar'
70 end
70 end
71
71
72 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
72 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
73 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
73 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
74 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
74 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
75 end
75 end
76
76
77 map.connect 'my/account', :controller => 'my', :action => 'account',
77 map.connect 'my/account', :controller => 'my', :action => 'account',
78 :conditions => {:method => [:get, :post]}
78 :conditions => {:method => [:get, :post]}
79 map.connect 'my/page', :controller => 'my', :action => 'page',
79 map.connect 'my/page', :controller => 'my', :action => 'page',
80 :conditions => {:method => :get}
80 :conditions => {:method => :get}
81 # Redirects to my/page
81 # Redirects to my/page
82 map.connect 'my', :controller => 'my', :action => 'index',
82 map.connect 'my', :controller => 'my', :action => 'index',
83 :conditions => {:method => :get}
83 :conditions => {:method => :get}
84 map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key',
84 map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key',
85 :conditions => {:method => :post}
85 :conditions => {:method => :post}
86 map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key',
86 map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key',
87 :conditions => {:method => :post}
87 :conditions => {:method => :post}
88 map.connect 'my/password', :controller => 'my', :action => 'password',
88 map.connect 'my/password', :controller => 'my', :action => 'password',
89 :conditions => {:method => [:get, :post]}
89 :conditions => {:method => [:get, :post]}
90 map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout',
90 map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout',
91 :conditions => {:method => :get}
91 :conditions => {:method => :get}
92 map.connect 'my/add_block', :controller => 'my', :action => 'add_block',
92 map.connect 'my/add_block', :controller => 'my', :action => 'add_block',
93 :conditions => {:method => :post}
93 :conditions => {:method => :post}
94 map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block',
94 map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block',
95 :conditions => {:method => :post}
95 :conditions => {:method => :post}
96 map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks',
96 map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks',
97 :conditions => {:method => :post}
97 :conditions => {:method => :post}
98
98
99 map.connect 'projects/:id/members/new', :controller => 'members',
99 map.connect 'projects/:id/members/new', :controller => 'members',
100 :action => 'new', :conditions => { :method => :post }
100 :action => 'new', :conditions => { :method => :post }
101 map.connect 'members/edit/:id', :controller => 'members',
101 map.connect 'members/edit/:id', :controller => 'members',
102 :action => 'edit', :id => /\d+/, :conditions => { :method => :post }
102 :action => 'edit', :id => /\d+/, :conditions => { :method => :post }
103 map.connect 'members/destroy/:id', :controller => 'members',
103 map.connect 'members/destroy/:id', :controller => 'members',
104 :action => 'destroy', :id => /\d+/, :conditions => { :method => :post }
104 :action => 'destroy', :id => /\d+/, :conditions => { :method => :post }
105 map.connect 'members/autocomplete_for_member/:id', :controller => 'members',
105 map.connect 'members/autocomplete_for_member/:id', :controller => 'members',
106 :action => 'autocomplete_for_member', :conditions => { :method => :post }
106 :action => 'autocomplete_for_member', :conditions => { :method => :post }
107
107
108 map.with_options :controller => 'users' do |users|
108 map.with_options :controller => 'users' do |users|
109 users.user_membership 'users/:id/memberships/:membership_id',
109 users.user_membership 'users/:id/memberships/:membership_id',
110 :action => 'edit_membership',
110 :action => 'edit_membership',
111 :conditions => {:method => :put}
111 :conditions => {:method => :put}
112 users.connect 'users/:id/memberships/:membership_id',
112 users.connect 'users/:id/memberships/:membership_id',
113 :action => 'destroy_membership',
113 :action => 'destroy_membership',
114 :conditions => {:method => :delete}
114 :conditions => {:method => :delete}
115 users.user_memberships 'users/:id/memberships',
115 users.user_memberships 'users/:id/memberships',
116 :action => 'edit_membership',
116 :action => 'edit_membership',
117 :conditions => {:method => :post}
117 :conditions => {:method => :post}
118 end
118 end
119 map.resources :users
119 map.resources :users
120
120
121 # For nice "roadmap" in the url for the index action
121 # For nice "roadmap" in the url for the index action
122 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
122 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
123
123
124 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
124 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
125 map.connect 'news/:id/comments', :controller => 'comments',
125 map.connect 'news/:id/comments', :controller => 'comments',
126 :action => 'create', :conditions => {:method => :post}
126 :action => 'create', :conditions => {:method => :post}
127 map.connect 'news/:id/comments/:comment_id', :controller => 'comments',
127 map.connect 'news/:id/comments/:comment_id', :controller => 'comments',
128 :action => 'destroy', :conditions => {:method => :delete}
128 :action => 'destroy', :conditions => {:method => :delete}
129
129
130 map.connect 'watchers/new', :controller=> 'watchers', :action => 'new',
130 map.connect 'watchers/new', :controller=> 'watchers', :action => 'new',
131 :conditions => {:method => :get}
131 :conditions => {:method => :get}
132 map.connect 'watchers', :controller=> 'watchers', :action => 'create',
132 map.connect 'watchers', :controller=> 'watchers', :action => 'create',
133 :conditions => {:method => :post}
133 :conditions => {:method => :post}
134 map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy',
134 map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy',
135 :conditions => {:method => :post}
135 :conditions => {:method => :post}
136 map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch',
136 map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch',
137 :conditions => {:method => :post}
137 :conditions => {:method => :post}
138 map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch',
138 map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch',
139 :conditions => {:method => :post}
139 :conditions => {:method => :post}
140 map.connect 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user',
140 map.connect 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user',
141 :conditions => {:method => :get}
141 :conditions => {:method => :get}
142
142
143 # TODO: port to be part of the resources route(s)
143 # TODO: port to be part of the resources route(s)
144 map.with_options :conditions => {:method => :get} do |project_views|
144 map.with_options :conditions => {:method => :get} do |project_views|
145 project_views.connect 'projects/:id/settings/:tab',
145 project_views.connect 'projects/:id/settings/:tab',
146 :controller => 'projects', :action => 'settings'
146 :controller => 'projects', :action => 'settings'
147 project_views.connect 'projects/:project_id/issues/:copy_from/copy',
147 project_views.connect 'projects/:project_id/issues/:copy_from/copy',
148 :controller => 'issues', :action => 'new'
148 :controller => 'issues', :action => 'new'
149 end
149 end
150
150
151 map.resources :projects, :member => {
151 map.resources :projects, :member => {
152 :copy => [:get, :post],
152 :copy => [:get, :post],
153 :settings => :get,
153 :settings => :get,
154 :modules => :post,
154 :modules => :post,
155 :archive => :post,
155 :archive => :post,
156 :unarchive => :post
156 :unarchive => :post
157 } do |project|
157 } do |project|
158 project.resource :enumerations, :controller => 'project_enumerations',
158 project.resource :enumerations, :controller => 'project_enumerations',
159 :only => [:update, :destroy]
159 :only => [:update, :destroy]
160 # issue form update
160 # issue form update
161 project.issue_form 'issues/new', :controller => 'issues',
161 project.issue_form 'issues/new', :controller => 'issues',
162 :action => 'new', :conditions => {:method => [:post, :put]}
162 :action => 'new', :conditions => {:method => [:post, :put]}
163 project.resources :issues, :only => [:index, :new, :create] do |issues|
163 project.resources :issues, :only => [:index, :new, :create] do |issues|
164 issues.resources :time_entries, :controller => 'timelog',
164 issues.resources :time_entries, :controller => 'timelog',
165 :collection => {:report => :get}
165 :collection => {:report => :get}
166 end
166 end
167
167
168 project.resources :files, :only => [:index, :new, :create]
168 project.resources :files, :only => [:index, :new, :create]
169 project.resources :versions, :shallow => true,
169 project.resources :versions, :shallow => true,
170 :collection => {:close_completed => :put},
170 :collection => {:close_completed => :put},
171 :member => {:status_by => :post}
171 :member => {:status_by => :post}
172 project.resources :news, :shallow => true
172 project.resources :news, :shallow => true
173 project.resources :time_entries, :controller => 'timelog',
173 project.resources :time_entries, :controller => 'timelog',
174 :collection => {:report => :get}
174 :collection => {:report => :get}
175 project.resources :queries, :only => [:new, :create]
175 project.resources :queries, :only => [:new, :create]
176 project.resources :issue_categories, :shallow => true
176 project.resources :issue_categories, :shallow => true
177 project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
177 project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
178 project.resources :boards
178 project.resources :boards
179 project.resources :repositories, :shallow => true, :except => [:index, :show],
179 project.resources :repositories, :shallow => true, :except => [:index, :show],
180 :member => {:committers => [:get, :post]}
180 :member => {:committers => [:get, :post]}
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
237 repository_views.connect 'projects/:id/repository/:repository_id/statistics',
238 :action => 'stats'
239 repository_views.connect 'projects/:id/repository/:repository_id/graph',
240 :action => 'graph'
241
236 repository_views.connect 'projects/:id/repository/statistics',
242 repository_views.connect 'projects/:id/repository/statistics',
237 :action => 'stats'
243 :action => 'stats'
238 repository_views.connect 'projects/:id/repository/graph',
244 repository_views.connect 'projects/:id/repository/graph',
239 :action => 'graph'
245 :action => 'graph'
240 repository_views.connect 'projects/:id/repository/revisions',
246
247 repository_views.connect 'projects/:id/repository/:repository_id/revisions',
241 :action => 'revisions'
248 :action => 'revisions'
242 repository_views.connect 'projects/:id/repository/revisions.:format',
249 repository_views.connect 'projects/:id/repository/:repository_id/revisions.:format',
243 :action => 'revisions'
250 :action => 'revisions'
244 repository_views.connect 'projects/:id/repository/revisions/:rev',
251 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev',
245 :action => 'revision'
252 :action => 'revision'
246 repository_views.connect 'projects/:id/repository/revisions/:rev/diff',
253 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/diff',
247 :action => 'diff'
254 :action => 'diff'
248 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format',
255 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/diff.:format',
249 :action => 'diff'
256 :action => 'diff'
250 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path',
257 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/raw/*path',
251 :action => 'entry', :format => 'raw'
258 :action => 'entry', :format => 'raw'
252 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path',
259 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/:action/*path',
253 :requirements => {
260 :requirements => {
254 :action => /(browse|show|entry|changes|annotate|diff)/,
261 :action => /(browse|show|entry|changes|annotate|diff)/,
255 :rev => /[a-z0-9\.\-_]+/
262 :rev => /[a-z0-9\.\-_]+/
256 }
263 }
257 repository_views.connect 'projects/:id/repository/raw/*path',
264 repository_views.connect 'projects/:id/repository/:repository_id/raw/*path',
258 :action => 'entry', :format => 'raw'
265 :action => 'entry', :format => 'raw'
259 repository_views.connect 'projects/:id/repository/:action/*path',
266 repository_views.connect 'projects/:id/repository/:repository_id/:action/*path',
260 :requirements => { :action => /(browse|show|entry|changes|annotate|diff)/ }
267 :requirements => { :action => /(browse|show|entry|changes|annotate|diff)/ }
261
268
262 # Same routes with a repository_id
269 repository_views.connect 'projects/:id/repository/revisions',
263 repository_views.connect 'projects/:id/repository/:repository_id/statistics',
264 :action => 'stats'
265 repository_views.connect 'projects/:id/repository/:repository_id/graph',
266 :action => 'graph'
267 repository_views.connect 'projects/:id/repository/:repository_id/revisions',
268 :action => 'revisions'
270 :action => 'revisions'
269 repository_views.connect 'projects/:id/repository/:repository_id/revisions.:format',
271 repository_views.connect 'projects/:id/repository/revisions.:format',
270 :action => 'revisions'
272 :action => 'revisions'
271 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev',
273 repository_views.connect 'projects/:id/repository/revisions/:rev',
272 :action => 'revision'
274 :action => 'revision'
273 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/diff',
275 repository_views.connect 'projects/:id/repository/revisions/:rev/diff',
274 :action => 'diff'
276 :action => 'diff'
275 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/diff.:format',
277 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format',
276 :action => 'diff'
278 :action => 'diff'
277 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/raw/*path',
279 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path',
278 :action => 'entry', :format => 'raw'
280 :action => 'entry', :format => 'raw'
279 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/:action/*path',
281 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path',
280 :requirements => {
282 :requirements => {
281 :action => /(browse|show|entry|changes|annotate|diff)/,
283 :action => /(browse|show|entry|changes|annotate|diff)/,
282 :rev => /[a-z0-9\.\-_]+/
284 :rev => /[a-z0-9\.\-_]+/
283 }
285 }
284 repository_views.connect 'projects/:id/repository/:repository_id/raw/*path',
286 repository_views.connect 'projects/:id/repository/raw/*path',
285 :action => 'entry', :format => 'raw'
287 :action => 'entry', :format => 'raw'
286 repository_views.connect 'projects/:id/repository/:repository_id/:action/*path',
288 repository_views.connect 'projects/:id/repository/:action/*path',
287 :requirements => { :action => /(browse|show|entry|changes|annotate|diff)/ }
289 :requirements => { :action => /(browse|show|entry|changes|annotate|diff)/ }
290
288 repository_views.connect 'projects/:id/repository/:repository_id',
291 repository_views.connect 'projects/:id/repository/:repository_id',
289 :action => 'show'
292 :action => 'show'
290 end
293 end
291
294
292 repositories.connect 'projects/:id/repository/revision',
295 repositories.connect 'projects/:id/repository/revision',
293 :action => 'revision',
296 :action => 'revision',
294 :conditions => {:method => [:get, :post]}
297 :conditions => {:method => [:get, :post]}
295 end
298 end
296
299
297 # additional routes for having the file name at the end of url
300 # additional routes for having the file name at the end of url
298 map.connect 'attachments/:id/:filename', :controller => 'attachments',
301 map.connect 'attachments/:id/:filename', :controller => 'attachments',
299 :action => 'show', :id => /\d+/, :filename => /.*/,
302 :action => 'show', :id => /\d+/, :filename => /.*/,
300 :conditions => {:method => :get}
303 :conditions => {:method => :get}
301 map.connect 'attachments/download/:id/:filename', :controller => 'attachments',
304 map.connect 'attachments/download/:id/:filename', :controller => 'attachments',
302 :action => 'download', :id => /\d+/, :filename => /.*/,
305 :action => 'download', :id => /\d+/, :filename => /.*/,
303 :conditions => {:method => :get}
306 :conditions => {:method => :get}
304 map.connect 'attachments/download/:id', :controller => 'attachments',
307 map.connect 'attachments/download/:id', :controller => 'attachments',
305 :action => 'download', :id => /\d+/,
308 :action => 'download', :id => /\d+/,
306 :conditions => {:method => :get}
309 :conditions => {:method => :get}
307 map.resources :attachments, :only => [:show, :destroy]
310 map.resources :attachments, :only => [:show, :destroy]
308
311
309 map.resources :groups, :member => {:autocomplete_for_user => :get}
312 map.resources :groups, :member => {:autocomplete_for_user => :get}
310 map.group_users 'groups/:id/users', :controller => 'groups',
313 map.group_users 'groups/:id/users', :controller => 'groups',
311 :action => 'add_users', :id => /\d+/,
314 :action => 'add_users', :id => /\d+/,
312 :conditions => {:method => :post}
315 :conditions => {:method => :post}
313 map.group_user 'groups/:id/users/:user_id', :controller => 'groups',
316 map.group_user 'groups/:id/users/:user_id', :controller => 'groups',
314 :action => 'remove_user', :id => /\d+/,
317 :action => 'remove_user', :id => /\d+/,
315 :conditions => {:method => :delete}
318 :conditions => {:method => :delete}
316 map.connect 'groups/destroy_membership/:id', :controller => 'groups',
319 map.connect 'groups/destroy_membership/:id', :controller => 'groups',
317 :action => 'destroy_membership', :id => /\d+/,
320 :action => 'destroy_membership', :id => /\d+/,
318 :conditions => {:method => :post}
321 :conditions => {:method => :post}
319 map.connect 'groups/edit_membership/:id', :controller => 'groups',
322 map.connect 'groups/edit_membership/:id', :controller => 'groups',
320 :action => 'edit_membership', :id => /\d+/,
323 :action => 'edit_membership', :id => /\d+/,
321 :conditions => {:method => :post}
324 :conditions => {:method => :post}
322
325
323 map.resources :trackers, :except => :show
326 map.resources :trackers, :except => :show
324 map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
327 map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
325 map.resources :custom_fields, :except => :show
328 map.resources :custom_fields, :except => :show
326 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
329 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
327 map.resources :enumerations, :except => :show
330 map.resources :enumerations, :except => :show
328
331
329 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
332 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
330
333
331 map.connect 'mail_handler', :controller => 'mail_handler',
334 map.connect 'mail_handler', :controller => 'mail_handler',
332 :action => 'index', :conditions => {:method => :post}
335 :action => 'index', :conditions => {:method => :post}
333
336
334 map.connect 'admin', :controller => 'admin', :action => 'index',
337 map.connect 'admin', :controller => 'admin', :action => 'index',
335 :conditions => {:method => :get}
338 :conditions => {:method => :get}
336 map.connect 'admin/projects', :controller => 'admin', :action => 'projects',
339 map.connect 'admin/projects', :controller => 'admin', :action => 'projects',
337 :conditions => {:method => :get}
340 :conditions => {:method => :get}
338 map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins',
341 map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins',
339 :conditions => {:method => :get}
342 :conditions => {:method => :get}
340 map.connect 'admin/info', :controller => 'admin', :action => 'info',
343 map.connect 'admin/info', :controller => 'admin', :action => 'info',
341 :conditions => {:method => :get}
344 :conditions => {:method => :get}
342 map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email',
345 map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email',
343 :conditions => {:method => :get}
346 :conditions => {:method => :get}
344 map.connect 'admin/default_configuration', :controller => 'admin',
347 map.connect 'admin/default_configuration', :controller => 'admin',
345 :action => 'default_configuration', :conditions => {:method => :post}
348 :action => 'default_configuration', :conditions => {:method => :post}
346
349
347 # Used by AuthSourcesControllerTest
350 # Used by AuthSourcesControllerTest
348 # TODO : refactor *AuthSourcesController to remove these routes
351 # TODO : refactor *AuthSourcesController to remove these routes
349 map.connect 'auth_sources', :controller => 'auth_sources',
352 map.connect 'auth_sources', :controller => 'auth_sources',
350 :action => 'index', :conditions => {:method => :get}
353 :action => 'index', :conditions => {:method => :get}
351 map.connect 'auth_sources/new', :controller => 'auth_sources',
354 map.connect 'auth_sources/new', :controller => 'auth_sources',
352 :action => 'new', :conditions => {:method => :get}
355 :action => 'new', :conditions => {:method => :get}
353 map.connect 'auth_sources/create', :controller => 'auth_sources',
356 map.connect 'auth_sources/create', :controller => 'auth_sources',
354 :action => 'create', :conditions => {:method => :post}
357 :action => 'create', :conditions => {:method => :post}
355 map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources',
358 map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources',
356 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
359 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
357 map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources',
360 map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources',
358 :action => 'test_connection', :conditions => {:method => :get}
361 :action => 'test_connection', :conditions => {:method => :get}
359 map.connect 'auth_sources/edit/:id', :controller => 'auth_sources',
362 map.connect 'auth_sources/edit/:id', :controller => 'auth_sources',
360 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
363 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
361 map.connect 'auth_sources/update/:id', :controller => 'auth_sources',
364 map.connect 'auth_sources/update/:id', :controller => 'auth_sources',
362 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
365 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
363
366
364 map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources',
367 map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources',
365 :action => 'index', :conditions => {:method => :get}
368 :action => 'index', :conditions => {:method => :get}
366 map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources',
369 map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources',
367 :action => 'new', :conditions => {:method => :get}
370 :action => 'new', :conditions => {:method => :get}
368 map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources',
371 map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources',
369 :action => 'create', :conditions => {:method => :post}
372 :action => 'create', :conditions => {:method => :post}
370 map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources',
373 map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources',
371 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
374 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
372 map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources',
375 map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources',
373 :action => 'test_connection', :conditions => {:method => :get}
376 :action => 'test_connection', :conditions => {:method => :get}
374 map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources',
377 map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources',
375 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
378 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
376 map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources',
379 map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources',
377 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
380 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
378
381
379 map.connect 'workflows', :controller => 'workflows',
382 map.connect 'workflows', :controller => 'workflows',
380 :action => 'index', :conditions => {:method => :get}
383 :action => 'index', :conditions => {:method => :get}
381 map.connect 'workflows/edit', :controller => 'workflows',
384 map.connect 'workflows/edit', :controller => 'workflows',
382 :action => 'edit', :conditions => {:method => [:get, :post]}
385 :action => 'edit', :conditions => {:method => [:get, :post]}
383 map.connect 'workflows/copy', :controller => 'workflows',
386 map.connect 'workflows/copy', :controller => 'workflows',
384 :action => 'copy', :conditions => {:method => [:get, :post]}
387 :action => 'copy', :conditions => {:method => [:get, :post]}
385
388
386 map.connect 'settings', :controller => 'settings',
389 map.connect 'settings', :controller => 'settings',
387 :action => 'index', :conditions => {:method => :get}
390 :action => 'index', :conditions => {:method => :get}
388 map.connect 'settings/edit', :controller => 'settings',
391 map.connect 'settings/edit', :controller => 'settings',
389 :action => 'edit', :conditions => {:method => [:get, :post]}
392 :action => 'edit', :conditions => {:method => [:get, :post]}
390 map.connect 'settings/plugin/:id', :controller => 'settings',
393 map.connect 'settings/plugin/:id', :controller => 'settings',
391 :action => 'plugin', :conditions => {:method => [:get, :post]}
394 :action => 'plugin', :conditions => {:method => [:get, :post]}
392
395
393 map.with_options :controller => 'sys' do |sys|
396 map.with_options :controller => 'sys' do |sys|
394 sys.connect 'sys/projects.:format',
397 sys.connect 'sys/projects.:format',
395 :action => 'projects',
398 :action => 'projects',
396 :conditions => {:method => :get}
399 :conditions => {:method => :get}
397 sys.connect 'sys/projects/:id/repository.:format',
400 sys.connect 'sys/projects/:id/repository.:format',
398 :action => 'create_project_repository',
401 :action => 'create_project_repository',
399 :conditions => {:method => :post}
402 :conditions => {:method => :post}
400 sys.connect 'sys/fetch_changesets',
403 sys.connect 'sys/fetch_changesets',
401 :action => 'fetch_changesets',
404 :action => 'fetch_changesets',
402 :conditions => {:method => :get}
405 :conditions => {:method => :get}
403 end
406 end
404
407
405 map.connect 'robots.txt', :controller => 'welcome',
408 map.connect 'robots.txt', :controller => 'welcome',
406 :action => 'robots', :conditions => {:method => :get}
409 :action => 'robots', :conditions => {:method => :get}
407
410
408 # Used for OpenID
411 # Used for OpenID
409 map.root :controller => 'account', :action => 'login'
412 map.root :controller => 'account', :action => 'login'
410 end
413 end
General Comments 0
You need to be logged in to leave comments. Login now