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