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