Mercurial > hg > soundsoftware-site
comparison config/.svn/text-base/routes.rb.svn-base @ 0:513646585e45
* Import Redmine trunk SVN rev 3859
author | Chris Cannam |
---|---|
date | Fri, 23 Jul 2010 15:52:44 +0100 |
parents | |
children | 1d32c0a0efbf |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:513646585e45 |
---|---|
1 ActionController::Routing::Routes.draw do |map| | |
2 # Add your own custom routes here. | |
3 # The priority is based upon order of creation: first created -> highest priority. | |
4 | |
5 # Here's a sample route: | |
6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view' | |
7 # Keep in mind you can assign values other than :controller and :action | |
8 | |
9 map.home '', :controller => 'welcome' | |
10 | |
11 map.signin 'login', :controller => 'account', :action => 'login' | |
12 map.signout 'logout', :controller => 'account', :action => 'logout' | |
13 | |
14 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' | |
15 map.connect 'help/:ctrl/:page', :controller => 'help' | |
16 | |
17 map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog' | |
18 map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog' | |
19 map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog' | |
20 | |
21 map.with_options :controller => 'timelog' do |timelog| | |
22 timelog.connect 'projects/:project_id/time_entries', :action => 'details' | |
23 | |
24 timelog.with_options :action => 'details', :conditions => {:method => :get} do |time_details| | |
25 time_details.connect 'time_entries' | |
26 time_details.connect 'time_entries.:format' | |
27 time_details.connect 'issues/:issue_id/time_entries' | |
28 time_details.connect 'issues/:issue_id/time_entries.:format' | |
29 time_details.connect 'projects/:project_id/time_entries.:format' | |
30 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries' | |
31 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries.:format' | |
32 end | |
33 timelog.connect 'projects/:project_id/time_entries/report', :action => 'report' | |
34 timelog.with_options :action => 'report',:conditions => {:method => :get} do |time_report| | |
35 time_report.connect 'time_entries/report' | |
36 time_report.connect 'time_entries/report.:format' | |
37 time_report.connect 'projects/:project_id/time_entries/report.:format' | |
38 end | |
39 | |
40 timelog.with_options :action => 'edit', :conditions => {:method => :get} do |time_edit| | |
41 time_edit.connect 'issues/:issue_id/time_entries/new' | |
42 end | |
43 | |
44 timelog.connect 'time_entries/:id/destroy', :action => 'destroy', :conditions => {:method => :post} | |
45 end | |
46 | |
47 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} | |
48 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get} | |
49 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post} | |
50 map.with_options :controller => 'wiki' do |wiki_routes| | |
51 wiki_routes.with_options :conditions => {:method => :get} do |wiki_views| | |
52 wiki_views.connect 'projects/:id/wiki/:page', :action => 'special', :page => /page_index|date_index|export/i | |
53 wiki_views.connect 'projects/:id/wiki/:page', :action => 'index', :page => nil | |
54 wiki_views.connect 'projects/:id/wiki/:page/edit', :action => 'edit' | |
55 wiki_views.connect 'projects/:id/wiki/:page/rename', :action => 'rename' | |
56 wiki_views.connect 'projects/:id/wiki/:page/history', :action => 'history' | |
57 wiki_views.connect 'projects/:id/wiki/:page/diff/:version/vs/:version_from', :action => 'diff' | |
58 wiki_views.connect 'projects/:id/wiki/:page/annotate/:version', :action => 'annotate' | |
59 end | |
60 | |
61 wiki_routes.connect 'projects/:id/wiki/:page/:action', | |
62 :action => /edit|rename|destroy|preview|protect/, | |
63 :conditions => {:method => :post} | |
64 end | |
65 | |
66 map.with_options :controller => 'messages' do |messages_routes| | |
67 messages_routes.with_options :conditions => {:method => :get} do |messages_views| | |
68 messages_views.connect 'boards/:board_id/topics/new', :action => 'new' | |
69 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' | |
70 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' | |
71 end | |
72 messages_routes.with_options :conditions => {:method => :post} do |messages_actions| | |
73 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new' | |
74 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply' | |
75 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/ | |
76 end | |
77 end | |
78 | |
79 map.with_options :controller => 'boards' do |board_routes| | |
80 board_routes.with_options :conditions => {:method => :get} do |board_views| | |
81 board_views.connect 'projects/:project_id/boards', :action => 'index' | |
82 board_views.connect 'projects/:project_id/boards/new', :action => 'new' | |
83 board_views.connect 'projects/:project_id/boards/:id', :action => 'show' | |
84 board_views.connect 'projects/:project_id/boards/:id.:format', :action => 'show' | |
85 board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit' | |
86 end | |
87 board_routes.with_options :conditions => {:method => :post} do |board_actions| | |
88 board_actions.connect 'projects/:project_id/boards', :action => 'new' | |
89 board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/ | |
90 end | |
91 end | |
92 | |
93 map.with_options :controller => 'documents' do |document_routes| | |
94 document_routes.with_options :conditions => {:method => :get} do |document_views| | |
95 document_views.connect 'projects/:project_id/documents', :action => 'index' | |
96 document_views.connect 'projects/:project_id/documents/new', :action => 'new' | |
97 document_views.connect 'documents/:id', :action => 'show' | |
98 document_views.connect 'documents/:id/edit', :action => 'edit' | |
99 end | |
100 document_routes.with_options :conditions => {:method => :post} do |document_actions| | |
101 document_actions.connect 'projects/:project_id/documents', :action => 'new' | |
102 document_actions.connect 'documents/:id/:action', :action => /destroy|edit/ | |
103 end | |
104 end | |
105 | |
106 map.with_options :controller => 'issues' do |issues_routes| | |
107 issues_routes.with_options :conditions => {:method => :get} do |issues_views| | |
108 issues_views.connect 'issues', :action => 'index' | |
109 issues_views.connect 'issues.:format', :action => 'index' | |
110 issues_views.connect 'projects/:project_id/issues', :action => 'index' | |
111 issues_views.connect 'projects/:project_id/issues.:format', :action => 'index' | |
112 issues_views.connect 'projects/:project_id/issues/new', :action => 'new' | |
113 issues_views.connect 'projects/:project_id/issues/gantt', :controller => 'gantts', :action => 'show' | |
114 issues_views.connect 'projects/:project_id/issues/calendar', :controller => 'calendars', :action => 'show' | |
115 issues_views.connect 'projects/:project_id/issues/:copy_from/copy', :action => 'new' | |
116 issues_views.connect 'issues/:id', :action => 'show', :id => /\d+/ | |
117 issues_views.connect 'issues/:id.:format', :action => 'show', :id => /\d+/ | |
118 issues_views.connect 'issues/:id/edit', :action => 'edit', :id => /\d+/ | |
119 issues_views.connect 'issues/:id/move', :action => 'move', :id => /\d+/ | |
120 end | |
121 issues_routes.with_options :conditions => {:method => :post} do |issues_actions| | |
122 issues_actions.connect 'issues', :action => 'index' | |
123 issues_actions.connect 'projects/:project_id/issues', :action => 'create' | |
124 issues_actions.connect 'projects/:project_id/issues/gantt', :controller => 'gantts', :action => 'show' | |
125 issues_actions.connect 'projects/:project_id/issues/calendar', :controller => 'calendars', :action => 'show' | |
126 issues_actions.connect 'issues/:id/quoted', :action => 'reply', :id => /\d+/ | |
127 issues_actions.connect 'issues/:id/:action', :action => /edit|move|destroy/, :id => /\d+/ | |
128 issues_actions.connect 'issues.:format', :action => 'create', :format => /xml/ | |
129 end | |
130 issues_routes.with_options :conditions => {:method => :put} do |issues_actions| | |
131 issues_actions.connect 'issues/:id/edit', :action => 'update', :id => /\d+/ | |
132 issues_actions.connect 'issues/:id.:format', :action => 'update', :id => /\d+/, :format => /xml/ | |
133 end | |
134 issues_routes.with_options :conditions => {:method => :delete} do |issues_actions| | |
135 issues_actions.connect 'issues/:id.:format', :action => 'destroy', :id => /\d+/, :format => /xml/ | |
136 end | |
137 issues_routes.connect 'issues/gantt', :controller => 'gantts', :action => 'show' | |
138 issues_routes.connect 'issues/calendar', :controller => 'calendars', :action => 'show' | |
139 issues_routes.connect 'issues/:action' | |
140 end | |
141 | |
142 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations| | |
143 relations.connect 'issues/:issue_id/relations/:id', :action => 'new' | |
144 relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy' | |
145 end | |
146 | |
147 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports| | |
148 reports.connect 'projects/:id/issues/report', :action => 'issue_report' | |
149 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details' | |
150 end | |
151 | |
152 map.with_options :controller => 'news' do |news_routes| | |
153 news_routes.with_options :conditions => {:method => :get} do |news_views| | |
154 news_views.connect 'news', :action => 'index' | |
155 news_views.connect 'projects/:project_id/news', :action => 'index' | |
156 news_views.connect 'projects/:project_id/news.:format', :action => 'index' | |
157 news_views.connect 'news.:format', :action => 'index' | |
158 news_views.connect 'projects/:project_id/news/new', :action => 'new' | |
159 news_views.connect 'news/:id', :action => 'show' | |
160 news_views.connect 'news/:id/edit', :action => 'edit' | |
161 end | |
162 news_routes.with_options do |news_actions| | |
163 news_actions.connect 'projects/:project_id/news', :action => 'new' | |
164 news_actions.connect 'news/:id/edit', :action => 'edit' | |
165 news_actions.connect 'news/:id/destroy', :action => 'destroy' | |
166 end | |
167 end | |
168 | |
169 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new' | |
170 | |
171 map.with_options :controller => 'users' do |users| | |
172 users.with_options :conditions => {:method => :get} do |user_views| | |
173 user_views.connect 'users', :action => 'index' | |
174 user_views.connect 'users/:id', :action => 'show', :id => /\d+/ | |
175 user_views.connect 'users/new', :action => 'add' | |
176 user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil | |
177 end | |
178 users.with_options :conditions => {:method => :post} do |user_actions| | |
179 user_actions.connect 'users', :action => 'add' | |
180 user_actions.connect 'users/new', :action => 'add' | |
181 user_actions.connect 'users/:id/edit', :action => 'edit' | |
182 user_actions.connect 'users/:id/memberships', :action => 'edit_membership' | |
183 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership' | |
184 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership' | |
185 end | |
186 end | |
187 | |
188 map.with_options :controller => 'projects' do |projects| | |
189 projects.with_options :conditions => {:method => :get} do |project_views| | |
190 project_views.connect 'projects', :action => 'index' | |
191 project_views.connect 'projects.:format', :action => 'index' | |
192 project_views.connect 'projects/new', :action => 'add' | |
193 project_views.connect 'projects/:id', :action => 'show' | |
194 project_views.connect 'projects/:id.:format', :action => 'show' | |
195 project_views.connect 'projects/:id/:action', :action => /roadmap|destroy|settings/ | |
196 project_views.connect 'projects/:id/files', :action => 'list_files' | |
197 project_views.connect 'projects/:id/files/new', :action => 'add_file' | |
198 project_views.connect 'projects/:id/settings/:tab', :action => 'settings' | |
199 end | |
200 | |
201 projects.with_options :action => 'activity', :conditions => {:method => :get} do |activity| | |
202 activity.connect 'projects/:id/activity' | |
203 activity.connect 'projects/:id/activity.:format' | |
204 activity.connect 'activity', :id => nil | |
205 activity.connect 'activity.:format', :id => nil | |
206 end | |
207 | |
208 projects.with_options :conditions => {:method => :post} do |project_actions| | |
209 project_actions.connect 'projects/new', :action => 'add' | |
210 project_actions.connect 'projects', :action => 'add' | |
211 project_actions.connect 'projects.:format', :action => 'add', :format => /xml/ | |
212 project_actions.connect 'projects/:id/:action', :action => /edit|destroy|archive|unarchive/ | |
213 project_actions.connect 'projects/:id/files/new', :action => 'add_file' | |
214 project_actions.connect 'projects/:id/activities/save', :action => 'save_activities' | |
215 end | |
216 | |
217 projects.with_options :conditions => {:method => :put} do |project_actions| | |
218 project_actions.conditions 'projects/:id.:format', :action => 'edit', :format => /xml/ | |
219 end | |
220 | |
221 projects.with_options :conditions => {:method => :delete} do |project_actions| | |
222 project_actions.conditions 'projects/:id.:format', :action => 'destroy', :format => /xml/ | |
223 project_actions.conditions 'projects/:id/reset_activities', :action => 'reset_activities' | |
224 end | |
225 end | |
226 | |
227 map.with_options :controller => 'versions' do |versions| | |
228 versions.connect 'projects/:project_id/versions/new', :action => 'new' | |
229 versions.with_options :conditions => {:method => :post} do |version_actions| | |
230 version_actions.connect 'projects/:project_id/versions/close_completed', :action => 'close_completed' | |
231 end | |
232 end | |
233 | |
234 map.with_options :controller => 'issue_categories' do |categories| | |
235 categories.connect 'projects/:project_id/issue_categories/new', :action => 'new' | |
236 end | |
237 | |
238 map.with_options :controller => 'repositories' do |repositories| | |
239 repositories.with_options :conditions => {:method => :get} do |repository_views| | |
240 repository_views.connect 'projects/:id/repository', :action => 'show' | |
241 repository_views.connect 'projects/:id/repository/edit', :action => 'edit' | |
242 repository_views.connect 'projects/:id/repository/statistics', :action => 'stats' | |
243 repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions' | |
244 repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions' | |
245 repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' | |
246 repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' | |
247 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' | |
248 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ } | |
249 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } | |
250 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw' | |
251 # TODO: why the following route is required? | |
252 repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry' | |
253 repository_views.connect 'projects/:id/repository/:action/*path' | |
254 end | |
255 | |
256 repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post} | |
257 end | |
258 | |
259 map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/ | |
260 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/ | |
261 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/ | |
262 | |
263 map.resources :groups | |
264 | |
265 #left old routes at the bottom for backwards compat | |
266 map.connect 'projects/:project_id/issues/:action', :controller => 'issues' | |
267 map.connect 'projects/:project_id/documents/:action', :controller => 'documents' | |
268 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards' | |
269 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages' | |
270 map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki' | |
271 map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations' | |
272 map.connect 'projects/:project_id/news/:action', :controller => 'news' | |
273 map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/ | |
274 map.with_options :controller => 'repositories' do |omap| | |
275 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse' | |
276 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes' | |
277 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff' | |
278 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry' | |
279 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate' | |
280 omap.connect 'repositories/revision/:id/:rev', :action => 'revision' | |
281 end | |
282 | |
283 map.with_options :controller => 'sys' do |sys| | |
284 sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get} | |
285 sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post} | |
286 end | |
287 | |
288 # Install the default route as the lowest priority. | |
289 map.connect ':controller/:action/:id' | |
290 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots' | |
291 # Used for OpenID | |
292 map.root :controller => 'account', :action => 'login' | |
293 end |