annotate .svn/pristine/05/0548f38a902595a77747491d864f451fe12f0f47.svn-base @ 1296:038ba2d95de8 redmine-2.2

Fix redmine-2.2 branch update (add missing svn files)
author Chris Cannam
date Fri, 14 Jun 2013 09:05:06 +0100
parents
children
rev   line source
Chris@1296 1 # Redmine - project management software
Chris@1296 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
Chris@1296 3 #
Chris@1296 4 # This program is free software; you can redistribute it and/or
Chris@1296 5 # modify it under the terms of the GNU General Public License
Chris@1296 6 # as published by the Free Software Foundation; either version 2
Chris@1296 7 # of the License, or (at your option) any later version.
Chris@1296 8 #
Chris@1296 9 # This program is distributed in the hope that it will be useful,
Chris@1296 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@1296 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@1296 12 # GNU General Public License for more details.
Chris@1296 13 #
Chris@1296 14 # You should have received a copy of the GNU General Public License
Chris@1296 15 # along with this program; if not, write to the Free Software
Chris@1296 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@1296 17
Chris@1296 18 RedmineApp::Application.routes.draw do
Chris@1296 19 root :to => 'welcome#index', :as => 'home'
Chris@1296 20
Chris@1296 21 match 'login', :to => 'account#login', :as => 'signin'
Chris@1296 22 match 'logout', :to => 'account#logout', :as => 'signout'
Chris@1296 23 match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register'
Chris@1296 24 match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password'
Chris@1296 25 match 'account/activate', :to => 'account#activate', :via => :get
Chris@1296 26
Chris@1296 27 match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news'
Chris@1296 28 match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue'
Chris@1296 29 match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue'
Chris@1296 30 match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue'
Chris@1296 31
Chris@1296 32 match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
Chris@1296 33 match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
Chris@1296 34
Chris@1296 35 match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post]
Chris@1296 36 get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
Chris@1296 37 match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
Chris@1296 38 get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
Chris@1296 39
Chris@1296 40 post 'boards/:board_id/topics/preview', :to => 'messages#preview'
Chris@1296 41 post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
Chris@1296 42 post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
Chris@1296 43 post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
Chris@1296 44
Chris@1296 45 # Misc issue routes. TODO: move into resources
Chris@1296 46 match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
Chris@1296 47 match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu'
Chris@1296 48 match '/issues/changes', :to => 'journals#index', :as => 'issue_changes'
Chris@1296 49 match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
Chris@1296 50
Chris@1296 51 match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get
Chris@1296 52 match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post]
Chris@1296 53
Chris@1296 54 match '/projects/:project_id/issues/gantt', :to => 'gantts#show'
Chris@1296 55 match '/issues/gantt', :to => 'gantts#show'
Chris@1296 56
Chris@1296 57 match '/projects/:project_id/issues/calendar', :to => 'calendars#show'
Chris@1296 58 match '/issues/calendar', :to => 'calendars#show'
Chris@1296 59
Chris@1296 60 match 'projects/:id/issues/report', :to => 'reports#issue_report', :via => :get
Chris@1296 61 match 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :via => :get
Chris@1296 62
Chris@1296 63 match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
Chris@1296 64 match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
Chris@1296 65 match 'my/page', :controller => 'my', :action => 'page', :via => :get
Chris@1296 66 match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
Chris@1296 67 match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post
Chris@1296 68 match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post
Chris@1296 69 match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
Chris@1296 70 match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
Chris@1296 71 match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
Chris@1296 72 match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
Chris@1296 73 match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
Chris@1296 74
Chris@1296 75 resources :users
Chris@1296 76 match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership'
Chris@1296 77 match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete
Chris@1296 78 match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships'
Chris@1296 79
Chris@1296 80 match 'watchers/new', :controller=> 'watchers', :action => 'new', :via => :get
Chris@1296 81 match 'watchers', :controller=> 'watchers', :action => 'create', :via => :post
Chris@1296 82 match 'watchers/append', :controller=> 'watchers', :action => 'append', :via => :post
Chris@1296 83 match 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :via => :post
Chris@1296 84 match 'watchers/watch', :controller=> 'watchers', :action => 'watch', :via => :post
Chris@1296 85 match 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :via => :post
Chris@1296 86 match 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user', :via => :get
Chris@1296 87
Chris@1296 88 match 'projects/:id/settings/:tab', :to => "projects#settings"
Chris@1296 89
Chris@1296 90 resources :projects do
Chris@1296 91 member do
Chris@1296 92 get 'settings'
Chris@1296 93 post 'modules'
Chris@1296 94 post 'archive'
Chris@1296 95 post 'unarchive'
Chris@1296 96 post 'close'
Chris@1296 97 post 'reopen'
Chris@1296 98 match 'copy', :via => [:get, :post]
Chris@1296 99 end
Chris@1296 100
Chris@1296 101 resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
Chris@1296 102 collection do
Chris@1296 103 get 'autocomplete'
Chris@1296 104 end
Chris@1296 105 end
Chris@1296 106
Chris@1296 107 resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
Chris@1296 108
Chris@1296 109 match 'issues/:copy_from/copy', :to => 'issues#new'
Chris@1296 110 resources :issues, :only => [:index, :new, :create] do
Chris@1296 111 resources :time_entries, :controller => 'timelog' do
Chris@1296 112 collection do
Chris@1296 113 get 'report'
Chris@1296 114 end
Chris@1296 115 end
Chris@1296 116 end
Chris@1296 117 # issue form update
Chris@1296 118 match 'issues/new', :controller => 'issues', :action => 'new', :via => [:put, :post], :as => 'issue_form'
Chris@1296 119
Chris@1296 120 resources :files, :only => [:index, :new, :create]
Chris@1296 121
Chris@1296 122 resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
Chris@1296 123 collection do
Chris@1296 124 put 'close_completed'
Chris@1296 125 end
Chris@1296 126 end
Chris@1296 127 match 'versions.:format', :to => 'versions#index'
Chris@1296 128 match 'roadmap', :to => 'versions#index', :format => false
Chris@1296 129 match 'versions', :to => 'versions#index'
Chris@1296 130
Chris@1296 131 resources :news, :except => [:show, :edit, :update, :destroy]
Chris@1296 132 resources :time_entries, :controller => 'timelog' do
Chris@1296 133 get 'report', :on => :collection
Chris@1296 134 end
Chris@1296 135 resources :queries, :only => [:new, :create]
Chris@1296 136 resources :issue_categories, :shallow => true
Chris@1296 137 resources :documents, :except => [:show, :edit, :update, :destroy]
Chris@1296 138 resources :boards
Chris@1296 139 resources :repositories, :shallow => true, :except => [:index, :show] do
Chris@1296 140 member do
Chris@1296 141 match 'committers', :via => [:get, :post]
Chris@1296 142 end
Chris@1296 143 end
Chris@1296 144
Chris@1296 145 match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
Chris@1296 146 resources :wiki, :except => [:index, :new, :create] do
Chris@1296 147 member do
Chris@1296 148 get 'rename'
Chris@1296 149 post 'rename'
Chris@1296 150 get 'history'
Chris@1296 151 get 'diff'
Chris@1296 152 match 'preview', :via => [:post, :put]
Chris@1296 153 post 'protect'
Chris@1296 154 post 'add_attachment'
Chris@1296 155 end
Chris@1296 156 collection do
Chris@1296 157 get 'export'
Chris@1296 158 get 'date_index'
Chris@1296 159 end
Chris@1296 160 end
Chris@1296 161 match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
Chris@1296 162 get 'wiki/:id/:version', :to => 'wiki#show'
Chris@1296 163 delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
Chris@1296 164 get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
Chris@1296 165 get 'wiki/:id/:version/diff', :to => 'wiki#diff'
Chris@1296 166 end
Chris@1296 167
Chris@1296 168 resources :issues do
Chris@1296 169 collection do
Chris@1296 170 match 'bulk_edit', :via => [:get, :post]
Chris@1296 171 post 'bulk_update'
Chris@1296 172 end
Chris@1296 173 resources :time_entries, :controller => 'timelog' do
Chris@1296 174 collection do
Chris@1296 175 get 'report'
Chris@1296 176 end
Chris@1296 177 end
Chris@1296 178 resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
Chris@1296 179 end
Chris@1296 180 match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
Chris@1296 181
Chris@1296 182 resources :queries, :except => [:show]
Chris@1296 183
Chris@1296 184 resources :news, :only => [:index, :show, :edit, :update, :destroy]
Chris@1296 185 match '/news/:id/comments', :to => 'comments#create', :via => :post
Chris@1296 186 match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
Chris@1296 187
Chris@1296 188 resources :versions, :only => [:show, :edit, :update, :destroy] do
Chris@1296 189 post 'status_by', :on => :member
Chris@1296 190 end
Chris@1296 191
Chris@1296 192 resources :documents, :only => [:show, :edit, :update, :destroy] do
Chris@1296 193 post 'add_attachment', :on => :member
Chris@1296 194 end
Chris@1296 195
Chris@1296 196 match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu
Chris@1296 197
Chris@1296 198 resources :time_entries, :controller => 'timelog', :except => :destroy do
Chris@1296 199 collection do
Chris@1296 200 get 'report'
Chris@1296 201 get 'bulk_edit'
Chris@1296 202 post 'bulk_update'
Chris@1296 203 end
Chris@1296 204 end
Chris@1296 205 match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
Chris@1296 206 # TODO: delete /time_entries for bulk deletion
Chris@1296 207 match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
Chris@1296 208
Chris@1296 209 # TODO: port to be part of the resources route(s)
Chris@1296 210 match 'projects/:id/settings/:tab', :to => 'projects#settings', :via => :get
Chris@1296 211
Chris@1296 212 get 'projects/:id/activity', :to => 'activities#index'
Chris@1296 213 get 'projects/:id/activity.:format', :to => 'activities#index'
Chris@1296 214 get 'activity', :to => 'activities#index'
Chris@1296 215
Chris@1296 216 # repositories routes
Chris@1296 217 get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
Chris@1296 218 get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
Chris@1296 219
Chris@1296 220 get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))',
Chris@1296 221 :to => 'repositories#changes'
Chris@1296 222
Chris@1296 223 get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
Chris@1296 224 get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
Chris@1296 225 post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
Chris@1296 226 delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
Chris@1296 227 get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
Chris@1296 228 get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))',
Chris@1296 229 :controller => 'repositories',
Chris@1296 230 :format => false,
Chris@1296 231 :constraints => {
Chris@1296 232 :action => /(browse|show|entry|raw|annotate|diff)/,
Chris@1296 233 :rev => /[a-z0-9\.\-_]+/
Chris@1296 234 }
Chris@1296 235
Chris@1296 236 get 'projects/:id/repository/statistics', :to => 'repositories#stats'
Chris@1296 237 get 'projects/:id/repository/graph', :to => 'repositories#graph'
Chris@1296 238
Chris@1296 239 get 'projects/:id/repository/changes(/*path(.:ext))',
Chris@1296 240 :to => 'repositories#changes'
Chris@1296 241
Chris@1296 242 get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
Chris@1296 243 get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
Chris@1296 244 get 'projects/:id/repository/revision', :to => 'repositories#revision'
Chris@1296 245 post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
Chris@1296 246 delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
Chris@1296 247 get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))',
Chris@1296 248 :controller => 'repositories',
Chris@1296 249 :format => false,
Chris@1296 250 :constraints => {
Chris@1296 251 :action => /(browse|show|entry|raw|annotate|diff)/,
Chris@1296 252 :rev => /[a-z0-9\.\-_]+/
Chris@1296 253 }
Chris@1296 254 get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
Chris@1296 255 :controller => 'repositories',
Chris@1296 256 :action => /(browse|show|entry|raw|changes|annotate|diff)/
Chris@1296 257 get 'projects/:id/repository/:action(/*path(.:ext))',
Chris@1296 258 :controller => 'repositories',
Chris@1296 259 :action => /(browse|show|entry|raw|changes|annotate|diff)/
Chris@1296 260
Chris@1296 261 get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
Chris@1296 262 get 'projects/:id/repository', :to => 'repositories#show', :path => nil
Chris@1296 263
Chris@1296 264 # additional routes for having the file name at the end of url
Chris@1296 265 match 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :via => :get
Chris@1296 266 match 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :via => :get
Chris@1296 267 match 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :via => :get
Chris@1296 268 match 'attachments/thumbnail/:id(/:size)', :controller => 'attachments', :action => 'thumbnail', :id => /\d+/, :via => :get, :size => /\d+/
Chris@1296 269 resources :attachments, :only => [:show, :destroy]
Chris@1296 270
Chris@1296 271 resources :groups do
Chris@1296 272 member do
Chris@1296 273 get 'autocomplete_for_user'
Chris@1296 274 end
Chris@1296 275 end
Chris@1296 276
Chris@1296 277 match 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :via => :post, :as => 'group_users'
Chris@1296 278 match 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :via => :delete, :as => 'group_user'
Chris@1296 279 match 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :via => :post
Chris@1296 280 match 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :via => :post
Chris@1296 281
Chris@1296 282 resources :trackers, :except => :show do
Chris@1296 283 collection do
Chris@1296 284 match 'fields', :via => [:get, :post]
Chris@1296 285 end
Chris@1296 286 end
Chris@1296 287 resources :issue_statuses, :except => :show do
Chris@1296 288 collection do
Chris@1296 289 post 'update_issue_done_ratio'
Chris@1296 290 end
Chris@1296 291 end
Chris@1296 292 resources :custom_fields, :except => :show
Chris@1296 293 resources :roles do
Chris@1296 294 collection do
Chris@1296 295 match 'permissions', :via => [:get, :post]
Chris@1296 296 end
Chris@1296 297 end
Chris@1296 298 resources :enumerations, :except => :show
Chris@1296 299 match 'enumerations/:type', :to => 'enumerations#index', :via => :get
Chris@1296 300
Chris@1296 301 get 'projects/:id/search', :controller => 'search', :action => 'index'
Chris@1296 302 get 'search', :controller => 'search', :action => 'index'
Chris@1296 303
Chris@1296 304 match 'mail_handler', :controller => 'mail_handler', :action => 'index', :via => :post
Chris@1296 305
Chris@1296 306 match 'admin', :controller => 'admin', :action => 'index', :via => :get
Chris@1296 307 match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
Chris@1296 308 match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
Chris@1296 309 match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
Chris@1296 310 match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
Chris@1296 311 match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post
Chris@1296 312
Chris@1296 313 resources :auth_sources do
Chris@1296 314 member do
Chris@1296 315 get 'test_connection'
Chris@1296 316 end
Chris@1296 317 end
Chris@1296 318
Chris@1296 319 match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
Chris@1296 320 match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
Chris@1296 321 match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
Chris@1296 322 match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
Chris@1296 323 match 'settings', :controller => 'settings', :action => 'index', :via => :get
Chris@1296 324 match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
Chris@1296 325 match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post]
Chris@1296 326
Chris@1296 327 match 'sys/projects', :to => 'sys#projects', :via => :get
Chris@1296 328 match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
Chris@1296 329 match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get
Chris@1296 330
Chris@1296 331 match 'uploads', :to => 'attachments#upload', :via => :post
Chris@1296 332
Chris@1296 333 get 'robots.txt', :to => 'welcome#robots'
Chris@1296 334
Chris@1296 335 Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
Chris@1296 336 file = File.join(plugin_dir, "config/routes.rb")
Chris@1296 337 if File.exists?(file)
Chris@1296 338 begin
Chris@1296 339 instance_eval File.read(file)
Chris@1296 340 rescue Exception => e
Chris@1296 341 puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}."
Chris@1296 342 exit 1
Chris@1296 343 end
Chris@1296 344 end
Chris@1296 345 end
Chris@1296 346 end