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