annotate .svn/pristine/8f/8f557c0be5cf5dcfff30083afeb05623097b4cb2.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration

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