@@ -1,260 +1,260 | |||
|
1 | 1 | ActionController::Routing::Routes.draw do |map| |
|
2 | 2 | # Add your own custom routes here. |
|
3 | 3 | # The priority is based upon order of creation: first created -> highest priority. |
|
4 | 4 | |
|
5 | 5 | # Here's a sample route: |
|
6 | 6 | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' |
|
7 | 7 | # Keep in mind you can assign values other than :controller and :action |
|
8 | 8 | |
|
9 | 9 | # Allow Redmine plugins to map routes and potentially override them |
|
10 | 10 | Rails.plugins.each do |plugin| |
|
11 | 11 | map.from_plugin plugin.name.to_sym |
|
12 | 12 | end |
|
13 | 13 | |
|
14 | 14 | map.home '', :controller => 'welcome' |
|
15 | 15 | |
|
16 | 16 | map.signin 'login', :controller => 'account', :action => 'login' |
|
17 | 17 | map.signout 'logout', :controller => 'account', :action => 'logout' |
|
18 | 18 | |
|
19 | 19 | map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' |
|
20 | 20 | map.connect 'help/:ctrl/:page', :controller => 'help' |
|
21 | 21 | |
|
22 | 22 | map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog' |
|
23 | 23 | map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog' |
|
24 | 24 | map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog' |
|
25 | 25 | |
|
26 | 26 | map.with_options :controller => 'timelog' do |timelog| |
|
27 | 27 | timelog.connect 'projects/:project_id/time_entries', :action => 'details' |
|
28 | 28 | |
|
29 | 29 | timelog.with_options :action => 'details', :conditions => {:method => :get} do |time_details| |
|
30 | 30 | time_details.connect 'time_entries' |
|
31 | 31 | time_details.connect 'time_entries.:format' |
|
32 | 32 | time_details.connect 'issues/:issue_id/time_entries' |
|
33 | 33 | time_details.connect 'issues/:issue_id/time_entries.:format' |
|
34 | 34 | time_details.connect 'projects/:project_id/time_entries.:format' |
|
35 | 35 | time_details.connect 'projects/:project_id/issues/:issue_id/time_entries' |
|
36 | 36 | time_details.connect 'projects/:project_id/issues/:issue_id/time_entries.:format' |
|
37 | 37 | end |
|
38 | 38 | timelog.connect 'projects/:project_id/time_entries/report', :action => 'report' |
|
39 | 39 | timelog.with_options :action => 'report',:conditions => {:method => :get} do |time_report| |
|
40 | 40 | time_report.connect 'time_entries/report' |
|
41 | 41 | time_report.connect 'time_entries/report.:format' |
|
42 | 42 | time_report.connect 'projects/:project_id/time_entries/report.:format' |
|
43 | 43 | end |
|
44 | 44 | |
|
45 | 45 | timelog.with_options :action => 'edit', :conditions => {:method => :get} do |time_edit| |
|
46 | 46 | time_edit.connect 'issues/:issue_id/time_entries/new' |
|
47 | 47 | end |
|
48 | 48 | |
|
49 | 49 | timelog.connect 'time_entries/:id/destroy', :action => 'destroy', :conditions => {:method => :post} |
|
50 | 50 | end |
|
51 | 51 | |
|
52 | 52 | map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} |
|
53 | 53 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get} |
|
54 | 54 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post} |
|
55 | 55 | map.with_options :controller => 'wiki' do |wiki_routes| |
|
56 | 56 | wiki_routes.with_options :conditions => {:method => :get} do |wiki_views| |
|
57 | 57 | wiki_views.connect 'projects/:id/wiki/:page', :action => 'special', :page => /page_index|date_index|export/i |
|
58 | 58 | wiki_views.connect 'projects/:id/wiki/:page', :action => 'index', :page => nil |
|
59 | 59 | wiki_views.connect 'projects/:id/wiki/:page/edit', :action => 'edit' |
|
60 | 60 | wiki_views.connect 'projects/:id/wiki/:page/rename', :action => 'rename' |
|
61 | 61 | wiki_views.connect 'projects/:id/wiki/:page/history', :action => 'history' |
|
62 | 62 | wiki_views.connect 'projects/:id/wiki/:page/diff/:version/vs/:version_from', :action => 'diff' |
|
63 | 63 | wiki_views.connect 'projects/:id/wiki/:page/annotate/:version', :action => 'annotate' |
|
64 | 64 | end |
|
65 | 65 | |
|
66 | 66 | wiki_routes.connect 'projects/:id/wiki/:page/:action', |
|
67 | 67 | :action => /edit|rename|destroy|preview|protect/, |
|
68 | 68 | :conditions => {:method => :post} |
|
69 | 69 | end |
|
70 | 70 | |
|
71 | 71 | map.with_options :controller => 'messages' do |messages_routes| |
|
72 | 72 | messages_routes.with_options :conditions => {:method => :get} do |messages_views| |
|
73 | 73 | messages_views.connect 'boards/:board_id/topics/new', :action => 'new' |
|
74 | 74 | messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' |
|
75 | 75 | messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' |
|
76 | 76 | end |
|
77 | 77 | messages_routes.with_options :conditions => {:method => :post} do |messages_actions| |
|
78 | 78 | messages_actions.connect 'boards/:board_id/topics/new', :action => 'new' |
|
79 | 79 | messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply' |
|
80 | 80 | messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/ |
|
81 | 81 | end |
|
82 | 82 | end |
|
83 | 83 | |
|
84 | 84 | map.with_options :controller => 'boards' do |board_routes| |
|
85 | 85 | board_routes.with_options :conditions => {:method => :get} do |board_views| |
|
86 | 86 | board_views.connect 'projects/:project_id/boards', :action => 'index' |
|
87 | 87 | board_views.connect 'projects/:project_id/boards/new', :action => 'new' |
|
88 | 88 | board_views.connect 'projects/:project_id/boards/:id', :action => 'show' |
|
89 | 89 | board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit' |
|
90 | 90 | end |
|
91 | 91 | board_routes.with_options :conditions => {:method => :post} do |board_actions| |
|
92 | 92 | board_actions.connect 'projects/:project_id/boards', :action => 'new' |
|
93 | 93 | board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/ |
|
94 | 94 | end |
|
95 | 95 | end |
|
96 | 96 | |
|
97 | 97 | map.with_options :controller => 'documents' do |document_routes| |
|
98 | 98 | document_routes.with_options :conditions => {:method => :get} do |document_views| |
|
99 | 99 | document_views.connect 'projects/:project_id/documents', :action => 'index' |
|
100 | 100 | document_views.connect 'projects/:project_id/documents/new', :action => 'new' |
|
101 | 101 | document_views.connect 'documents/:id', :action => 'show' |
|
102 | 102 | document_views.connect 'documents/:id/edit', :action => 'edit' |
|
103 | 103 | end |
|
104 | 104 | document_routes.with_options :conditions => {:method => :post} do |document_actions| |
|
105 | 105 | document_actions.connect 'projects/:project_id/documents', :action => 'new' |
|
106 | 106 | document_actions.connect 'documents/:id/:action', :action => /destroy|edit/ |
|
107 | 107 | end |
|
108 | 108 | end |
|
109 | 109 | |
|
110 | 110 | map.with_options :controller => 'issues' do |issues_routes| |
|
111 | 111 | issues_routes.with_options :conditions => {:method => :get} do |issues_views| |
|
112 | 112 | issues_views.connect 'issues', :action => 'index' |
|
113 | 113 | issues_views.connect 'issues.:format', :action => 'index' |
|
114 | 114 | issues_views.connect 'projects/:project_id/issues', :action => 'index' |
|
115 | 115 | issues_views.connect 'projects/:project_id/issues.:format', :action => 'index' |
|
116 | 116 | issues_views.connect 'projects/:project_id/issues/new', :action => 'new' |
|
117 | 117 | issues_views.connect 'projects/:project_id/issues/gantt', :action => 'gantt' |
|
118 | 118 | issues_views.connect 'projects/:project_id/issues/calendar', :action => 'calendar' |
|
119 | 119 | issues_views.connect 'projects/:project_id/issues/:copy_from/copy', :action => 'new' |
|
120 | 120 | issues_views.connect 'issues/:id', :action => 'show', :id => /\d+/ |
|
121 | 121 | issues_views.connect 'issues/:id.:format', :action => 'show', :id => /\d+/ |
|
122 | 122 | issues_views.connect 'issues/:id/edit', :action => 'edit', :id => /\d+/ |
|
123 | 123 | issues_views.connect 'issues/:id/move', :action => 'move', :id => /\d+/ |
|
124 | 124 | end |
|
125 | 125 | issues_routes.with_options :conditions => {:method => :post} do |issues_actions| |
|
126 | 126 | issues_actions.connect 'projects/:project_id/issues', :action => 'new' |
|
127 | 127 | issues_actions.connect 'issues/:id/quoted', :action => 'reply', :id => /\d+/ |
|
128 | 128 | issues_actions.connect 'issues/:id/:action', :action => /edit|move|destroy/, :id => /\d+/ |
|
129 | 129 | end |
|
130 | 130 | issues_routes.connect 'issues/:action' |
|
131 | 131 | end |
|
132 | 132 | |
|
133 | 133 | map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations| |
|
134 | 134 | relations.connect 'issues/:issue_id/relations/:id', :action => 'new' |
|
135 | 135 | relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy' |
|
136 | 136 | end |
|
137 | 137 | |
|
138 | 138 | map.with_options :controller => 'reports', :action => 'issue_report', :conditions => {:method => :get} do |reports| |
|
139 | 139 | reports.connect 'projects/:id/issues/report' |
|
140 | 140 | reports.connect 'projects/:id/issues/report/:detail' |
|
141 | 141 | end |
|
142 | 142 | |
|
143 | 143 | map.with_options :controller => 'news' do |news_routes| |
|
144 | 144 | news_routes.with_options :conditions => {:method => :get} do |news_views| |
|
145 | 145 | news_views.connect 'news', :action => 'index' |
|
146 | 146 | news_views.connect 'projects/:project_id/news', :action => 'index' |
|
147 | 147 | news_views.connect 'projects/:project_id/news.:format', :action => 'index' |
|
148 | 148 | news_views.connect 'news.:format', :action => 'index' |
|
149 | 149 | news_views.connect 'projects/:project_id/news/new', :action => 'new' |
|
150 | 150 | news_views.connect 'news/:id', :action => 'show' |
|
151 | 151 | news_views.connect 'news/:id/edit', :action => 'edit' |
|
152 | 152 | end |
|
153 | 153 | news_routes.with_options do |news_actions| |
|
154 | 154 | news_actions.connect 'projects/:project_id/news', :action => 'new' |
|
155 | 155 | news_actions.connect 'news/:id/edit', :action => 'edit' |
|
156 | 156 | news_actions.connect 'news/:id/destroy', :action => 'destroy' |
|
157 | 157 | end |
|
158 | 158 | end |
|
159 | 159 | |
|
160 | 160 | map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new' |
|
161 | 161 | |
|
162 | 162 | map.with_options :controller => 'users' do |users| |
|
163 | 163 | users.with_options :conditions => {:method => :get} do |user_views| |
|
164 | 164 | user_views.connect 'users', :action => 'list' |
|
165 | 165 | user_views.connect 'users', :action => 'index' |
|
166 | 166 | user_views.connect 'users/new', :action => 'add' |
|
167 | 167 | user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil |
|
168 | 168 | end |
|
169 | 169 | users.with_options :conditions => {:method => :post} do |user_actions| |
|
170 | 170 | user_actions.connect 'users', :action => 'add' |
|
171 | 171 | user_actions.connect 'users/new', :action => 'add' |
|
172 | 172 | user_actions.connect 'users/:id/edit', :action => 'edit' |
|
173 | 173 | user_actions.connect 'users/:id/memberships', :action => 'edit_membership' |
|
174 | 174 | user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership' |
|
175 | 175 | user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership' |
|
176 | 176 | end |
|
177 | 177 | end |
|
178 | 178 | |
|
179 | 179 | map.with_options :controller => 'projects' do |projects| |
|
180 | 180 | projects.with_options :conditions => {:method => :get} do |project_views| |
|
181 | 181 | project_views.connect 'projects', :action => 'index' |
|
182 | 182 | project_views.connect 'projects.:format', :action => 'index' |
|
183 | 183 | project_views.connect 'projects/new', :action => 'add' |
|
184 | 184 | project_views.connect 'projects/:id', :action => 'show' |
|
185 | 185 | project_views.connect 'projects/:id/:action', :action => /roadmap|changelog|destroy|settings/ |
|
186 | 186 | project_views.connect 'projects/:id/files', :action => 'list_files' |
|
187 | 187 | project_views.connect 'projects/:id/files/new', :action => 'add_file' |
|
188 | 188 | project_views.connect 'projects/:id/versions/new', :action => 'add_version' |
|
189 | 189 | project_views.connect 'projects/:id/categories/new', :action => 'add_issue_category' |
|
190 | 190 | project_views.connect 'projects/:id/settings/:tab', :action => 'settings' |
|
191 | 191 | end |
|
192 | 192 | |
|
193 | 193 | projects.with_options :action => 'activity', :conditions => {:method => :get} do |activity| |
|
194 | 194 | activity.connect 'projects/:id/activity' |
|
195 | 195 | activity.connect 'projects/:id/activity.:format' |
|
196 | 196 | activity.connect 'activity', :id => nil |
|
197 | 197 | activity.connect 'activity.:format', :id => nil |
|
198 | 198 | end |
|
199 | 199 | |
|
200 | 200 | projects.with_options :conditions => {:method => :post} do |project_actions| |
|
201 | 201 | project_actions.connect 'projects/new', :action => 'add' |
|
202 | 202 | project_actions.connect 'projects', :action => 'add' |
|
203 | 203 | project_actions.connect 'projects/:id/:action', :action => /destroy|archive|unarchive/ |
|
204 | 204 | project_actions.connect 'projects/:id/files/new', :action => 'add_file' |
|
205 | 205 | project_actions.connect 'projects/:id/versions/new', :action => 'add_version' |
|
206 | 206 | project_actions.connect 'projects/:id/categories/new', :action => 'add_issue_category' |
|
207 | 207 | end |
|
208 | 208 | end |
|
209 | 209 | |
|
210 | 210 | map.with_options :controller => 'repositories' do |repositories| |
|
211 | 211 | repositories.with_options :conditions => {:method => :get} do |repository_views| |
|
212 | 212 | repository_views.connect 'projects/:id/repository', :action => 'show' |
|
213 | 213 | repository_views.connect 'projects/:id/repository/edit', :action => 'edit' |
|
214 | 214 | repository_views.connect 'projects/:id/repository/statistics', :action => 'stats' |
|
215 | 215 | repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions' |
|
216 | 216 | repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions' |
|
217 | 217 | repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' |
|
218 | 218 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' |
|
219 | 219 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' |
|
220 | 220 | repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path' |
|
221 | 221 | repository_views.connect 'projects/:id/repository/:action/*path' |
|
222 | 222 | end |
|
223 | 223 | |
|
224 |
repositories.connect 'projects/:id/repository/ |
|
|
224 | repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post} | |
|
225 | 225 | end |
|
226 | 226 | |
|
227 | 227 | map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/ |
|
228 | 228 | map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/ |
|
229 | 229 | map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/ |
|
230 | 230 | |
|
231 | 231 | |
|
232 | 232 | #left old routes at the bottom for backwards compat |
|
233 | 233 | map.connect 'projects/:project_id/issues/:action', :controller => 'issues' |
|
234 | 234 | map.connect 'projects/:project_id/documents/:action', :controller => 'documents' |
|
235 | 235 | map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards' |
|
236 | 236 | map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages' |
|
237 | 237 | map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki' |
|
238 | 238 | map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations' |
|
239 | 239 | map.connect 'projects/:project_id/news/:action', :controller => 'news' |
|
240 | 240 | map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/ |
|
241 | 241 | map.with_options :controller => 'repositories' do |omap| |
|
242 | 242 | omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse' |
|
243 | 243 | omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes' |
|
244 | 244 | omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff' |
|
245 | 245 | omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry' |
|
246 | 246 | omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate' |
|
247 | 247 | omap.connect 'repositories/revision/:id/:rev', :action => 'revision' |
|
248 | 248 | end |
|
249 | 249 | |
|
250 | 250 | map.with_options :controller => 'sys' do |sys| |
|
251 | 251 | sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get} |
|
252 | 252 | sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post} |
|
253 | 253 | end |
|
254 | 254 | |
|
255 | 255 | # Install the default route as the lowest priority. |
|
256 | 256 | map.connect ':controller/:action/:id' |
|
257 | 257 | map.connect 'robots.txt', :controller => 'welcome', :action => 'robots' |
|
258 | 258 | # Used for OpenID |
|
259 | 259 | map.root :controller => 'account', :action => 'login' |
|
260 | 260 | end |
General Comments 0
You need to be logged in to leave comments.
Login now