summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-10-28 21:25:38 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-10-28 21:25:38 +0000
commitc514dd6885af45ebb38d00ba4a8c61b1ea206d2c (patch)
tree1427bc497e59c610fc4c622ff55ffbb8704c0142 /config
parente7e7a91b857408557b037932de69f03c4bc6c9aa (diff)
downloadredmine-c514dd6885af45ebb38d00ba4a8c61b1ea206d2c.tar.gz
redmine-c514dd6885af45ebb38d00ba4a8c61b1ea206d2c.zip
Refactor: convert WikiController to a REST resource
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4303 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb37
1 files changed, 15 insertions, 22 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 0fa76f235..b062aea94 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -27,27 +27,6 @@ ActionController::Routing::Routes.draw do |map|
map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get}
map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post}
- map.with_options :controller => 'wiki' do |wiki_routes|
- wiki_routes.with_options :conditions => {:method => :get} do |wiki_views|
- wiki_views.connect 'projects/:project_id/wiki/export', :action => 'export'
- wiki_views.connect 'projects/:project_id/wiki/index', :action => 'index'
- wiki_views.connect 'projects/:project_id/wiki/date_index', :action => 'date_index'
- wiki_views.connect 'projects/:project_id/wiki/:id', :action => 'show', :id => nil
- wiki_views.connect 'projects/:project_id/wiki/:id/edit', :action => 'edit'
- wiki_views.connect 'projects/:project_id/wiki/:id/rename', :action => 'rename'
- wiki_views.connect 'projects/:project_id/wiki/:id/history', :action => 'history'
- wiki_views.connect 'projects/:project_id/wiki/:id/diff/:version/vs/:version_from', :action => 'diff'
- wiki_views.connect 'projects/:project_id/wiki/:id/annotate/:version', :action => 'annotate'
- end
-
- wiki_routes.connect 'projects/:project_id/wiki/:id/:action',
- :action => /rename|preview|protect|add_attachment/,
- :conditions => {:method => :post}
-
- wiki_routes.connect 'projects/:project_id/wiki/:id/edit', :action => 'update', :conditions => {:method => :post}
-
- wiki_routes.connect 'projects/:project_id/wiki/:id', :action => 'destroy', :conditions => {:method => :delete}
- end
map.with_options :controller => 'messages' do |messages_routes|
messages_routes.with_options :conditions => {:method => :get} do |messages_views|
@@ -168,7 +147,21 @@ ActionController::Routing::Routes.draw do |map|
project.resources :news, :shallow => true
project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id'
-
+ project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
+ project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
+ project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
+ project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
+ project.resources :wiki, :except => [:new, :create], :member => {
+ :rename => [:get, :post],
+ :history => :get,
+ :preview => :any,
+ :protect => :post,
+ :add_attachment => :post
+ }, :collection => {
+ :export => :get,
+ :date_index => :get
+ }
+
end
# Destroy uses a get request to prompt the user before the actual DELETE request