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