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