##// END OF EJS Templates
route: use ":controller" instead of ":as" for project_enumerations...
Toshi MARUYAMA -
r8450:5835648290e9
parent child
Show More
@@ -1,42 +1,42
1 <% form_tag(project_project_enumerations_path(@project), :method => :put, :class => "tabular") do %>
1 <% form_tag(project_enumerations_path(@project), :method => :put, :class => "tabular") do %>
2
2
3 <table class="list">
3 <table class="list">
4 <thead><tr>
4 <thead><tr>
5 <th><%= l(:field_name) %></th>
5 <th><%= l(:field_name) %></th>
6 <th><%= l(:enumeration_system_activity) %></th>
6 <th><%= l(:enumeration_system_activity) %></th>
7 <% TimeEntryActivity.new.available_custom_fields.each do |value| %>
7 <% TimeEntryActivity.new.available_custom_fields.each do |value| %>
8 <th><%= h value.name %></th>
8 <th><%= h value.name %></th>
9 <% end %>
9 <% end %>
10 <th style="width:15%;"><%= l(:field_active) %></th>
10 <th style="width:15%;"><%= l(:field_active) %></th>
11 </tr></thead>
11 </tr></thead>
12
12
13 <% @project.activities(true).each do |enumeration| %>
13 <% @project.activities(true).each do |enumeration| %>
14 <% fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %>
14 <% fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %>
15 <tr class="<%= cycle('odd', 'even') %>">
15 <tr class="<%= cycle('odd', 'even') %>">
16 <td>
16 <td>
17 <%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %>
17 <%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %>
18 <%= h(enumeration) %>
18 <%= h(enumeration) %>
19 </td>
19 </td>
20 <td align="center" style="width:15%;"><%= checked_image !enumeration.project %></td>
20 <td align="center" style="width:15%;"><%= checked_image !enumeration.project %></td>
21 <% enumeration.custom_field_values.each do |value| %>
21 <% enumeration.custom_field_values.each do |value| %>
22 <td align="center">
22 <td align="center">
23 <%= custom_field_tag "enumerations[#{enumeration.id}]", value %>
23 <%= custom_field_tag "enumerations[#{enumeration.id}]", value %>
24 </td>
24 </td>
25 <% end %>
25 <% end %>
26 <td align="center" style="width:15%;">
26 <td align="center" style="width:15%;">
27 <%= ff.check_box :active %>
27 <%= ff.check_box :active %>
28 </td>
28 </td>
29 </tr>
29 </tr>
30 <% end %>
30 <% end %>
31 <% end %>
31 <% end %>
32 </table>
32 </table>
33
33
34 <div class="contextual">
34 <div class="contextual">
35 <%= link_to(l(:button_reset), project_project_enumerations_path(@project),
35 <%= link_to(l(:button_reset), project_enumerations_path(@project),
36 :method => :delete,
36 :method => :delete,
37 :confirm => l(:text_are_you_sure),
37 :confirm => l(:text_are_you_sure),
38 :class => 'icon icon-del') %>
38 :class => 'icon icon-del') %>
39 </div>
39 </div>
40
40
41 <%= submit_tag l(:button_save) %>
41 <%= submit_tag l(:button_save) %>
42 <% end %>
42 <% end %>
@@ -1,396 +1,396
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',
11 map.signin 'login', :controller => 'account', :action => 'login',
12 :conditions => {:method => [:get, :post]}
12 :conditions => {:method => [:get, :post]}
13 map.signout 'logout', :controller => 'account', :action => 'logout',
13 map.signout 'logout', :controller => 'account', :action => 'logout',
14 :conditions => {:method => :get}
14 :conditions => {:method => :get}
15 map.connect 'account/register', :controller => 'account', :action => 'register',
15 map.connect 'account/register', :controller => 'account', :action => 'register',
16 :conditions => {:method => [:get, :post]}
16 :conditions => {:method => [:get, :post]}
17 map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password',
17 map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password',
18 :conditions => {:method => [:get, :post]}
18 :conditions => {:method => [:get, :post]}
19 map.connect 'account/activate', :controller => 'account', :action => 'activate',
19 map.connect 'account/activate', :controller => 'account', :action => 'activate',
20 :conditions => {:method => :get}
20 :conditions => {:method => :get}
21
21
22 map.connect 'projects/:id/wiki', :controller => 'wikis',
22 map.connect 'projects/:id/wiki', :controller => 'wikis',
23 :action => 'edit', :conditions => {:method => :post}
23 :action => 'edit', :conditions => {:method => :post}
24 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis',
24 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis',
25 :action => 'destroy', :conditions => {:method => [:get, :post]}
25 :action => 'destroy', :conditions => {:method => [:get, :post]}
26
26
27 map.with_options :controller => 'messages' do |messages_routes|
27 map.with_options :controller => 'messages' do |messages_routes|
28 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
28 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
29 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
29 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
30 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
30 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
31 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
31 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
32 end
32 end
33 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
33 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
34 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
34 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
35 messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview'
35 messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview'
36 messages_actions.connect 'boards/:board_id/topics/quote/:id', :action => 'quote'
36 messages_actions.connect 'boards/:board_id/topics/quote/:id', :action => 'quote'
37 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
37 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
38 messages_actions.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
38 messages_actions.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
39 messages_actions.connect 'boards/:board_id/topics/:id/destroy', :action => 'destroy'
39 messages_actions.connect 'boards/:board_id/topics/:id/destroy', :action => 'destroy'
40 end
40 end
41 end
41 end
42
42
43 # Misc issue routes. TODO: move into resources
43 # Misc issue routes. TODO: move into resources
44 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes',
44 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes',
45 :action => 'issues', :conditions => { :method => :get }
45 :action => 'issues', :conditions => { :method => :get }
46 # TODO: would look nicer as /issues/:id/preview
46 # TODO: would look nicer as /issues/:id/preview
47 map.preview_issue '/issues/preview/:id', :controller => 'previews',
47 map.preview_issue '/issues/preview/:id', :controller => 'previews',
48 :action => 'issue'
48 :action => 'issue'
49 map.issues_context_menu '/issues/context_menu',
49 map.issues_context_menu '/issues/context_menu',
50 :controller => 'context_menus', :action => 'issues'
50 :controller => 'context_menus', :action => 'issues'
51
51
52 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
52 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
53 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new',
53 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new',
54 :id => /\d+/, :conditions => { :method => :post }
54 :id => /\d+/, :conditions => { :method => :post }
55
55
56 map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff',
56 map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff',
57 :id => /\d+/, :conditions => { :method => :get }
57 :id => /\d+/, :conditions => { :method => :get }
58 map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit',
58 map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit',
59 :id => /\d+/, :conditions => { :method => [:get, :post] }
59 :id => /\d+/, :conditions => { :method => [:get, :post] }
60
60
61 map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
61 map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
62 gantts_routes.connect '/projects/:project_id/issues/gantt'
62 gantts_routes.connect '/projects/:project_id/issues/gantt'
63 gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
63 gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
64 gantts_routes.connect '/issues/gantt.:format'
64 gantts_routes.connect '/issues/gantt.:format'
65 end
65 end
66
66
67 map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
67 map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
68 calendars_routes.connect '/projects/:project_id/issues/calendar'
68 calendars_routes.connect '/projects/:project_id/issues/calendar'
69 calendars_routes.connect '/issues/calendar'
69 calendars_routes.connect '/issues/calendar'
70 end
70 end
71
71
72 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
72 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
73 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
73 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
74 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
74 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
75 end
75 end
76
76
77 map.connect 'my/account', :controller => 'my', :action => 'account',
77 map.connect 'my/account', :controller => 'my', :action => 'account',
78 :conditions => {:method => [:get, :post]}
78 :conditions => {:method => [:get, :post]}
79 map.connect 'my/page', :controller => 'my', :action => 'page',
79 map.connect 'my/page', :controller => 'my', :action => 'page',
80 :conditions => {:method => :get}
80 :conditions => {:method => :get}
81 # Redirects to my/page
81 # Redirects to my/page
82 map.connect 'my', :controller => 'my', :action => 'index',
82 map.connect 'my', :controller => 'my', :action => 'index',
83 :conditions => {:method => :get}
83 :conditions => {:method => :get}
84 map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key',
84 map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key',
85 :conditions => {:method => :post}
85 :conditions => {:method => :post}
86 map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key',
86 map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key',
87 :conditions => {:method => :post}
87 :conditions => {:method => :post}
88 map.connect 'my/password', :controller => 'my', :action => 'password',
88 map.connect 'my/password', :controller => 'my', :action => 'password',
89 :conditions => {:method => [:get, :post]}
89 :conditions => {:method => [:get, :post]}
90 map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout',
90 map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout',
91 :conditions => {:method => :get}
91 :conditions => {:method => :get}
92 map.connect 'my/add_block', :controller => 'my', :action => 'add_block',
92 map.connect 'my/add_block', :controller => 'my', :action => 'add_block',
93 :conditions => {:method => :post}
93 :conditions => {:method => :post}
94 map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block',
94 map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block',
95 :conditions => {:method => :post}
95 :conditions => {:method => :post}
96 map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks',
96 map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks',
97 :conditions => {:method => :post}
97 :conditions => {:method => :post}
98
98
99 map.connect 'projects/:id/members/new', :controller => 'members',
99 map.connect 'projects/:id/members/new', :controller => 'members',
100 :action => 'new', :conditions => { :method => :post }
100 :action => 'new', :conditions => { :method => :post }
101 map.connect 'members/edit/:id', :controller => 'members',
101 map.connect 'members/edit/:id', :controller => 'members',
102 :action => 'edit', :id => /\d+/, :conditions => { :method => :post }
102 :action => 'edit', :id => /\d+/, :conditions => { :method => :post }
103 map.connect 'members/destroy/:id', :controller => 'members',
103 map.connect 'members/destroy/:id', :controller => 'members',
104 :action => 'destroy', :id => /\d+/, :conditions => { :method => :post }
104 :action => 'destroy', :id => /\d+/, :conditions => { :method => :post }
105 map.connect 'members/autocomplete_for_member/:id', :controller => 'members',
105 map.connect 'members/autocomplete_for_member/:id', :controller => 'members',
106 :action => 'autocomplete_for_member', :conditions => { :method => :post }
106 :action => 'autocomplete_for_member', :conditions => { :method => :post }
107
107
108 map.with_options :controller => 'users' do |users|
108 map.with_options :controller => 'users' do |users|
109 users.user_membership 'users/:id/memberships/:membership_id',
109 users.user_membership 'users/:id/memberships/:membership_id',
110 :action => 'edit_membership',
110 :action => 'edit_membership',
111 :conditions => {:method => :put}
111 :conditions => {:method => :put}
112 users.connect 'users/:id/memberships/:membership_id',
112 users.connect 'users/:id/memberships/:membership_id',
113 :action => 'destroy_membership',
113 :action => 'destroy_membership',
114 :conditions => {:method => :delete}
114 :conditions => {:method => :delete}
115 users.user_memberships 'users/:id/memberships',
115 users.user_memberships 'users/:id/memberships',
116 :action => 'edit_membership',
116 :action => 'edit_membership',
117 :conditions => {:method => :post}
117 :conditions => {:method => :post}
118 end
118 end
119 map.resources :users
119 map.resources :users
120
120
121 # For nice "roadmap" in the url for the index action
121 # For nice "roadmap" in the url for the index action
122 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
122 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
123
123
124 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
124 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
125 map.connect 'news/:id/comments', :controller => 'comments',
125 map.connect 'news/:id/comments', :controller => 'comments',
126 :action => 'create', :conditions => {:method => :post}
126 :action => 'create', :conditions => {:method => :post}
127 map.connect 'news/:id/comments/:comment_id', :controller => 'comments',
127 map.connect 'news/:id/comments/:comment_id', :controller => 'comments',
128 :action => 'destroy', :conditions => {:method => :delete}
128 :action => 'destroy', :conditions => {:method => :delete}
129
129
130 map.connect 'watchers/new', :controller=> 'watchers', :action => 'new',
130 map.connect 'watchers/new', :controller=> 'watchers', :action => 'new',
131 :conditions => {:method => [:get, :post]}
131 :conditions => {:method => [:get, :post]}
132 map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy',
132 map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy',
133 :conditions => {:method => :post}
133 :conditions => {:method => :post}
134 map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch',
134 map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch',
135 :conditions => {:method => :post}
135 :conditions => {:method => :post}
136 map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch',
136 map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch',
137 :conditions => {:method => :post}
137 :conditions => {:method => :post}
138
138
139 # TODO: port to be part of the resources route(s)
139 # TODO: port to be part of the resources route(s)
140 map.with_options :conditions => {:method => :get} do |project_views|
140 map.with_options :conditions => {:method => :get} do |project_views|
141 project_views.connect 'projects/:id/settings/:tab',
141 project_views.connect 'projects/:id/settings/:tab',
142 :controller => 'projects', :action => 'settings'
142 :controller => 'projects', :action => 'settings'
143 project_views.connect 'projects/:project_id/issues/:copy_from/copy',
143 project_views.connect 'projects/:project_id/issues/:copy_from/copy',
144 :controller => 'issues', :action => 'new'
144 :controller => 'issues', :action => 'new'
145 end
145 end
146
146
147 map.resources :projects, :member => {
147 map.resources :projects, :member => {
148 :copy => [:get, :post],
148 :copy => [:get, :post],
149 :settings => :get,
149 :settings => :get,
150 :modules => :post,
150 :modules => :post,
151 :archive => :post,
151 :archive => :post,
152 :unarchive => :post
152 :unarchive => :post
153 } do |project|
153 } do |project|
154 project.resource :project_enumerations, :as => 'enumerations',
154 project.resource :enumerations, :controller => 'project_enumerations',
155 :only => [:update, :destroy]
155 :only => [:update, :destroy]
156 # issue form update
156 # issue form update
157 project.issue_form 'issues/new', :controller => 'issues',
157 project.issue_form 'issues/new', :controller => 'issues',
158 :action => 'new', :conditions => {:method => [:post, :put]}
158 :action => 'new', :conditions => {:method => [:post, :put]}
159 project.resources :issues, :only => [:index, :new, :create] do |issues|
159 project.resources :issues, :only => [:index, :new, :create] do |issues|
160 issues.resources :time_entries, :controller => 'timelog',
160 issues.resources :time_entries, :controller => 'timelog',
161 :collection => {:report => :get}
161 :collection => {:report => :get}
162 end
162 end
163
163
164 project.resources :files, :only => [:index, :new, :create]
164 project.resources :files, :only => [:index, :new, :create]
165 project.resources :versions, :shallow => true,
165 project.resources :versions, :shallow => true,
166 :collection => {:close_completed => :put},
166 :collection => {:close_completed => :put},
167 :member => {:status_by => :post}
167 :member => {:status_by => :post}
168 project.resources :news, :shallow => true
168 project.resources :news, :shallow => true
169 project.resources :time_entries, :controller => 'timelog',
169 project.resources :time_entries, :controller => 'timelog',
170 :collection => {:report => :get}
170 :collection => {:report => :get}
171 project.resources :queries, :only => [:new, :create]
171 project.resources :queries, :only => [:new, :create]
172 project.resources :issue_categories, :shallow => true
172 project.resources :issue_categories, :shallow => true
173 project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
173 project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
174 project.resources :boards
174 project.resources :boards
175
175
176 project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
176 project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
177 project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
177 project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
178 project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
178 project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
179 project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
179 project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
180 project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
180 project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
181 project.resources :wiki, :except => [:new, :create], :member => {
181 project.resources :wiki, :except => [:new, :create], :member => {
182 :rename => [:get, :post],
182 :rename => [:get, :post],
183 :history => :get,
183 :history => :get,
184 :preview => :any,
184 :preview => :any,
185 :protect => :post,
185 :protect => :post,
186 :add_attachment => :post
186 :add_attachment => :post
187 }, :collection => {
187 }, :collection => {
188 :export => :get,
188 :export => :get,
189 :date_index => :get
189 :date_index => :get
190 }
190 }
191 end
191 end
192
192
193 map.connect 'news', :controller => 'news', :action => 'index'
193 map.connect 'news', :controller => 'news', :action => 'index'
194 map.connect 'news.:format', :controller => 'news', :action => 'index'
194 map.connect 'news.:format', :controller => 'news', :action => 'index'
195
195
196 map.resources :queries, :except => [:show]
196 map.resources :queries, :except => [:show]
197 map.resources :issues,
197 map.resources :issues,
198 :collection => {:bulk_edit => [:get, :post], :bulk_update => :post} do |issues|
198 :collection => {:bulk_edit => [:get, :post], :bulk_update => :post} do |issues|
199 issues.resources :time_entries, :controller => 'timelog',
199 issues.resources :time_entries, :controller => 'timelog',
200 :collection => {:report => :get}
200 :collection => {:report => :get}
201 issues.resources :relations, :shallow => true,
201 issues.resources :relations, :shallow => true,
202 :controller => 'issue_relations',
202 :controller => 'issue_relations',
203 :only => [:index, :show, :create, :destroy]
203 :only => [:index, :show, :create, :destroy]
204 end
204 end
205 # Bulk deletion
205 # Bulk deletion
206 map.connect '/issues', :controller => 'issues', :action => 'destroy',
206 map.connect '/issues', :controller => 'issues', :action => 'destroy',
207 :conditions => {:method => :delete}
207 :conditions => {:method => :delete}
208
208
209 map.connect '/time_entries/destroy',
209 map.connect '/time_entries/destroy',
210 :controller => 'timelog', :action => 'destroy',
210 :controller => 'timelog', :action => 'destroy',
211 :conditions => { :method => :delete }
211 :conditions => { :method => :delete }
212 map.time_entries_context_menu '/time_entries/context_menu',
212 map.time_entries_context_menu '/time_entries/context_menu',
213 :controller => 'context_menus', :action => 'time_entries'
213 :controller => 'context_menus', :action => 'time_entries'
214
214
215 map.resources :time_entries, :controller => 'timelog',
215 map.resources :time_entries, :controller => 'timelog',
216 :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post}
216 :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post}
217
217
218 map.with_options :controller => 'activities', :action => 'index',
218 map.with_options :controller => 'activities', :action => 'index',
219 :conditions => {:method => :get} do |activity|
219 :conditions => {:method => :get} do |activity|
220 activity.connect 'projects/:id/activity'
220 activity.connect 'projects/:id/activity'
221 activity.connect 'projects/:id/activity.:format'
221 activity.connect 'projects/:id/activity.:format'
222 activity.connect 'activity', :id => nil
222 activity.connect 'activity', :id => nil
223 activity.connect 'activity.:format', :id => nil
223 activity.connect 'activity.:format', :id => nil
224 end
224 end
225
225
226 map.with_options :controller => 'repositories' do |repositories|
226 map.with_options :controller => 'repositories' do |repositories|
227 repositories.with_options :conditions => {:method => :get} do |repository_views|
227 repositories.with_options :conditions => {:method => :get} do |repository_views|
228 repository_views.connect 'projects/:id/repository',
228 repository_views.connect 'projects/:id/repository',
229 :action => 'show'
229 :action => 'show'
230 repository_views.connect 'projects/:id/repository/statistics',
230 repository_views.connect 'projects/:id/repository/statistics',
231 :action => 'stats'
231 :action => 'stats'
232
232
233 repository_views.connect 'projects/:id/repository/revisions',
233 repository_views.connect 'projects/:id/repository/revisions',
234 :action => 'revisions'
234 :action => 'revisions'
235 repository_views.connect 'projects/:id/repository/revisions.:format',
235 repository_views.connect 'projects/:id/repository/revisions.:format',
236 :action => 'revisions'
236 :action => 'revisions'
237 repository_views.connect 'projects/:id/repository/revisions/:rev',
237 repository_views.connect 'projects/:id/repository/revisions/:rev',
238 :action => 'revision'
238 :action => 'revision'
239 repository_views.connect 'projects/:id/repository/revisions/:rev/diff',
239 repository_views.connect 'projects/:id/repository/revisions/:rev/diff',
240 :action => 'diff'
240 :action => 'diff'
241 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format',
241 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format',
242 :action => 'diff'
242 :action => 'diff'
243 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path',
243 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path',
244 :action => 'entry',
244 :action => 'entry',
245 :format => 'raw',
245 :format => 'raw',
246 :requirements => { :rev => /[a-z0-9\.\-_]+/ }
246 :requirements => { :rev => /[a-z0-9\.\-_]+/ }
247 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path',
247 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path',
248 :requirements => { :rev => /[a-z0-9\.\-_]+/ }
248 :requirements => { :rev => /[a-z0-9\.\-_]+/ }
249
249
250 repository_views.connect 'projects/:id/repository/raw/*path',
250 repository_views.connect 'projects/:id/repository/raw/*path',
251 :action => 'entry', :format => 'raw'
251 :action => 'entry', :format => 'raw'
252 repository_views.connect 'projects/:id/repository/browse/*path',
252 repository_views.connect 'projects/:id/repository/browse/*path',
253 :action => 'browse'
253 :action => 'browse'
254 repository_views.connect 'projects/:id/repository/entry/*path',
254 repository_views.connect 'projects/:id/repository/entry/*path',
255 :action => 'entry'
255 :action => 'entry'
256 repository_views.connect 'projects/:id/repository/changes/*path',
256 repository_views.connect 'projects/:id/repository/changes/*path',
257 :action => 'changes'
257 :action => 'changes'
258 repository_views.connect 'projects/:id/repository/annotate/*path',
258 repository_views.connect 'projects/:id/repository/annotate/*path',
259 :action => 'annotate'
259 :action => 'annotate'
260 repository_views.connect 'projects/:id/repository/diff/*path',
260 repository_views.connect 'projects/:id/repository/diff/*path',
261 :action => 'diff'
261 :action => 'diff'
262 repository_views.connect 'projects/:id/repository/show/*path',
262 repository_views.connect 'projects/:id/repository/show/*path',
263 :action => 'show'
263 :action => 'show'
264 repository_views.connect 'projects/:id/repository/graph',
264 repository_views.connect 'projects/:id/repository/graph',
265 :action => 'graph'
265 :action => 'graph'
266 end
266 end
267
267
268 repositories.connect 'projects/:id/repository/revision',
268 repositories.connect 'projects/:id/repository/revision',
269 :action => 'revision',
269 :action => 'revision',
270 :conditions => {:method => [:get, :post]}
270 :conditions => {:method => [:get, :post]}
271
271
272 repositories.connect 'projects/:id/repository/committers',
272 repositories.connect 'projects/:id/repository/committers',
273 :action => 'committers',
273 :action => 'committers',
274 :conditions => {:method => [:get, :post]}
274 :conditions => {:method => [:get, :post]}
275 repositories.connect 'projects/:id/repository/edit',
275 repositories.connect 'projects/:id/repository/edit',
276 :action => 'edit',
276 :action => 'edit',
277 :conditions => {:method => [:get, :post]}
277 :conditions => {:method => [:get, :post]}
278 repositories.connect 'projects/:id/repository/destroy',
278 repositories.connect 'projects/:id/repository/destroy',
279 :action => 'destroy',
279 :action => 'destroy',
280 :conditions => {:method => :post}
280 :conditions => {:method => :post}
281 end
281 end
282
282
283 # additional routes for having the file name at the end of url
283 # additional routes for having the file name at the end of url
284 map.connect 'attachments/:id/:filename', :controller => 'attachments',
284 map.connect 'attachments/:id/:filename', :controller => 'attachments',
285 :action => 'show', :id => /\d+/, :filename => /.*/,
285 :action => 'show', :id => /\d+/, :filename => /.*/,
286 :conditions => {:method => :get}
286 :conditions => {:method => :get}
287 map.connect 'attachments/download/:id/:filename', :controller => 'attachments',
287 map.connect 'attachments/download/:id/:filename', :controller => 'attachments',
288 :action => 'download', :id => /\d+/, :filename => /.*/,
288 :action => 'download', :id => /\d+/, :filename => /.*/,
289 :conditions => {:method => :get}
289 :conditions => {:method => :get}
290 map.connect 'attachments/download/:id', :controller => 'attachments',
290 map.connect 'attachments/download/:id', :controller => 'attachments',
291 :action => 'download', :id => /\d+/,
291 :action => 'download', :id => /\d+/,
292 :conditions => {:method => :get}
292 :conditions => {:method => :get}
293 map.resources :attachments, :only => [:show, :destroy]
293 map.resources :attachments, :only => [:show, :destroy]
294
294
295 map.resources :groups, :member => {:autocomplete_for_user => :get}
295 map.resources :groups, :member => {:autocomplete_for_user => :get}
296 map.group_users 'groups/:id/users', :controller => 'groups',
296 map.group_users 'groups/:id/users', :controller => 'groups',
297 :action => 'add_users', :id => /\d+/,
297 :action => 'add_users', :id => /\d+/,
298 :conditions => {:method => :post}
298 :conditions => {:method => :post}
299 map.group_user 'groups/:id/users/:user_id', :controller => 'groups',
299 map.group_user 'groups/:id/users/:user_id', :controller => 'groups',
300 :action => 'remove_user', :id => /\d+/,
300 :action => 'remove_user', :id => /\d+/,
301 :conditions => {:method => :delete}
301 :conditions => {:method => :delete}
302 map.connect 'groups/destroy_membership/:id', :controller => 'groups',
302 map.connect 'groups/destroy_membership/:id', :controller => 'groups',
303 :action => 'destroy_membership', :id => /\d+/,
303 :action => 'destroy_membership', :id => /\d+/,
304 :conditions => {:method => :post}
304 :conditions => {:method => :post}
305 map.connect 'groups/edit_membership/:id', :controller => 'groups',
305 map.connect 'groups/edit_membership/:id', :controller => 'groups',
306 :action => 'edit_membership', :id => /\d+/,
306 :action => 'edit_membership', :id => /\d+/,
307 :conditions => {:method => :post}
307 :conditions => {:method => :post}
308
308
309 map.resources :trackers, :except => :show
309 map.resources :trackers, :except => :show
310 map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
310 map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
311 map.resources :custom_fields, :except => :show
311 map.resources :custom_fields, :except => :show
312 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
312 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
313 map.resources :enumerations, :except => :show
313 map.resources :enumerations, :except => :show
314
314
315 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
315 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
316
316
317 map.connect 'mail_handler', :controller => 'mail_handler',
317 map.connect 'mail_handler', :controller => 'mail_handler',
318 :action => 'index', :conditions => {:method => :post}
318 :action => 'index', :conditions => {:method => :post}
319
319
320 map.connect 'admin', :controller => 'admin', :action => 'index',
320 map.connect 'admin', :controller => 'admin', :action => 'index',
321 :conditions => {:method => :get}
321 :conditions => {:method => :get}
322 map.connect 'admin/projects', :controller => 'admin', :action => 'projects',
322 map.connect 'admin/projects', :controller => 'admin', :action => 'projects',
323 :conditions => {:method => :get}
323 :conditions => {:method => :get}
324 map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins',
324 map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins',
325 :conditions => {:method => :get}
325 :conditions => {:method => :get}
326 map.connect 'admin/info', :controller => 'admin', :action => 'info',
326 map.connect 'admin/info', :controller => 'admin', :action => 'info',
327 :conditions => {:method => :get}
327 :conditions => {:method => :get}
328 map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email',
328 map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email',
329 :conditions => {:method => :get}
329 :conditions => {:method => :get}
330 map.connect 'admin/default_configuration', :controller => 'admin',
330 map.connect 'admin/default_configuration', :controller => 'admin',
331 :action => 'default_configuration', :conditions => {:method => :post}
331 :action => 'default_configuration', :conditions => {:method => :post}
332
332
333 # Used by AuthSourcesControllerTest
333 # Used by AuthSourcesControllerTest
334 # TODO : refactor *AuthSourcesController to remove these routes
334 # TODO : refactor *AuthSourcesController to remove these routes
335 map.connect 'auth_sources', :controller => 'auth_sources',
335 map.connect 'auth_sources', :controller => 'auth_sources',
336 :action => 'index', :conditions => {:method => :get}
336 :action => 'index', :conditions => {:method => :get}
337 map.connect 'auth_sources/new', :controller => 'auth_sources',
337 map.connect 'auth_sources/new', :controller => 'auth_sources',
338 :action => 'new', :conditions => {:method => :get}
338 :action => 'new', :conditions => {:method => :get}
339 map.connect 'auth_sources/create', :controller => 'auth_sources',
339 map.connect 'auth_sources/create', :controller => 'auth_sources',
340 :action => 'create', :conditions => {:method => :post}
340 :action => 'create', :conditions => {:method => :post}
341 map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources',
341 map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources',
342 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
342 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
343 map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources',
343 map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources',
344 :action => 'test_connection', :conditions => {:method => :get}
344 :action => 'test_connection', :conditions => {:method => :get}
345 map.connect 'auth_sources/edit/:id', :controller => 'auth_sources',
345 map.connect 'auth_sources/edit/:id', :controller => 'auth_sources',
346 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
346 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
347 map.connect 'auth_sources/update/:id', :controller => 'auth_sources',
347 map.connect 'auth_sources/update/:id', :controller => 'auth_sources',
348 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
348 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
349
349
350 map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources',
350 map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources',
351 :action => 'index', :conditions => {:method => :get}
351 :action => 'index', :conditions => {:method => :get}
352 map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources',
352 map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources',
353 :action => 'new', :conditions => {:method => :get}
353 :action => 'new', :conditions => {:method => :get}
354 map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources',
354 map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources',
355 :action => 'create', :conditions => {:method => :post}
355 :action => 'create', :conditions => {:method => :post}
356 map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources',
356 map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources',
357 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
357 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
358 map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources',
358 map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources',
359 :action => 'test_connection', :conditions => {:method => :get}
359 :action => 'test_connection', :conditions => {:method => :get}
360 map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources',
360 map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources',
361 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
361 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
362 map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources',
362 map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources',
363 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
363 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
364
364
365 map.connect 'workflows', :controller => 'workflows',
365 map.connect 'workflows', :controller => 'workflows',
366 :action => 'index', :conditions => {:method => :get}
366 :action => 'index', :conditions => {:method => :get}
367 map.connect 'workflows/edit', :controller => 'workflows',
367 map.connect 'workflows/edit', :controller => 'workflows',
368 :action => 'edit', :conditions => {:method => [:get, :post]}
368 :action => 'edit', :conditions => {:method => [:get, :post]}
369 map.connect 'workflows/copy', :controller => 'workflows',
369 map.connect 'workflows/copy', :controller => 'workflows',
370 :action => 'copy', :conditions => {:method => [:get, :post]}
370 :action => 'copy', :conditions => {:method => [:get, :post]}
371
371
372 map.connect 'settings', :controller => 'settings',
372 map.connect 'settings', :controller => 'settings',
373 :action => 'index', :conditions => {:method => :get}
373 :action => 'index', :conditions => {:method => :get}
374 map.connect 'settings/edit', :controller => 'settings',
374 map.connect 'settings/edit', :controller => 'settings',
375 :action => 'edit', :conditions => {:method => [:get, :post]}
375 :action => 'edit', :conditions => {:method => [:get, :post]}
376 map.connect 'settings/plugin/:id', :controller => 'settings',
376 map.connect 'settings/plugin/:id', :controller => 'settings',
377 :action => 'plugin', :conditions => {:method => [:get, :post]}
377 :action => 'plugin', :conditions => {:method => [:get, :post]}
378
378
379 map.with_options :controller => 'sys' do |sys|
379 map.with_options :controller => 'sys' do |sys|
380 sys.connect 'sys/projects.:format',
380 sys.connect 'sys/projects.:format',
381 :action => 'projects',
381 :action => 'projects',
382 :conditions => {:method => :get}
382 :conditions => {:method => :get}
383 sys.connect 'sys/projects/:id/repository.:format',
383 sys.connect 'sys/projects/:id/repository.:format',
384 :action => 'create_project_repository',
384 :action => 'create_project_repository',
385 :conditions => {:method => :post}
385 :conditions => {:method => :post}
386 sys.connect 'sys/fetch_changesets',
386 sys.connect 'sys/fetch_changesets',
387 :action => 'fetch_changesets',
387 :action => 'fetch_changesets',
388 :conditions => {:method => :get}
388 :conditions => {:method => :get}
389 end
389 end
390
390
391 map.connect 'robots.txt', :controller => 'welcome',
391 map.connect 'robots.txt', :controller => 'welcome',
392 :action => 'robots', :conditions => {:method => :get}
392 :action => 'robots', :conditions => {:method => :get}
393
393
394 # Used for OpenID
394 # Used for OpenID
395 map.root :controller => 'account', :action => 'login'
395 map.root :controller => 'account', :action => 'login'
396 end
396 end
General Comments 0
You need to be logged in to leave comments. Login now