##// END OF EJS Templates
Fixed: 'View difference' broken on wiki page history (#6747)....
Fixed: 'View difference' broken on wiki page history (#6747). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4372 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r4258:6f841b7f436e
r4258:6f841b7f436e
Show More
routes.rb
246 lines | 14.1 KiB | text/x-ruby | RubyLexer
Jean-Philippe Lang
Initial commit...
r2 ActionController::Routing::Routes.draw do |map|
# Add your own custom routes here.
# The priority is based upon order of creation: first created -> highest priority.
# Here's a sample route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
Jean-Philippe Lang
Added a named route for the home page....
r749 map.home '', :controller => 'welcome'
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315
Jean-Philippe Lang
The following menus can now be extended by plugins: top_menu, account_menu, application_menu (empty by default)....
r1123 map.signin 'login', :controller => 'account', :action => 'login'
map.signout 'logout', :controller => 'account', :action => 'logout'
Jean-Philippe Lang
Native eol property set on config/*...
r761 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
map.connect 'help/:ctrl/:page', :controller => 'help'
Eric Davis
Refactor: extract TimelogController#create from TimelogController#edit...
r4130
Eric Davis
Refactor: convert timelogs to a REST resource (:time_entries)...
r4136 map.connect 'projects/:project_id/time_entries/report', :controller => 'time_entry_reports', :action => 'report'
map.with_options :controller => 'time_entry_reports', :action => 'report',:conditions => {:method => :get} do |time_report|
time_report.connect 'time_entries/report'
time_report.connect 'time_entries/report.:format'
time_report.connect 'projects/:project_id/time_entries/report.:format'
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 end
Eric Davis
Refactor: convert timelogs to a REST resource (:time_entries)...
r4136
# TODO: wasteful since this is also nested under issues, projects, and projects/issues
map.resources :time_entries, :controller => 'timelog'
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315
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 => 'messages' do |messages_routes|
messages_routes.with_options :conditions => {:method => :get} do |messages_views|
messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
end
messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
end
end
map.with_options :controller => 'boards' do |board_routes|
board_routes.with_options :conditions => {:method => :get} do |board_views|
board_views.connect 'projects/:project_id/boards', :action => 'index'
board_views.connect 'projects/:project_id/boards/new', :action => 'new'
board_views.connect 'projects/:project_id/boards/:id', :action => 'show'
Jean-Philippe Lang
Adds single forum atom feed (#3181)....
r2590 board_views.connect 'projects/:project_id/boards/:id.:format', :action => 'show'
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit'
end
board_routes.with_options :conditions => {:method => :post} do |board_actions|
board_actions.connect 'projects/:project_id/boards', :action => 'new'
board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/
end
end
map.with_options :controller => 'documents' do |document_routes|
document_routes.with_options :conditions => {:method => :get} do |document_views|
document_views.connect 'projects/:project_id/documents', :action => 'index'
document_views.connect 'projects/:project_id/documents/new', :action => 'new'
document_views.connect 'documents/:id', :action => 'show'
document_views.connect 'documents/:id/edit', :action => 'edit'
end
document_routes.with_options :conditions => {:method => :post} do |document_actions|
document_actions.connect 'projects/:project_id/documents', :action => 'new'
document_actions.connect 'documents/:id/:action', :action => /destroy|edit/
end
end
Eric Davis
Refactor: Extract a new IssueMovesController from IssuesController....
r3822
map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move'
Eric Davis
Refactor: convert many of the custom Issue routes to REST resources....
r3927
# Misc issue routes. TODO: move into resources
Eric Davis
Refactor: move IssuesController#auto_complete to a new controller. #4382...
r3831 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues'
Eric Davis
Refactor: convert many of the custom Issue routes to REST resources....
r3927 map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview
Eric Davis
Refactor: move IssuesController#context_menu to a new controller....
r3892 map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues'
Eric Davis
Refactor: move IssuesController#changes to JournalsController#index....
r3920 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
Eric Davis
Refactor: convert many of the custom Issue routes to REST resources....
r3927 map.bulk_edit_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_edit', :conditions => { :method => :get }
map.bulk_update_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_update', :conditions => { :method => :post }
map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post }
map.connect '/issues/:id/destroy', :controller => 'issues', :action => 'destroy', :conditions => { :method => :post } # legacy
map.resource :gantt, :path_prefix => '/issues', :controller => 'gantts', :only => [:show, :update]
map.resource :gantt, :path_prefix => '/projects/:project_id/issues', :controller => 'gantts', :only => [:show, :update]
map.resource :calendar, :path_prefix => '/issues', :controller => 'calendars', :only => [:show, :update]
map.resource :calendar, :path_prefix => '/projects/:project_id/issues', :controller => 'calendars', :only => [:show, :update]
map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
reports.connect 'projects/:id/issues/report', :action => 'issue_report'
reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 end
Eric Davis
Refactor: Extract a new IssueMovesController from IssuesController....
r3822
Eric Davis
Refactor: convert many of the custom Issue routes to REST resources....
r3927 # Following two routes conflict with the resources because #index allows POST
map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
Eric Davis
Refactor: convert timelogs to a REST resource (:time_entries)...
r4136 map.resources :issues, :member => { :edit => :post }, :collection => {} do |issues|
issues.resources :time_entries, :controller => 'timelog'
end
map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post } do |issues|
issues.resources :time_entries, :controller => 'timelog'
end
Eric Davis
Refactor: convert many of the custom Issue routes to REST resources....
r3927
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations|
relations.connect 'issues/:issue_id/relations/:id', :action => 'new'
relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy'
end
Eric Davis
Refactor: move NewsController#add_comment to CommentsController#create...
r4056
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
Eric Davis
Refactor: convert UsersController to resource...
r4117
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 map.with_options :controller => 'users' do |users|
Eric Davis
Refactor: convert UsersController to resource...
r4117 users.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil, :conditions => {:method => :get}
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 users.with_options :conditions => {:method => :post} do |user_actions|
user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership'
user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership'
end
end
Eric Davis
Refactor: convert the Projects routes to resources....
r3957
Eric Davis
Refactor: convert UsersController to resource...
r4117 map.resources :users, :member => {
:edit_membership => :post,
:destroy_membership => :post
},
:except => [:destroy]
Eric Davis
Refactor: convert VersionsController to a REST resource....
r3983 # For nice "roadmap" in the url for the index action
map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
Eric Davis
Refactor: convert News to a REST resource...
r4100 map.all_news 'news', :controller => 'news', :action => 'index'
map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index'
map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post}
map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete}
Eric Davis
Refactor: convert the Projects routes to resources....
r3957 map.resources :projects, :member => {
:copy => [:get, :post],
:settings => :get,
:modules => :post,
:archive => :post,
:unarchive => :post
Eric Davis
Refactor: convert ProjectEnumerations to a resource on a project....
r3961 } do |project|
project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy]
Eric Davis
Refactor: convert FilesController to a restful resource....
r3971 project.resources :files, :only => [:index, :new, :create]
Eric Davis
Refactor: add VersionsController#status_by to the resource....
r3984 project.resources :versions, :collection => {:close_completed => :put}, :member => {:status_by => :post}
Eric Davis
Refactor: convert News to a REST resource...
r4100 project.resources :news, :shallow => true
Eric Davis
Refactor: convert timelogs to a REST resource (:time_entries)...
r4136 project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id'
Eric Davis
Refactor: convert WikiController to a REST resource...
r4189 project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
Jean-Philippe Lang
Fixed: 'View difference' broken on wiki page history (#6747)....
r4258 project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
Eric Davis
Refactor: convert WikiController to a REST resource...
r4189 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
}
Eric Davis
Refactor: convert ProjectEnumerations to a resource on a project....
r3961 end
Eric Davis
Refactor: convert the Projects routes to resources....
r3957
# Destroy uses a get request to prompt the user before the actual DELETE request
map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get}
# TODO: port to be part of the resources route(s)
map.with_options :controller => 'projects' do |project_mapper|
project_mapper.with_options :conditions => {:method => :get} do |project_views|
project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings'
Eric Davis
Refactor: convert many of the custom Issue routes to REST resources....
r3927 project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new'
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 end
end
Eric Davis
Refactor: convert the Projects routes to resources....
r3957 map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity|
activity.connect 'projects/:id/activity'
activity.connect 'projects/:id/activity.:format'
activity.connect 'activity', :id => nil
activity.connect 'activity.:format', :id => nil
end
Eric Davis
Refactor: convert VersionsController to a REST resource....
r3983
Eric Davis
Refactor: convert the Projects routes to resources....
r3957
Jean-Philippe Lang
Moves ProjectsController#add_issue_category to IssueCategoriesController#new....
r3435 map.with_options :controller => 'issue_categories' do |categories|
categories.connect 'projects/:project_id/issue_categories/new', :action => 'new'
end
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 map.with_options :controller => 'repositories' do |repositories|
repositories.with_options :conditions => {:method => :get} do |repository_views|
Jean-Philippe Lang
Fixing repository routes (#2967)....
r2513 repository_views.connect 'projects/:id/repository', :action => 'show'
repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
Jean-Philippe Lang
Use /raw/ for url instead of ?format=raw for getting raw repository files (#1901, #4119)....
r2960 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
Eric Davis
Added branch and tag support to the git repository viewer. (#1406)...
r2735 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
Jean-Philippe Lang
Use /raw/ for url instead of ?format=raw for getting raw repository files (#1901, #4119)....
r2960 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
# TODO: why the following route is required?
repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
Jean-Philippe Lang
Fixing repository routes (#2967)....
r2513 repository_views.connect 'projects/:id/repository/:action/*path'
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 end
Jean-Philippe Lang
Fixing routes broken by r2581 (#2967, #2970)....
r2522 repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post}
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 end
map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/
map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
Jean-Philippe Lang
User groups branch merged....
r2755 map.resources :groups
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 #left old routes at the bottom for backwards compat
Jean-Philippe Lang
ProjectsController#list_issues, #export_issues_csv and #export_issues_pdf merged into IssuesController#index...
r874 map.connect 'projects/:project_id/issues/:action', :controller => 'issues'
Jean-Philippe Lang
Moved ProjectsController#list_documents and add_document to DocumentsController#index and new....
r998 map.connect 'projects/:project_id/documents/:action', :controller => 'documents'
Jean-Philippe Lang
Per project forums added....
r526 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki'
map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations'
map.connect 'projects/:project_id/news/:action', :controller => 'news'
map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/
Jean-Philippe Lang
Pretty URL for the repository browser (Cyril Mougel)...
r867 map.with_options :controller => 'repositories' do |omap|
omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
Jean-Philippe Lang
Added Annotate/Blame view for Subversion, CVS and Mercurial repositories....
r934 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
Eric Davis
Converted routing and urls to follow the Rails REST convention....
r2315 omap.connect 'repositories/revision/:id/:rev', :action => 'revision'
Jean-Philippe Lang
Pretty URL for the repository browser (Cyril Mougel)...
r867 end
Jean-Philippe Lang
Replaces the repositories management SOAP API with a simple REST API....
r2374
map.with_options :controller => 'sys' do |sys|
sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get}
sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post}
end
Jean-Philippe Lang
Initial commit...
r2
# Install the default route as the lowest priority.
map.connect ':controller/:action/:id'
Jean-Philippe Lang
Replaces the obsolete robots.txt with a cached action (#2491)....
r2317 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots'
Eric Davis
Added the ability to login via OpenID....
r2381 # Used for OpenID
map.root :controller => 'account', :action => 'login'
Jean-Philippe Lang
Initial commit...
r2 end