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