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