##// END OF EJS Templates
Added method to attachments routes....
Etienne Massip -
r8047:02893a17adfb
parent child
Show More
@@ -1,275 +1,275
1 ActionController::Routing::Routes.draw do |map|
1 ActionController::Routing::Routes.draw do |map|
2 # Add your own custom routes here.
2 # Add your own custom routes here.
3 # The priority is based upon order of creation: first created -> highest priority.
3 # The priority is based upon order of creation: first created -> highest priority.
4
4
5 # Here's a sample route:
5 # Here's a sample route:
6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
7 # Keep in mind you can assign values other than :controller and :action
7 # Keep in mind you can assign values other than :controller and :action
8
8
9 map.home '', :controller => 'welcome', :conditions => {:method => :get}
9 map.home '', :controller => 'welcome', :conditions => {:method => :get}
10
10
11 map.signin 'login', :controller => 'account', :action => 'login', :conditions => {:method => [:get, :post]}
11 map.signin 'login', :controller => 'account', :action => 'login', :conditions => {:method => [:get, :post]}
12 map.signout 'logout', :controller => 'account', :action => 'logout', :conditions => {:method => :get}
12 map.signout 'logout', :controller => 'account', :action => 'logout', :conditions => {:method => :get}
13 map.connect 'account/register', :controller => 'account', :action => 'register', :conditions => {:method => [:get, :post]}
13 map.connect 'account/register', :controller => 'account', :action => 'register', :conditions => {:method => [:get, :post]}
14 map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password', :conditions => {:method => [:get, :post]}
14 map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password', :conditions => {:method => [:get, :post]}
15 map.connect 'account/login', :controller => 'account', :action => 'login', :conditions => {:method => [:get, :post]}
15 map.connect 'account/login', :controller => 'account', :action => 'login', :conditions => {:method => [:get, :post]}
16 map.connect 'account/logout', :controller => 'account', :action => 'logout', :conditions => {:method => :get}
16 map.connect 'account/logout', :controller => 'account', :action => 'logout', :conditions => {:method => :get}
17 map.connect 'account/activate', :controller => 'account', :action => 'activate', :conditions => {:method => :get}
17 map.connect 'account/activate', :controller => 'account', :action => 'activate', :conditions => {:method => :get}
18
18
19 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
19 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
20
20
21 map.connect 'help/:ctrl/:page', :controller => 'help', :conditions => {:method => :get}
21 map.connect 'help/:ctrl/:page', :controller => 'help', :conditions => {:method => :get}
22
22
23 map.connect '/time_entries/destroy',
23 map.connect '/time_entries/destroy',
24 :controller => 'timelog', :action => 'destroy', :conditions => { :method => :delete }
24 :controller => 'timelog', :action => 'destroy', :conditions => { :method => :delete }
25 map.time_entries_context_menu '/time_entries/context_menu',
25 map.time_entries_context_menu '/time_entries/context_menu',
26 :controller => 'context_menus', :action => 'time_entries'
26 :controller => 'context_menus', :action => 'time_entries'
27
27
28 map.resources :time_entries, :controller => 'timelog', :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post}
28 map.resources :time_entries, :controller => 'timelog', :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post}
29
29
30 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
30 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
31 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => [:get, :post]}
31 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => [:get, :post]}
32
32
33 map.with_options :controller => 'messages' do |messages_routes|
33 map.with_options :controller => 'messages' do |messages_routes|
34 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
34 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
35 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
35 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
36 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
36 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
37 messages_views.connect 'boards/:board_id/topics/quote/:id', :action => 'quote'
37 messages_views.connect 'boards/:board_id/topics/quote/:id', :action => 'quote'
38 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
38 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
39 end
39 end
40 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
40 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
41 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
41 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
42 messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview'
42 messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview'
43 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
43 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
44 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
44 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
45 end
45 end
46 end
46 end
47
47
48 map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move'
48 map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move'
49 map.resources :queries, :except => [:show]
49 map.resources :queries, :except => [:show]
50
50
51 # Misc issue routes. TODO: move into resources
51 # Misc issue routes. TODO: move into resources
52 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues', :conditions => { :method => :get }
52 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues', :conditions => { :method => :get }
53 map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview
53 map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview
54 map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues'
54 map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues'
55 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
55 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
56 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post }
56 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post }
57 map.connect '/journals/diff', :controller => 'journals', :action => 'diff'
57 map.connect '/journals/diff', :controller => 'journals', :action => 'diff'
58 map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit', :id => /\d+/, :conditions => { :method => [:get, :post] }
58 map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit', :id => /\d+/, :conditions => { :method => [:get, :post] }
59
59
60 map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
60 map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
61 gantts_routes.connect '/projects/:project_id/issues/gantt'
61 gantts_routes.connect '/projects/:project_id/issues/gantt'
62 gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
62 gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
63 gantts_routes.connect '/issues/gantt.:format'
63 gantts_routes.connect '/issues/gantt.:format'
64 end
64 end
65
65
66 map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
66 map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
67 calendars_routes.connect '/projects/:project_id/issues/calendar'
67 calendars_routes.connect '/projects/:project_id/issues/calendar'
68 calendars_routes.connect '/issues/calendar'
68 calendars_routes.connect '/issues/calendar'
69 end
69 end
70
70
71 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
71 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
72 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
72 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
73 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
73 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
74 end
74 end
75
75
76 map.connect 'my/account', :controller => 'my', :action => 'account', :conditions => {:method => [:get, :post]}
76 map.connect 'my/account', :controller => 'my', :action => 'account', :conditions => {:method => [:get, :post]}
77 map.connect 'my/page', :controller => 'my', :action => 'page', :conditions => {:method => :get}
77 map.connect 'my/page', :controller => 'my', :action => 'page', :conditions => {:method => :get}
78 map.connect 'my', :controller => 'my', :action => 'index', :conditions => {:method => :get} # Redirects to my/page
78 map.connect 'my', :controller => 'my', :action => 'index', :conditions => {:method => :get} # Redirects to my/page
79 map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :conditions => {:method => :post}
79 map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :conditions => {:method => :post}
80 map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :conditions => {:method => :post}
80 map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :conditions => {:method => :post}
81 map.connect 'my/password', :controller => 'my', :action => 'password', :conditions => {:method => [:get, :post]}
81 map.connect 'my/password', :controller => 'my', :action => 'password', :conditions => {:method => [:get, :post]}
82 map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout', :conditions => {:method => :get}
82 map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout', :conditions => {:method => :get}
83 map.connect 'my/add_block', :controller => 'my', :action => 'add_block', :conditions => {:method => :post}
83 map.connect 'my/add_block', :controller => 'my', :action => 'add_block', :conditions => {:method => :post}
84 map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block', :conditions => {:method => :post}
84 map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block', :conditions => {:method => :post}
85 map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :conditions => {:method => :post}
85 map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :conditions => {:method => :post}
86
86
87 map.resources :issues, :collection => {:bulk_edit => :get, :bulk_update => :post} do |issues|
87 map.resources :issues, :collection => {:bulk_edit => :get, :bulk_update => :post} do |issues|
88 issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get}
88 issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get}
89 issues.resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
89 issues.resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
90 end
90 end
91 # Bulk deletion
91 # Bulk deletion
92 map.connect '/issues', :controller => 'issues', :action => 'destroy', :conditions => {:method => :delete}
92 map.connect '/issues', :controller => 'issues', :action => 'destroy', :conditions => {:method => :delete}
93
93
94 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new', :conditions => { :method => :post }
94 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new', :conditions => { :method => :post }
95 map.connect 'members/edit/:id', :controller => 'members', :action => 'edit', :id => /\d+/, :conditions => { :method => :post }
95 map.connect 'members/edit/:id', :controller => 'members', :action => 'edit', :id => /\d+/, :conditions => { :method => :post }
96 map.connect 'members/destroy/:id', :controller => 'members', :action => 'destroy', :id => /\d+/, :conditions => { :method => :post }
96 map.connect 'members/destroy/:id', :controller => 'members', :action => 'destroy', :id => /\d+/, :conditions => { :method => :post }
97 map.connect 'members/autocomplete_for_member/:id', :controller => 'members', :action => 'autocomplete_for_member', :conditions => { :method => :post }
97 map.connect 'members/autocomplete_for_member/:id', :controller => 'members', :action => 'autocomplete_for_member', :conditions => { :method => :post }
98
98
99 map.resources :users
99 map.resources :users
100 map.with_options :controller => 'users' do |users|
100 map.with_options :controller => 'users' do |users|
101 users.user_memberships 'users/:id/memberships', :action => 'edit_membership', :conditions => {:method => :post}
101 users.user_memberships 'users/:id/memberships', :action => 'edit_membership', :conditions => {:method => :post}
102 users.user_membership 'users/:id/memberships/:membership_id', :action => 'edit_membership', :conditions => {:method => :put}
102 users.user_membership 'users/:id/memberships/:membership_id', :action => 'edit_membership', :conditions => {:method => :put}
103 users.connect 'users/:id/memberships/:membership_id', :action => 'destroy_membership', :conditions => {:method => :delete}
103 users.connect 'users/:id/memberships/:membership_id', :action => 'destroy_membership', :conditions => {:method => :delete}
104 end
104 end
105
105
106 # For nice "roadmap" in the url for the index action
106 # For nice "roadmap" in the url for the index action
107 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
107 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
108
108
109 map.all_news 'news', :controller => 'news', :action => 'index'
109 map.all_news 'news', :controller => 'news', :action => 'index'
110 map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index'
110 map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index'
111 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
111 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
112 map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post}
112 map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post}
113 map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete}
113 map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete}
114
114
115 map.connect 'watchers/new', :controller=> 'watchers', :action => 'new', :conditions => {:method => [:get, :post]}
115 map.connect 'watchers/new', :controller=> 'watchers', :action => 'new', :conditions => {:method => [:get, :post]}
116 map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :conditions => {:method => :post}
116 map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :conditions => {:method => :post}
117 map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch', :conditions => {:method => :post}
117 map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch', :conditions => {:method => :post}
118 map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :conditions => {:method => :post}
118 map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :conditions => {:method => :post}
119
119
120 map.resources :projects, :member => {
120 map.resources :projects, :member => {
121 :copy => [:get, :post],
121 :copy => [:get, :post],
122 :settings => :get,
122 :settings => :get,
123 :modules => :post,
123 :modules => :post,
124 :archive => :post,
124 :archive => :post,
125 :unarchive => :post
125 :unarchive => :post
126 } do |project|
126 } do |project|
127 project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy]
127 project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy]
128 project.resources :issues, :only => [:index, :new, :create] do |issues|
128 project.resources :issues, :only => [:index, :new, :create] do |issues|
129 issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get}
129 issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get}
130 end
130 end
131 project.resources :files, :only => [:index, :new, :create]
131 project.resources :files, :only => [:index, :new, :create]
132 project.resources :versions, :shallow => true, :collection => {:close_completed => :put}, :member => {:status_by => :post}
132 project.resources :versions, :shallow => true, :collection => {:close_completed => :put}, :member => {:status_by => :post}
133 project.resources :news, :shallow => true
133 project.resources :news, :shallow => true
134 project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id', :collection => {:report => :get}
134 project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id', :collection => {:report => :get}
135 project.resources :queries, :only => [:new, :create]
135 project.resources :queries, :only => [:new, :create]
136 project.resources :issue_categories, :shallow => true
136 project.resources :issue_categories, :shallow => true
137 project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
137 project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
138 project.resources :boards
138 project.resources :boards
139
139
140 project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
140 project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
141 project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
141 project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
142 project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
142 project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
143 project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
143 project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
144 project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
144 project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
145 project.resources :wiki, :except => [:new, :create], :member => {
145 project.resources :wiki, :except => [:new, :create], :member => {
146 :rename => [:get, :post],
146 :rename => [:get, :post],
147 :history => :get,
147 :history => :get,
148 :preview => :any,
148 :preview => :any,
149 :protect => :post,
149 :protect => :post,
150 :add_attachment => :post
150 :add_attachment => :post
151 }, :collection => {
151 }, :collection => {
152 :export => :get,
152 :export => :get,
153 :date_index => :get
153 :date_index => :get
154 }
154 }
155
155
156 end
156 end
157
157
158 # TODO: port to be part of the resources route(s)
158 # TODO: port to be part of the resources route(s)
159 map.with_options :controller => 'projects' do |project_mapper|
159 map.with_options :controller => 'projects' do |project_mapper|
160 project_mapper.with_options :conditions => {:method => :get} do |project_views|
160 project_mapper.with_options :conditions => {:method => :get} do |project_views|
161 project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings'
161 project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings'
162 project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new'
162 project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new'
163 end
163 end
164 end
164 end
165
165
166 map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity|
166 map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity|
167 activity.connect 'projects/:id/activity'
167 activity.connect 'projects/:id/activity'
168 activity.connect 'projects/:id/activity.:format'
168 activity.connect 'projects/:id/activity.:format'
169 activity.connect 'activity', :id => nil
169 activity.connect 'activity', :id => nil
170 activity.connect 'activity.:format', :id => nil
170 activity.connect 'activity.:format', :id => nil
171 end
171 end
172
172
173 map.with_options :controller => 'repositories' do |repositories|
173 map.with_options :controller => 'repositories' do |repositories|
174 repositories.with_options :conditions => {:method => :get} do |repository_views|
174 repositories.with_options :conditions => {:method => :get} do |repository_views|
175 repository_views.connect 'projects/:id/repository', :action => 'show'
175 repository_views.connect 'projects/:id/repository', :action => 'show'
176 repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
176 repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
177 repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
177 repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
178 repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
178 repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
179 repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
179 repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
180 repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
180 repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
181 repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
181 repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
182 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
182 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
183 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
183 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
184 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
184 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
185 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
185 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
186 repository_views.connect 'projects/:id/repository/browse/*path', :action => 'browse'
186 repository_views.connect 'projects/:id/repository/browse/*path', :action => 'browse'
187 repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
187 repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
188 repository_views.connect 'projects/:id/repository/changes/*path', :action => 'changes'
188 repository_views.connect 'projects/:id/repository/changes/*path', :action => 'changes'
189 repository_views.connect 'projects/:id/repository/annotate/*path', :action => 'annotate'
189 repository_views.connect 'projects/:id/repository/annotate/*path', :action => 'annotate'
190 repository_views.connect 'projects/:id/repository/diff/*path', :action => 'diff'
190 repository_views.connect 'projects/:id/repository/diff/*path', :action => 'diff'
191 repository_views.connect 'projects/:id/repository/graph', :action => 'graph'
191 repository_views.connect 'projects/:id/repository/graph', :action => 'graph'
192 end
192 end
193
193
194 repositories.connect 'projects/:id/repository/revision', :action => 'revision', :conditions => {:method => [:get, :post]}
194 repositories.connect 'projects/:id/repository/revision', :action => 'revision', :conditions => {:method => [:get, :post]}
195 repositories.connect 'projects/:id/repository/committers', :action => 'committers', :conditions => {:method => [:get, :post]}
195 repositories.connect 'projects/:id/repository/committers', :action => 'committers', :conditions => {:method => [:get, :post]}
196 repositories.connect 'projects/:id/repository/edit', :action => 'edit', :conditions => {:method => :post}
196 repositories.connect 'projects/:id/repository/edit', :action => 'edit', :conditions => {:method => :post}
197 repositories.connect 'projects/:id/repository/destroy', :action => 'destroy', :conditions => {:method => :post}
197 repositories.connect 'projects/:id/repository/destroy', :action => 'destroy', :conditions => {:method => :post}
198 end
198 end
199
199
200 map.resources :attachments, :only => [:show, :destroy]
200 map.resources :attachments, :only => [:show, :destroy]
201 # additional routes for having the file name at the end of url
201 # additional routes for having the file name at the end of url
202 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
202 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :conditions => {:method => :get}
203 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
203 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :conditions => {:method => :get}
204 map.connect 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/
204 map.connect 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :conditions => {:method => :get}
205
205
206 map.resources :groups, :member => {:autocomplete_for_user => :get}
206 map.resources :groups, :member => {:autocomplete_for_user => :get}
207 map.group_users 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :conditions => {:method => :post}
207 map.group_users 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :conditions => {:method => :post}
208 map.group_user 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :conditions => {:method => :delete}
208 map.group_user 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :conditions => {:method => :delete}
209 map.connect 'groups/add_users/:id', :controller => 'groups', :action => 'add_users', :id => /\d+/, :conditions => {:method => :post}
209 map.connect 'groups/add_users/:id', :controller => 'groups', :action => 'add_users', :id => /\d+/, :conditions => {:method => :post}
210 map.connect 'groups/remove_user/:id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :conditions => {:method => :post}
210 map.connect 'groups/remove_user/:id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :conditions => {:method => :post}
211 map.connect 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :conditions => {:method => :post}
211 map.connect 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :conditions => {:method => :post}
212 map.connect 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :conditions => {:method => :post}
212 map.connect 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :conditions => {:method => :post}
213
213
214 map.resources :trackers, :except => :show
214 map.resources :trackers, :except => :show
215 map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
215 map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
216 map.resources :custom_fields, :except => :show
216 map.resources :custom_fields, :except => :show
217 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
217 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
218
218
219 map.connect 'custom_fields', :controller => 'custom_fields', :action => 'index', :conditions => {:method => :get}
219 map.connect 'custom_fields', :controller => 'custom_fields', :action => 'index', :conditions => {:method => :get}
220 map.connect 'custom_fields/new', :controller => 'custom_fields', :action => 'new', :conditions => {:method => [:get, :post]}
220 map.connect 'custom_fields/new', :controller => 'custom_fields', :action => 'new', :conditions => {:method => [:get, :post]}
221 map.connect 'custom_fields/edit/:id', :controller => 'custom_fields', :action => 'edit', :id => /\d+/, :conditions => {:method => [:get, :post]}
221 map.connect 'custom_fields/edit/:id', :controller => 'custom_fields', :action => 'edit', :id => /\d+/, :conditions => {:method => [:get, :post]}
222 map.connect 'custom_fields/destroy/:id', :controller => 'custom_fields', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
222 map.connect 'custom_fields/destroy/:id', :controller => 'custom_fields', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
223
223
224 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
224 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
225
225
226 map.connect 'mail_handler', :controller => 'mail_handler', :action => 'index', :conditions => {:method => :post}
226 map.connect 'mail_handler', :controller => 'mail_handler', :action => 'index', :conditions => {:method => :post}
227
227
228 map.connect 'admin', :controller => 'admin', :action => 'index', :conditions => {:method => :get}
228 map.connect 'admin', :controller => 'admin', :action => 'index', :conditions => {:method => :get}
229 map.connect 'admin/projects', :controller => 'admin', :action => 'projects', :conditions => {:method => :get}
229 map.connect 'admin/projects', :controller => 'admin', :action => 'projects', :conditions => {:method => :get}
230 map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins', :conditions => {:method => :get}
230 map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins', :conditions => {:method => :get}
231 map.connect 'admin/info', :controller => 'admin', :action => 'info', :conditions => {:method => :get}
231 map.connect 'admin/info', :controller => 'admin', :action => 'info', :conditions => {:method => :get}
232 map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email', :conditions => {:method => :get}
232 map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email', :conditions => {:method => :get}
233 map.connect 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :conditions => {:method => :post}
233 map.connect 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :conditions => {:method => :post}
234
234
235 # Used by AuthSourcesControllerTest
235 # Used by AuthSourcesControllerTest
236 # TODO : refactor *AuthSourcesController to remove these routes
236 # TODO : refactor *AuthSourcesController to remove these routes
237 map.connect 'auth_sources', :controller => 'auth_sources', :action => 'index', :conditions => {:method => :get}
237 map.connect 'auth_sources', :controller => 'auth_sources', :action => 'index', :conditions => {:method => :get}
238 map.connect 'auth_sources/new', :controller => 'auth_sources', :action => 'new', :conditions => {:method => :get}
238 map.connect 'auth_sources/new', :controller => 'auth_sources', :action => 'new', :conditions => {:method => :get}
239 map.connect 'auth_sources/create', :controller => 'auth_sources', :action => 'create', :conditions => {:method => :post}
239 map.connect 'auth_sources/create', :controller => 'auth_sources', :action => 'create', :conditions => {:method => :post}
240 map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
240 map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
241 map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources', :action => 'test_connection', :conditions => {:method => :get}
241 map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources', :action => 'test_connection', :conditions => {:method => :get}
242 map.connect 'auth_sources/edit/:id', :controller => 'auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
242 map.connect 'auth_sources/edit/:id', :controller => 'auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
243 map.connect 'auth_sources/update/:id', :controller => 'auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post}
243 map.connect 'auth_sources/update/:id', :controller => 'auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post}
244
244
245 map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources', :action => 'index', :conditions => {:method => :get}
245 map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources', :action => 'index', :conditions => {:method => :get}
246 map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources', :action => 'new', :conditions => {:method => :get}
246 map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources', :action => 'new', :conditions => {:method => :get}
247 map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources', :action => 'create', :conditions => {:method => :post}
247 map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources', :action => 'create', :conditions => {:method => :post}
248 map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
248 map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
249 map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources', :action => 'test_connection', :conditions => {:method => :get}
249 map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources', :action => 'test_connection', :conditions => {:method => :get}
250 map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
250 map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
251 map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post}
251 map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post}
252 map.connect 'workflows', :controller => 'workflows', :action => 'index', :conditions => {:method => :get}
252 map.connect 'workflows', :controller => 'workflows', :action => 'index', :conditions => {:method => :get}
253 map.connect 'workflows/edit', :controller => 'workflows', :action => 'edit', :conditions => {:method => [:get, :post]}
253 map.connect 'workflows/edit', :controller => 'workflows', :action => 'edit', :conditions => {:method => [:get, :post]}
254 map.connect 'workflows/copy', :controller => 'workflows', :action => 'copy', :conditions => {:method => [:get, :post]}
254 map.connect 'workflows/copy', :controller => 'workflows', :action => 'copy', :conditions => {:method => [:get, :post]}
255 map.connect 'enumerations', :controller => 'enumerations', :action => 'index', :conditions => {:method => :get}
255 map.connect 'enumerations', :controller => 'enumerations', :action => 'index', :conditions => {:method => :get}
256 map.connect 'enumerations/new', :controller => 'enumerations', :action => 'new', :conditions => {:method => :get}
256 map.connect 'enumerations/new', :controller => 'enumerations', :action => 'new', :conditions => {:method => :get}
257 map.connect 'enumerations/create', :controller => 'enumerations', :action => 'create', :conditions => {:method => :post}
257 map.connect 'enumerations/create', :controller => 'enumerations', :action => 'create', :conditions => {:method => :post}
258 map.connect 'enumerations/edit/:id', :controller => 'enumerations', :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
258 map.connect 'enumerations/edit/:id', :controller => 'enumerations', :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
259 map.connect 'enumerations/update/:id', :controller => 'enumerations', :action => 'update', :id => /\d+/, :conditions => {:method => :post}
259 map.connect 'enumerations/update/:id', :controller => 'enumerations', :action => 'update', :id => /\d+/, :conditions => {:method => :post}
260 map.connect 'enumerations/destroy/:id', :controller => 'enumerations', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
260 map.connect 'enumerations/destroy/:id', :controller => 'enumerations', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
261 map.connect 'settings', :controller => 'settings', :action => 'index', :conditions => {:method => :get}
261 map.connect 'settings', :controller => 'settings', :action => 'index', :conditions => {:method => :get}
262 map.connect 'settings/edit', :controller => 'settings', :action => 'edit', :conditions => {:method => [:get, :post]}
262 map.connect 'settings/edit', :controller => 'settings', :action => 'edit', :conditions => {:method => [:get, :post]}
263 map.connect 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :conditions => {:method => [:get, :post]}
263 map.connect 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :conditions => {:method => [:get, :post]}
264
264
265 map.with_options :controller => 'sys' do |sys|
265 map.with_options :controller => 'sys' do |sys|
266 sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get}
266 sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get}
267 sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post}
267 sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post}
268 sys.connect 'sys/fetch_changesets', :action => 'fetch_changesets', :conditions => {:method => :get}
268 sys.connect 'sys/fetch_changesets', :action => 'fetch_changesets', :conditions => {:method => :get}
269 end
269 end
270
270
271 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots', :conditions => {:method => :get}
271 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots', :conditions => {:method => :get}
272
272
273 # Used for OpenID
273 # Used for OpenID
274 map.root :controller => 'account', :action => 'login'
274 map.root :controller => 'account', :action => 'login'
275 end
275 end
General Comments 0
You need to be logged in to leave comments. Login now