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