##// END OF EJS Templates
Refactor: add VersionsController#status_by to the resource....
Eric Davis -
r3984:5fdfe02b3a3e
parent child
Show More
@@ -1,35 +1,35
1 <form id="status_by_form">
1 <form id="status_by_form">
2 <fieldset>
2 <fieldset>
3 <legend>
3 <legend>
4 <%= l(:label_issues_by,
4 <%= l(:label_issues_by,
5 select_tag('status_by',
5 select_tag('status_by',
6 status_by_options_for_select(criteria),
6 status_by_options_for_select(criteria),
7 :id => 'status_by_select',
7 :id => 'status_by_select',
8 :onchange => remote_function(:url => { :action => :status_by, :id => version },
8 :onchange => remote_function(:url => status_by_project_version_path(version.project, version),
9 :with => "Form.serialize('status_by_form')"))) %>
9 :with => "Form.serialize('status_by_form')"))) %>
10 </legend>
10 </legend>
11 <% if counts.empty? %>
11 <% if counts.empty? %>
12 <p><em><%= l(:label_no_data) %></em></p>
12 <p><em><%= l(:label_no_data) %></em></p>
13 <% else %>
13 <% else %>
14 <table>
14 <table>
15 <% counts.each do |count| %>
15 <% counts.each do |count| %>
16 <tr>
16 <tr>
17 <td width="130px" align="right" >
17 <td width="130px" align="right" >
18 <%= link_to count[:group], {:controller => 'issues',
18 <%= link_to count[:group], {:controller => 'issues',
19 :action => 'index',
19 :action => 'index',
20 :project_id => version.project,
20 :project_id => version.project,
21 :set_filter => 1,
21 :set_filter => 1,
22 :fixed_version_id => version,
22 :fixed_version_id => version,
23 "#{criteria}_id" => count[:group]} %>
23 "#{criteria}_id" => count[:group]} %>
24 </td>
24 </td>
25 <td width="240px">
25 <td width="240px">
26 <%= progress_bar((count[:closed].to_f / count[:total])*100,
26 <%= progress_bar((count[:closed].to_f / count[:total])*100,
27 :legend => "#{count[:closed]}/#{count[:total]}",
27 :legend => "#{count[:closed]}/#{count[:total]}",
28 :width => "#{(count[:total].to_f / max * 200).floor}px;") %>
28 :width => "#{(count[:total].to_f / max * 200).floor}px;") %>
29 </td>
29 </td>
30 </tr>
30 </tr>
31 <% end %>
31 <% end %>
32 </table>
32 </table>
33 <% end %>
33 <% end %>
34 </fieldset>
34 </fieldset>
35 </form>
35 </form>
@@ -1,269 +1,269
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'
9 map.home '', :controller => 'welcome'
10
10
11 map.signin 'login', :controller => 'account', :action => 'login'
11 map.signin 'login', :controller => 'account', :action => 'login'
12 map.signout 'logout', :controller => 'account', :action => 'logout'
12 map.signout 'logout', :controller => 'account', :action => 'logout'
13
13
14 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
14 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
15 map.connect 'help/:ctrl/:page', :controller => 'help'
15 map.connect 'help/:ctrl/:page', :controller => 'help'
16
16
17 map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
17 map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
18 map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
18 map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
19 map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
19 map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
20
20
21 map.with_options :controller => 'timelog' do |timelog|
21 map.with_options :controller => 'timelog' do |timelog|
22 timelog.connect 'projects/:project_id/time_entries', :action => 'details'
22 timelog.connect 'projects/:project_id/time_entries', :action => 'details'
23
23
24 timelog.with_options :action => 'details', :conditions => {:method => :get} do |time_details|
24 timelog.with_options :action => 'details', :conditions => {:method => :get} do |time_details|
25 time_details.connect 'time_entries'
25 time_details.connect 'time_entries'
26 time_details.connect 'time_entries.:format'
26 time_details.connect 'time_entries.:format'
27 time_details.connect 'issues/:issue_id/time_entries'
27 time_details.connect 'issues/:issue_id/time_entries'
28 time_details.connect 'issues/:issue_id/time_entries.:format'
28 time_details.connect 'issues/:issue_id/time_entries.:format'
29 time_details.connect 'projects/:project_id/time_entries.:format'
29 time_details.connect 'projects/:project_id/time_entries.:format'
30 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries'
30 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries'
31 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries.:format'
31 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries.:format'
32 end
32 end
33 timelog.connect 'projects/:project_id/time_entries/report', :action => 'report'
33 timelog.connect 'projects/:project_id/time_entries/report', :action => 'report'
34 timelog.with_options :action => 'report',:conditions => {:method => :get} do |time_report|
34 timelog.with_options :action => 'report',:conditions => {:method => :get} do |time_report|
35 time_report.connect 'time_entries/report'
35 time_report.connect 'time_entries/report'
36 time_report.connect 'time_entries/report.:format'
36 time_report.connect 'time_entries/report.:format'
37 time_report.connect 'projects/:project_id/time_entries/report.:format'
37 time_report.connect 'projects/:project_id/time_entries/report.:format'
38 end
38 end
39
39
40 timelog.with_options :action => 'edit', :conditions => {:method => :get} do |time_edit|
40 timelog.with_options :action => 'edit', :conditions => {:method => :get} do |time_edit|
41 time_edit.connect 'issues/:issue_id/time_entries/new'
41 time_edit.connect 'issues/:issue_id/time_entries/new'
42 end
42 end
43
43
44 timelog.connect 'time_entries/:id/destroy', :action => 'destroy', :conditions => {:method => :post}
44 timelog.connect 'time_entries/:id/destroy', :action => 'destroy', :conditions => {:method => :post}
45 end
45 end
46
46
47 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
47 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
48 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get}
48 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get}
49 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post}
49 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post}
50 map.with_options :controller => 'wiki' do |wiki_routes|
50 map.with_options :controller => 'wiki' do |wiki_routes|
51 wiki_routes.with_options :conditions => {:method => :get} do |wiki_views|
51 wiki_routes.with_options :conditions => {:method => :get} do |wiki_views|
52 wiki_views.connect 'projects/:id/wiki/:page', :action => 'special', :page => /page_index|date_index|export/i
52 wiki_views.connect 'projects/:id/wiki/:page', :action => 'special', :page => /page_index|date_index|export/i
53 wiki_views.connect 'projects/:id/wiki/:page', :action => 'index', :page => nil
53 wiki_views.connect 'projects/:id/wiki/:page', :action => 'index', :page => nil
54 wiki_views.connect 'projects/:id/wiki/:page/edit', :action => 'edit'
54 wiki_views.connect 'projects/:id/wiki/:page/edit', :action => 'edit'
55 wiki_views.connect 'projects/:id/wiki/:page/rename', :action => 'rename'
55 wiki_views.connect 'projects/:id/wiki/:page/rename', :action => 'rename'
56 wiki_views.connect 'projects/:id/wiki/:page/history', :action => 'history'
56 wiki_views.connect 'projects/:id/wiki/:page/history', :action => 'history'
57 wiki_views.connect 'projects/:id/wiki/:page/diff/:version/vs/:version_from', :action => 'diff'
57 wiki_views.connect 'projects/:id/wiki/:page/diff/:version/vs/:version_from', :action => 'diff'
58 wiki_views.connect 'projects/:id/wiki/:page/annotate/:version', :action => 'annotate'
58 wiki_views.connect 'projects/:id/wiki/:page/annotate/:version', :action => 'annotate'
59 end
59 end
60
60
61 wiki_routes.connect 'projects/:id/wiki/:page/:action',
61 wiki_routes.connect 'projects/:id/wiki/:page/:action',
62 :action => /edit|rename|destroy|preview|protect/,
62 :action => /edit|rename|destroy|preview|protect/,
63 :conditions => {:method => :post}
63 :conditions => {:method => :post}
64 end
64 end
65
65
66 map.with_options :controller => 'messages' do |messages_routes|
66 map.with_options :controller => 'messages' do |messages_routes|
67 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
67 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
68 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
68 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
69 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
69 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
70 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
70 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
71 end
71 end
72 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
72 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
73 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
73 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
74 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
74 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
75 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
75 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
76 end
76 end
77 end
77 end
78
78
79 map.with_options :controller => 'boards' do |board_routes|
79 map.with_options :controller => 'boards' do |board_routes|
80 board_routes.with_options :conditions => {:method => :get} do |board_views|
80 board_routes.with_options :conditions => {:method => :get} do |board_views|
81 board_views.connect 'projects/:project_id/boards', :action => 'index'
81 board_views.connect 'projects/:project_id/boards', :action => 'index'
82 board_views.connect 'projects/:project_id/boards/new', :action => 'new'
82 board_views.connect 'projects/:project_id/boards/new', :action => 'new'
83 board_views.connect 'projects/:project_id/boards/:id', :action => 'show'
83 board_views.connect 'projects/:project_id/boards/:id', :action => 'show'
84 board_views.connect 'projects/:project_id/boards/:id.:format', :action => 'show'
84 board_views.connect 'projects/:project_id/boards/:id.:format', :action => 'show'
85 board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit'
85 board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit'
86 end
86 end
87 board_routes.with_options :conditions => {:method => :post} do |board_actions|
87 board_routes.with_options :conditions => {:method => :post} do |board_actions|
88 board_actions.connect 'projects/:project_id/boards', :action => 'new'
88 board_actions.connect 'projects/:project_id/boards', :action => 'new'
89 board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/
89 board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/
90 end
90 end
91 end
91 end
92
92
93 map.with_options :controller => 'documents' do |document_routes|
93 map.with_options :controller => 'documents' do |document_routes|
94 document_routes.with_options :conditions => {:method => :get} do |document_views|
94 document_routes.with_options :conditions => {:method => :get} do |document_views|
95 document_views.connect 'projects/:project_id/documents', :action => 'index'
95 document_views.connect 'projects/:project_id/documents', :action => 'index'
96 document_views.connect 'projects/:project_id/documents/new', :action => 'new'
96 document_views.connect 'projects/:project_id/documents/new', :action => 'new'
97 document_views.connect 'documents/:id', :action => 'show'
97 document_views.connect 'documents/:id', :action => 'show'
98 document_views.connect 'documents/:id/edit', :action => 'edit'
98 document_views.connect 'documents/:id/edit', :action => 'edit'
99 end
99 end
100 document_routes.with_options :conditions => {:method => :post} do |document_actions|
100 document_routes.with_options :conditions => {:method => :post} do |document_actions|
101 document_actions.connect 'projects/:project_id/documents', :action => 'new'
101 document_actions.connect 'projects/:project_id/documents', :action => 'new'
102 document_actions.connect 'documents/:id/:action', :action => /destroy|edit/
102 document_actions.connect 'documents/:id/:action', :action => /destroy|edit/
103 end
103 end
104 end
104 end
105
105
106 map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move'
106 map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move'
107
107
108 # Misc issue routes. TODO: move into resources
108 # Misc issue routes. TODO: move into resources
109 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues'
109 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues'
110 map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview
110 map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview
111 map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues'
111 map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues'
112 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
112 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
113 map.bulk_edit_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_edit', :conditions => { :method => :get }
113 map.bulk_edit_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_edit', :conditions => { :method => :get }
114 map.bulk_update_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_update', :conditions => { :method => :post }
114 map.bulk_update_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_update', :conditions => { :method => :post }
115 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post }
115 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post }
116 map.connect '/issues/:id/destroy', :controller => 'issues', :action => 'destroy', :conditions => { :method => :post } # legacy
116 map.connect '/issues/:id/destroy', :controller => 'issues', :action => 'destroy', :conditions => { :method => :post } # legacy
117
117
118 map.resource :gantt, :path_prefix => '/issues', :controller => 'gantts', :only => [:show, :update]
118 map.resource :gantt, :path_prefix => '/issues', :controller => 'gantts', :only => [:show, :update]
119 map.resource :gantt, :path_prefix => '/projects/:project_id/issues', :controller => 'gantts', :only => [:show, :update]
119 map.resource :gantt, :path_prefix => '/projects/:project_id/issues', :controller => 'gantts', :only => [:show, :update]
120 map.resource :calendar, :path_prefix => '/issues', :controller => 'calendars', :only => [:show, :update]
120 map.resource :calendar, :path_prefix => '/issues', :controller => 'calendars', :only => [:show, :update]
121 map.resource :calendar, :path_prefix => '/projects/:project_id/issues', :controller => 'calendars', :only => [:show, :update]
121 map.resource :calendar, :path_prefix => '/projects/:project_id/issues', :controller => 'calendars', :only => [:show, :update]
122
122
123 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
123 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
124 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
124 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
125 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
125 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
126 end
126 end
127
127
128 # Following two routes conflict with the resources because #index allows POST
128 # Following two routes conflict with the resources because #index allows POST
129 map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
129 map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
130 map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
130 map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
131
131
132 map.resources :issues, :member => { :edit => :post }, :collection => {}
132 map.resources :issues, :member => { :edit => :post }, :collection => {}
133 map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post }
133 map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post }
134
134
135 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations|
135 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations|
136 relations.connect 'issues/:issue_id/relations/:id', :action => 'new'
136 relations.connect 'issues/:issue_id/relations/:id', :action => 'new'
137 relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy'
137 relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy'
138 end
138 end
139
139
140 map.with_options :controller => 'news' do |news_routes|
140 map.with_options :controller => 'news' do |news_routes|
141 news_routes.with_options :conditions => {:method => :get} do |news_views|
141 news_routes.with_options :conditions => {:method => :get} do |news_views|
142 news_views.connect 'news', :action => 'index'
142 news_views.connect 'news', :action => 'index'
143 news_views.connect 'projects/:project_id/news', :action => 'index'
143 news_views.connect 'projects/:project_id/news', :action => 'index'
144 news_views.connect 'projects/:project_id/news.:format', :action => 'index'
144 news_views.connect 'projects/:project_id/news.:format', :action => 'index'
145 news_views.connect 'news.:format', :action => 'index'
145 news_views.connect 'news.:format', :action => 'index'
146 news_views.connect 'projects/:project_id/news/new', :action => 'new'
146 news_views.connect 'projects/:project_id/news/new', :action => 'new'
147 news_views.connect 'news/:id', :action => 'show'
147 news_views.connect 'news/:id', :action => 'show'
148 news_views.connect 'news/:id/edit', :action => 'edit'
148 news_views.connect 'news/:id/edit', :action => 'edit'
149 end
149 end
150 news_routes.with_options do |news_actions|
150 news_routes.with_options do |news_actions|
151 news_actions.connect 'projects/:project_id/news', :action => 'new'
151 news_actions.connect 'projects/:project_id/news', :action => 'new'
152 news_actions.connect 'news/:id/edit', :action => 'edit'
152 news_actions.connect 'news/:id/edit', :action => 'edit'
153 news_actions.connect 'news/:id/destroy', :action => 'destroy'
153 news_actions.connect 'news/:id/destroy', :action => 'destroy'
154 end
154 end
155 end
155 end
156
156
157 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
157 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
158
158
159 map.with_options :controller => 'users' do |users|
159 map.with_options :controller => 'users' do |users|
160 users.with_options :conditions => {:method => :get} do |user_views|
160 users.with_options :conditions => {:method => :get} do |user_views|
161 user_views.connect 'users', :action => 'index'
161 user_views.connect 'users', :action => 'index'
162 user_views.connect 'users/:id', :action => 'show', :id => /\d+/
162 user_views.connect 'users/:id', :action => 'show', :id => /\d+/
163 user_views.connect 'users/new', :action => 'add'
163 user_views.connect 'users/new', :action => 'add'
164 user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil
164 user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil
165 end
165 end
166 users.with_options :conditions => {:method => :post} do |user_actions|
166 users.with_options :conditions => {:method => :post} do |user_actions|
167 user_actions.connect 'users', :action => 'add'
167 user_actions.connect 'users', :action => 'add'
168 user_actions.connect 'users/new', :action => 'add'
168 user_actions.connect 'users/new', :action => 'add'
169 user_actions.connect 'users/:id/edit', :action => 'edit'
169 user_actions.connect 'users/:id/edit', :action => 'edit'
170 user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
170 user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
171 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership'
171 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership'
172 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership'
172 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership'
173 end
173 end
174 end
174 end
175
175
176 # For nice "roadmap" in the url for the index action
176 # For nice "roadmap" in the url for the index action
177 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
177 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
178
178
179 map.resources :projects, :member => {
179 map.resources :projects, :member => {
180 :copy => [:get, :post],
180 :copy => [:get, :post],
181 :settings => :get,
181 :settings => :get,
182 :modules => :post,
182 :modules => :post,
183 :archive => :post,
183 :archive => :post,
184 :unarchive => :post
184 :unarchive => :post
185 } do |project|
185 } do |project|
186 project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy]
186 project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy]
187 project.resources :files, :only => [:index, :new, :create]
187 project.resources :files, :only => [:index, :new, :create]
188 project.resources :versions, :collection => {:close_completed => :put}
188 project.resources :versions, :collection => {:close_completed => :put}, :member => {:status_by => :post}
189 end
189 end
190
190
191 # Destroy uses a get request to prompt the user before the actual DELETE request
191 # Destroy uses a get request to prompt the user before the actual DELETE request
192 map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get}
192 map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get}
193
193
194 # TODO: port to be part of the resources route(s)
194 # TODO: port to be part of the resources route(s)
195 map.with_options :controller => 'projects' do |project_mapper|
195 map.with_options :controller => 'projects' do |project_mapper|
196 project_mapper.with_options :conditions => {:method => :get} do |project_views|
196 project_mapper.with_options :conditions => {:method => :get} do |project_views|
197 project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings'
197 project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings'
198 project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new'
198 project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new'
199 end
199 end
200 end
200 end
201
201
202 map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity|
202 map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity|
203 activity.connect 'projects/:id/activity'
203 activity.connect 'projects/:id/activity'
204 activity.connect 'projects/:id/activity.:format'
204 activity.connect 'projects/:id/activity.:format'
205 activity.connect 'activity', :id => nil
205 activity.connect 'activity', :id => nil
206 activity.connect 'activity.:format', :id => nil
206 activity.connect 'activity.:format', :id => nil
207 end
207 end
208
208
209
209
210 map.with_options :controller => 'issue_categories' do |categories|
210 map.with_options :controller => 'issue_categories' do |categories|
211 categories.connect 'projects/:project_id/issue_categories/new', :action => 'new'
211 categories.connect 'projects/:project_id/issue_categories/new', :action => 'new'
212 end
212 end
213
213
214 map.with_options :controller => 'repositories' do |repositories|
214 map.with_options :controller => 'repositories' do |repositories|
215 repositories.with_options :conditions => {:method => :get} do |repository_views|
215 repositories.with_options :conditions => {:method => :get} do |repository_views|
216 repository_views.connect 'projects/:id/repository', :action => 'show'
216 repository_views.connect 'projects/:id/repository', :action => 'show'
217 repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
217 repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
218 repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
218 repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
219 repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
219 repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
220 repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
220 repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
221 repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
221 repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
222 repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
222 repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
223 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
223 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
224 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
224 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
225 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
225 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
226 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
226 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
227 # TODO: why the following route is required?
227 # TODO: why the following route is required?
228 repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
228 repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
229 repository_views.connect 'projects/:id/repository/:action/*path'
229 repository_views.connect 'projects/:id/repository/:action/*path'
230 end
230 end
231
231
232 repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post}
232 repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post}
233 end
233 end
234
234
235 map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/
235 map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/
236 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
236 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
237 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
237 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
238
238
239 map.resources :groups
239 map.resources :groups
240
240
241 #left old routes at the bottom for backwards compat
241 #left old routes at the bottom for backwards compat
242 map.connect 'projects/:project_id/issues/:action', :controller => 'issues'
242 map.connect 'projects/:project_id/issues/:action', :controller => 'issues'
243 map.connect 'projects/:project_id/documents/:action', :controller => 'documents'
243 map.connect 'projects/:project_id/documents/:action', :controller => 'documents'
244 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
244 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
245 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
245 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
246 map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki'
246 map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki'
247 map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations'
247 map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations'
248 map.connect 'projects/:project_id/news/:action', :controller => 'news'
248 map.connect 'projects/:project_id/news/:action', :controller => 'news'
249 map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/
249 map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/
250 map.with_options :controller => 'repositories' do |omap|
250 map.with_options :controller => 'repositories' do |omap|
251 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
251 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
252 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
252 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
253 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
253 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
254 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
254 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
255 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
255 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
256 omap.connect 'repositories/revision/:id/:rev', :action => 'revision'
256 omap.connect 'repositories/revision/:id/:rev', :action => 'revision'
257 end
257 end
258
258
259 map.with_options :controller => 'sys' do |sys|
259 map.with_options :controller => 'sys' do |sys|
260 sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get}
260 sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get}
261 sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post}
261 sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post}
262 end
262 end
263
263
264 # Install the default route as the lowest priority.
264 # Install the default route as the lowest priority.
265 map.connect ':controller/:action/:id'
265 map.connect ':controller/:action/:id'
266 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots'
266 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots'
267 # Used for OpenID
267 # Used for OpenID
268 map.root :controller => 'account', :action => 'login'
268 map.root :controller => 'account', :action => 'login'
269 end
269 end
General Comments 0
You need to be logged in to leave comments. Login now