comparison config/.svn/text-base/routes.rb.svn-base @ 37:94944d00e43c

* Update to SVN trunk rev 4411
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 19 Nov 2010 13:24:41 +0000
parents 40f7cfd4df19
children 07fa8a8b56a8
comparison
equal deleted inserted replaced
22:40f7cfd4df19 37:94944d00e43c
11 map.signin 'login', :controller => 'account', :action => 'login' 11 map.signin 'login', :controller => 'account', :action => 'login'
12 map.signout 'logout', :controller => 'account', :action => 'logout' 12 map.signout 'logout', :controller => 'account', :action => 'logout'
13 13
14 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' 14 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
15 map.connect 'help/:ctrl/:page', :controller => 'help' 15 map.connect 'help/:ctrl/:page', :controller => 'help'
16 16
17 map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog' 17 map.connect 'projects/:project_id/time_entries/report', :controller => 'time_entry_reports', :action => 'report'
18 map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog' 18 map.with_options :controller => 'time_entry_reports', :action => 'report',:conditions => {:method => :get} do |time_report|
19 map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog' 19 time_report.connect 'time_entries/report'
20 20 time_report.connect 'time_entries/report.:format'
21 map.with_options :controller => 'timelog' do |timelog| 21 time_report.connect 'projects/:project_id/time_entries/report.:format'
22 timelog.connect 'projects/:project_id/time_entries', :action => 'details' 22 end
23 23
24 timelog.with_options :action => 'details', :conditions => {:method => :get} do |time_details| 24 # TODO: wasteful since this is also nested under issues, projects, and projects/issues
25 time_details.connect 'time_entries' 25 map.resources :time_entries, :controller => 'timelog'
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 26
47 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} 27 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} 28 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} 29 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 30
66 map.with_options :controller => 'messages' do |messages_routes| 31 map.with_options :controller => 'messages' do |messages_routes|
67 messages_routes.with_options :conditions => {:method => :get} do |messages_views| 32 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
68 messages_views.connect 'boards/:board_id/topics/new', :action => 'new' 33 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
69 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' 34 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
127 92
128 # Following two routes conflict with the resources because #index allows POST 93 # Following two routes conflict with the resources because #index allows POST
129 map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post } 94 map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
130 map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post } 95 map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
131 96
132 map.resources :issues, :member => { :edit => :post }, :collection => {} 97 map.resources :issues, :member => { :edit => :post }, :collection => {} do |issues|
133 map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post } 98 issues.resources :time_entries, :controller => 'timelog'
99 end
100
101 map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post } do |issues|
102 issues.resources :time_entries, :controller => 'timelog'
103 end
134 104
135 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations| 105 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations|
136 relations.connect 'issues/:issue_id/relations/:id', :action => 'new' 106 relations.connect 'issues/:issue_id/relations/:id', :action => 'new'
137 relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy' 107 relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy'
138 end 108 end
139 109
140 map.with_options :controller => 'news' do |news_routes|
141 news_routes.with_options :conditions => {:method => :get} do |news_views|
142 news_views.connect 'news', :action => 'index'
143 news_views.connect 'projects/:project_id/news', :action => 'index'
144 news_views.connect 'projects/:project_id/news.:format', :action => 'index'
145 news_views.connect 'news.:format', :action => 'index'
146 news_views.connect 'projects/:project_id/news/new', :action => 'new'
147 news_views.connect 'news/:id', :action => 'show'
148 news_views.connect 'news/:id/edit', :action => 'edit'
149 end
150 news_routes.with_options do |news_actions|
151 news_actions.connect 'projects/:project_id/news', :action => 'create', :conditions => {:method => :post}
152 news_actions.connect 'news/:id/destroy', :action => 'destroy'
153 end
154 news_routes.connect 'news/:id/edit', :action => 'update', :conditions => {:method => :put}
155
156 news_routes.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post}
157 news_routes.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete}
158 end
159
160 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new' 110 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
161 111
162 map.with_options :controller => 'users' do |users| 112 map.with_options :controller => 'users' do |users|
163 users.with_options :conditions => {:method => :get} do |user_views| 113 users.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil, :conditions => {:method => :get}
164 user_views.connect 'users', :action => 'index' 114
165 user_views.connect 'users/:id', :action => 'show', :id => /\d+/
166 user_views.connect 'users/new', :action => 'add'
167 user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil
168 end
169 users.with_options :conditions => {:method => :post} do |user_actions| 115 users.with_options :conditions => {:method => :post} do |user_actions|
170 user_actions.connect 'users', :action => 'add'
171 user_actions.connect 'users/new', :action => 'add'
172 user_actions.connect 'users/:id/edit', :action => 'edit'
173 user_actions.connect 'users/:id/memberships', :action => 'edit_membership' 116 user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
174 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership' 117 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership'
175 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership' 118 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership'
176 end 119 end
177 end 120 end
178 121
122 map.resources :users, :member => {
123 :edit_membership => :post,
124 :destroy_membership => :post
125 },
126 :except => [:destroy]
127
179 # For nice "roadmap" in the url for the index action 128 # For nice "roadmap" in the url for the index action
180 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index' 129 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
130
131 map.all_news 'news', :controller => 'news', :action => 'index'
132 map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index'
133 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
134 map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post}
135 map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete}
181 136
182 map.resources :projects, :member => { 137 map.resources :projects, :member => {
183 :copy => [:get, :post], 138 :copy => [:get, :post],
184 :settings => :get, 139 :settings => :get,
185 :modules => :post, 140 :modules => :post,
187 :unarchive => :post 142 :unarchive => :post
188 } do |project| 143 } do |project|
189 project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy] 144 project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy]
190 project.resources :files, :only => [:index, :new, :create] 145 project.resources :files, :only => [:index, :new, :create]
191 project.resources :versions, :collection => {:close_completed => :put}, :member => {:status_by => :post} 146 project.resources :versions, :collection => {:close_completed => :put}, :member => {:status_by => :post}
147 project.resources :news, :shallow => true
148 project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id'
149
150 project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
151 project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
152 project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
153 project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
154 project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
155 project.resources :wiki, :except => [:new, :create], :member => {
156 :rename => [:get, :post],
157 :history => :get,
158 :preview => :any,
159 :protect => :post,
160 :add_attachment => :post
161 }, :collection => {
162 :export => :get,
163 :date_index => :get
164 }
165
192 end 166 end
193 167
194 # Destroy uses a get request to prompt the user before the actual DELETE request 168 # Destroy uses a get request to prompt the user before the actual DELETE request
195 map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get} 169 map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get}
196 170