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