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