##// END OF EJS Templates
route: split issue preview route to adding and editing...
Toshi MARUYAMA -
r8766:84dd4ecbd4a0
parent child
Show More
@@ -1,50 +1,50
1 1 <% labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
2 2 <%= error_messages_for 'issue', 'time_entry' %>
3 3 <%= render :partial => 'conflict' if @conflict %>
4 4 <div class="box">
5 5 <% if @edit_allowed || !@allowed_statuses.empty? %>
6 6 <fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend>
7 7 <div id="all_attributes">
8 8 <%= render :partial => 'form', :locals => {:f => f} %>
9 9 </div>
10 10 </fieldset>
11 11 <% end %>
12 12 <% if User.current.allowed_to?(:log_time, @project) %>
13 13 <fieldset class="tabular"><legend><%= l(:button_log_time) %></legend>
14 14 <% labelled_fields_for :time_entry, @time_entry do |time_entry| %>
15 15 <div class="splitcontentleft">
16 16 <p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time %> <%= l(:field_hours) %></p>
17 17 </div>
18 18 <div class="splitcontentright">
19 19 <p><%= time_entry.select :activity_id, activity_collection_for_select_options %></p>
20 20 </div>
21 21 <p><%= time_entry.text_field :comments, :size => 60 %></p>
22 22 <% @time_entry.custom_field_values.each do |value| %>
23 23 <p><%= custom_field_tag_with_label :time_entry, value %></p>
24 24 <% end %>
25 25 <% end %>
26 26 </fieldset>
27 27 <% end %>
28 28
29 29 <fieldset><legend><%= l(:field_notes) %></legend>
30 30 <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
31 31 <%= wikitoolbar_for 'notes' %>
32 32 <%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %>
33 33
34 34 <p><%=l(:label_attachment_plural)%><br /><%= render :partial => 'attachments/form' %></p>
35 35 </fieldset>
36 36 </div>
37 37
38 38 <%= f.hidden_field :lock_version %>
39 39 <%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
40 40 <%= submit_tag l(:button_submit) %>
41 41 <%= link_to_remote l(:label_preview),
42 { :url => preview_issue_path(:project_id => @project, :id => @issue),
42 { :url => preview_edit_issue_path(:project_id => @project, :id => @issue),
43 43 :method => 'post',
44 44 :update => 'preview',
45 45 :with => 'Form.serialize("issue-form")',
46 46 :complete => "Element.scrollTo('preview')"
47 47 }, :accesskey => accesskey(:preview) %>
48 48 <% end %>
49 49
50 50 <div id="preview" class="wiki"></div>
@@ -1,50 +1,50
1 1 <h2><%=l(:label_issue_new)%></h2>
2 2
3 3 <%= call_hook(:view_issues_new_top, {:issue => @issue}) %>
4 4
5 5 <% labelled_form_for @issue, :url => project_issues_path(@project),
6 6 :html => {:id => 'issue-form', :multipart => true} do |f| %>
7 7 <%= error_messages_for 'issue' %>
8 8 <%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %>
9 9 <div class="box tabular">
10 10 <div id="all_attributes">
11 11 <%= render :partial => 'issues/form', :locals => {:f => f} %>
12 12 </div>
13 13
14 14 <% if @copy_from && @copy_from.attachments.any? %>
15 15 <p>
16 16 <label for="copy_attachments"><%= l(:label_copy_attachments) %></label>
17 17 <%= check_box_tag 'copy_attachments', '1', @copy_attachments %>
18 18 </p>
19 19 <% end %>
20 20
21 21 <p id="attachments_form"><%= label_tag('attachments[1][file]', l(:label_attachment_plural))%><%= render :partial => 'attachments/form' %></p>
22 22
23 23 <% if @issue.safe_attribute? 'watcher_user_ids' -%>
24 24 <p id="watchers_form"><label><%= l(:label_issue_watchers) %></label>
25 25 <% @issue.project.users.sort.each do |user| -%>
26 26 <label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, @issue.watched_by?(user), :id => nil %> <%=h user %></label>
27 27 <% end -%>
28 28 </p>
29 29 <% end %>
30 30 </div>
31 31
32 32 <%= submit_tag l(:button_create) %>
33 33 <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
34 34 <%= link_to_remote l(:label_preview),
35 { :url => preview_issue_path(:project_id => @project),
35 { :url => preview_new_issue_path(:project_id => @project),
36 36 :method => 'post',
37 37 :update => 'preview',
38 38 :with => "Form.serialize('issue-form')",
39 39 :complete => "Element.scrollTo('preview')"
40 40 }, :accesskey => accesskey(:preview) %>
41 41
42 42 <%= javascript_tag "Form.Element.focus('issue_subject');" %>
43 43 <% end %>
44 44
45 45 <div id="preview" class="wiki"></div>
46 46
47 47 <% content_for :header_tags do %>
48 48 <%= stylesheet_link_tag 'scm' %>
49 49 <%= robot_exclusion_tag %>
50 50 <% end %>
@@ -1,22 +1,22
1 1 <% form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %>
2 2 <%= label_tag "notes", l(:description_notes), :class => "hidden-for-sighted" %>
3 3 <%= text_area_tag :notes, @journal.notes,
4 4 :id => "journal_#{@journal.id}_notes",
5 5 :class => 'wiki-edit',
6 6 :rows => (@journal.notes.blank? ? 10 : [[10, @journal.notes.length / 50].max, 100].min) %>
7 7 <%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %>
8 8 <p><%= submit_tag l(:button_save) %>
9 9 <%= link_to_remote l(:label_preview),
10 { :url => preview_issue_path(:project_id => @project, :id => @journal.issue),
10 { :url => preview_edit_issue_path(:project_id => @project, :id => @journal.issue),
11 11 :method => 'post',
12 12 :update => "journal_#{@journal.id}_preview",
13 13 :with => "Form.serialize('journal-#{@journal.id}-form')",
14 14 :complete => "Element.scrollTo('journal_#{@journal.id}_preview')"
15 15 }, :accesskey => accesskey(:preview) %>
16 16 |
17 17 <%= link_to l(:button_cancel), '#', :onclick => "Element.remove('journal-#{@journal.id}-form'); " +
18 18 "Element.show('journal-#{@journal.id}-notes'); return false;" %></p>
19 19
20 20 <div id="journal_<%= @journal.id %>_preview" class="wiki"></div>
21 21 <% end %>
22 22 <%= wikitoolbar_for "journal_#{@journal.id}_notes" %>
@@ -1,415 +1,417
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 map.home '', :controller => 'welcome', :conditions => {:method => :get}
10 10
11 11 map.signin 'login', :controller => 'account', :action => 'login',
12 12 :conditions => {:method => [:get, :post]}
13 13 map.signout 'logout', :controller => 'account', :action => 'logout',
14 14 :conditions => {:method => :get}
15 15 map.connect 'account/register', :controller => 'account', :action => 'register',
16 16 :conditions => {:method => [:get, :post]}
17 17 map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password',
18 18 :conditions => {:method => [:get, :post]}
19 19 map.connect 'account/activate', :controller => 'account', :action => 'activate',
20 20 :conditions => {:method => :get}
21 21
22 22 map.connect 'projects/:id/wiki', :controller => 'wikis',
23 23 :action => 'edit', :conditions => {:method => :post}
24 24 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis',
25 25 :action => 'destroy', :conditions => {:method => [:get, :post]}
26 26
27 27 map.with_options :controller => 'messages' do |messages_routes|
28 28 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
29 29 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
30 30 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
31 31 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
32 32 end
33 33 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
34 34 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
35 35 messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview'
36 36 messages_actions.connect 'boards/:board_id/topics/quote/:id', :action => 'quote'
37 37 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
38 38 messages_actions.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
39 39 messages_actions.connect 'boards/:board_id/topics/:id/destroy', :action => 'destroy'
40 40 end
41 41 end
42 42
43 43 # Misc issue routes. TODO: move into resources
44 44 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes',
45 45 :action => 'issues', :conditions => { :method => :get }
46 46 # TODO: would look nicer as /issues/:id/preview
47 map.preview_issue '/issues/preview/:id', :controller => 'previews',
48 :action => 'issue'
47 map.preview_new_issue '/issues/preview/new/:project_id', :controller => 'previews',
48 :action => 'issue'
49 map.preview_edit_issue '/issues/preview/edit/:id', :controller => 'previews',
50 :action => 'issue'
49 51 map.issues_context_menu '/issues/context_menu',
50 52 :controller => 'context_menus', :action => 'issues'
51 53
52 54 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
53 55 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new',
54 56 :id => /\d+/, :conditions => { :method => :post }
55 57
56 58 map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff',
57 59 :id => /\d+/, :conditions => { :method => :get }
58 60 map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit',
59 61 :id => /\d+/, :conditions => { :method => [:get, :post] }
60 62
61 63 map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes|
62 64 gantts_routes.connect '/projects/:project_id/issues/gantt'
63 65 gantts_routes.connect '/projects/:project_id/issues/gantt.:format'
64 66 gantts_routes.connect '/issues/gantt.:format'
65 67 end
66 68
67 69 map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes|
68 70 calendars_routes.connect '/projects/:project_id/issues/calendar'
69 71 calendars_routes.connect '/issues/calendar'
70 72 end
71 73
72 74 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
73 75 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
74 76 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
75 77 end
76 78
77 79 map.connect 'my/account', :controller => 'my', :action => 'account',
78 80 :conditions => {:method => [:get, :post]}
79 81 map.connect 'my/page', :controller => 'my', :action => 'page',
80 82 :conditions => {:method => :get}
81 83 # Redirects to my/page
82 84 map.connect 'my', :controller => 'my', :action => 'index',
83 85 :conditions => {:method => :get}
84 86 map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key',
85 87 :conditions => {:method => :post}
86 88 map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key',
87 89 :conditions => {:method => :post}
88 90 map.connect 'my/password', :controller => 'my', :action => 'password',
89 91 :conditions => {:method => [:get, :post]}
90 92 map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout',
91 93 :conditions => {:method => :get}
92 94 map.connect 'my/add_block', :controller => 'my', :action => 'add_block',
93 95 :conditions => {:method => :post}
94 96 map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block',
95 97 :conditions => {:method => :post}
96 98 map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks',
97 99 :conditions => {:method => :post}
98 100
99 101 map.with_options :controller => 'users' do |users|
100 102 users.user_membership 'users/:id/memberships/:membership_id',
101 103 :action => 'edit_membership',
102 104 :conditions => {:method => :put}
103 105 users.connect 'users/:id/memberships/:membership_id',
104 106 :action => 'destroy_membership',
105 107 :conditions => {:method => :delete}
106 108 users.user_memberships 'users/:id/memberships',
107 109 :action => 'edit_membership',
108 110 :conditions => {:method => :post}
109 111 end
110 112 map.resources :users
111 113
112 114 # For nice "roadmap" in the url for the index action
113 115 map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index'
114 116
115 117 map.preview_news '/news/preview', :controller => 'previews', :action => 'news'
116 118 map.connect 'news/:id/comments', :controller => 'comments',
117 119 :action => 'create', :conditions => {:method => :post}
118 120 map.connect 'news/:id/comments/:comment_id', :controller => 'comments',
119 121 :action => 'destroy', :conditions => {:method => :delete}
120 122
121 123 map.connect 'watchers/new', :controller=> 'watchers', :action => 'new',
122 124 :conditions => {:method => :get}
123 125 map.connect 'watchers', :controller=> 'watchers', :action => 'create',
124 126 :conditions => {:method => :post}
125 127 map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy',
126 128 :conditions => {:method => :post}
127 129 map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch',
128 130 :conditions => {:method => :post}
129 131 map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch',
130 132 :conditions => {:method => :post}
131 133 map.connect 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user',
132 134 :conditions => {:method => :get}
133 135
134 136 # TODO: port to be part of the resources route(s)
135 137 map.with_options :conditions => {:method => :get} do |project_views|
136 138 project_views.connect 'projects/:id/settings/:tab',
137 139 :controller => 'projects', :action => 'settings'
138 140 project_views.connect 'projects/:project_id/issues/:copy_from/copy',
139 141 :controller => 'issues', :action => 'new'
140 142 end
141 143
142 144 map.resources :projects, :member => {
143 145 :copy => [:get, :post],
144 146 :settings => :get,
145 147 :modules => :post,
146 148 :archive => :post,
147 149 :unarchive => :post
148 150 } do |project|
149 151 project.resource :enumerations, :controller => 'project_enumerations',
150 152 :only => [:update, :destroy]
151 153 # issue form update
152 154 project.issue_form 'issues/new', :controller => 'issues',
153 155 :action => 'new', :conditions => {:method => [:post, :put]}
154 156 project.resources :issues, :only => [:index, :new, :create] do |issues|
155 157 issues.resources :time_entries, :controller => 'timelog',
156 158 :collection => {:report => :get}
157 159 end
158 160
159 161 project.resources :files, :only => [:index, :new, :create]
160 162 project.resources :versions, :shallow => true,
161 163 :collection => {:close_completed => :put},
162 164 :member => {:status_by => :post}
163 165 project.resources :news, :shallow => true
164 166 project.resources :time_entries, :controller => 'timelog',
165 167 :collection => {:report => :get}
166 168 project.resources :queries, :only => [:new, :create]
167 169 project.resources :issue_categories, :shallow => true
168 170 project.resources :documents, :shallow => true, :member => {:add_attachment => :post}
169 171 project.resources :boards
170 172 project.resources :repositories, :shallow => true, :except => [:index, :show],
171 173 :member => {:committers => [:get, :post]}
172 174 project.resources :memberships, :shallow => true, :controller => 'members',
173 175 :only => [:index, :show, :create, :update, :destroy],
174 176 :collection => {:autocomplete => :get}
175 177
176 178 project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get}
177 179 project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get}
178 180 project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil
179 181 project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff'
180 182 project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate'
181 183 project.resources :wiki, :except => [:new, :create], :member => {
182 184 :rename => [:get, :post],
183 185 :history => :get,
184 186 :preview => :any,
185 187 :protect => :post,
186 188 :add_attachment => :post
187 189 }, :collection => {
188 190 :export => :get,
189 191 :date_index => :get
190 192 }
191 193 end
192 194
193 195 map.connect 'news', :controller => 'news', :action => 'index'
194 196 map.connect 'news.:format', :controller => 'news', :action => 'index'
195 197
196 198 map.resources :queries, :except => [:show]
197 199 map.resources :issues,
198 200 :collection => {:bulk_edit => [:get, :post], :bulk_update => :post} do |issues|
199 201 issues.resources :time_entries, :controller => 'timelog',
200 202 :collection => {:report => :get}
201 203 issues.resources :relations, :shallow => true,
202 204 :controller => 'issue_relations',
203 205 :only => [:index, :show, :create, :destroy]
204 206 end
205 207 # Bulk deletion
206 208 map.connect '/issues', :controller => 'issues', :action => 'destroy',
207 209 :conditions => {:method => :delete}
208 210
209 211 map.connect '/time_entries/destroy',
210 212 :controller => 'timelog', :action => 'destroy',
211 213 :conditions => { :method => :delete }
212 214 map.time_entries_context_menu '/time_entries/context_menu',
213 215 :controller => 'context_menus', :action => 'time_entries'
214 216
215 217 map.resources :time_entries, :controller => 'timelog',
216 218 :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post}
217 219
218 220 map.with_options :controller => 'activities', :action => 'index',
219 221 :conditions => {:method => :get} do |activity|
220 222 activity.connect 'projects/:id/activity'
221 223 activity.connect 'projects/:id/activity.:format'
222 224 activity.connect 'activity', :id => nil
223 225 activity.connect 'activity.:format', :id => nil
224 226 end
225 227
226 228 map.with_options :controller => 'repositories' do |repositories|
227 229 repositories.with_options :conditions => {:method => :get} do |repository_views|
228 230 repository_views.connect 'projects/:id/repository',
229 231 :action => 'show'
230 232
231 233 repository_views.connect 'projects/:id/repository/:repository_id/statistics',
232 234 :action => 'stats'
233 235 repository_views.connect 'projects/:id/repository/:repository_id/graph',
234 236 :action => 'graph'
235 237
236 238 repository_views.connect 'projects/:id/repository/statistics',
237 239 :action => 'stats'
238 240 repository_views.connect 'projects/:id/repository/graph',
239 241 :action => 'graph'
240 242
241 243 repository_views.connect 'projects/:id/repository/:repository_id/revisions',
242 244 :action => 'revisions'
243 245 repository_views.connect 'projects/:id/repository/:repository_id/revisions.:format',
244 246 :action => 'revisions'
245 247 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev',
246 248 :action => 'revision'
247 249 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/issues',
248 250 :action => 'add_related_issue', :conditions => {:method => :post}
249 251 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id',
250 252 :action => 'remove_related_issue', :conditions => {:method => :delete}
251 253 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/diff',
252 254 :action => 'diff'
253 255 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/diff.:format',
254 256 :action => 'diff'
255 257 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/raw/*path',
256 258 :action => 'entry', :format => 'raw'
257 259 repository_views.connect 'projects/:id/repository/:repository_id/revisions/:rev/:action/*path',
258 260 :requirements => {
259 261 :action => /(browse|show|entry|changes|annotate|diff)/,
260 262 :rev => /[a-z0-9\.\-_]+/
261 263 }
262 264 repository_views.connect 'projects/:id/repository/:repository_id/raw/*path',
263 265 :action => 'entry', :format => 'raw'
264 266 repository_views.connect 'projects/:id/repository/:repository_id/:action/*path',
265 267 :requirements => { :action => /(browse|show|entry|changes|annotate|diff)/ }
266 268
267 269 repository_views.connect 'projects/:id/repository/revisions',
268 270 :action => 'revisions'
269 271 repository_views.connect 'projects/:id/repository/revisions.:format',
270 272 :action => 'revisions'
271 273 repository_views.connect 'projects/:id/repository/revisions/:rev',
272 274 :action => 'revision'
273 275 repository_views.connect 'projects/:id/repository/revisions/:rev/issues',
274 276 :action => 'add_related_issue', :conditions => {:method => :post}
275 277 repository_views.connect 'projects/:id/repository/revisions/:rev/issues/:issue_id',
276 278 :action => 'remove_related_issue', :conditions => {:method => :delete}
277 279 repository_views.connect 'projects/:id/repository/revisions/:rev/diff',
278 280 :action => 'diff'
279 281 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format',
280 282 :action => 'diff'
281 283 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path',
282 284 :action => 'entry', :format => 'raw'
283 285 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path',
284 286 :requirements => {
285 287 :action => /(browse|show|entry|changes|annotate|diff)/,
286 288 :rev => /[a-z0-9\.\-_]+/
287 289 }
288 290 repository_views.connect 'projects/:id/repository/raw/*path',
289 291 :action => 'entry', :format => 'raw'
290 292 repository_views.connect 'projects/:id/repository/:action/*path',
291 293 :requirements => { :action => /(browse|show|entry|changes|annotate|diff)/ }
292 294
293 295 repository_views.connect 'projects/:id/repository/:repository_id',
294 296 :action => 'show'
295 297 end
296 298
297 299 repositories.connect 'projects/:id/repository/revision',
298 300 :action => 'revision',
299 301 :conditions => {:method => [:get, :post]}
300 302 end
301 303
302 304 # additional routes for having the file name at the end of url
303 305 map.connect 'attachments/:id/:filename', :controller => 'attachments',
304 306 :action => 'show', :id => /\d+/, :filename => /.*/,
305 307 :conditions => {:method => :get}
306 308 map.connect 'attachments/download/:id/:filename', :controller => 'attachments',
307 309 :action => 'download', :id => /\d+/, :filename => /.*/,
308 310 :conditions => {:method => :get}
309 311 map.connect 'attachments/download/:id', :controller => 'attachments',
310 312 :action => 'download', :id => /\d+/,
311 313 :conditions => {:method => :get}
312 314 map.resources :attachments, :only => [:show, :destroy]
313 315
314 316 map.resources :groups, :member => {:autocomplete_for_user => :get}
315 317 map.group_users 'groups/:id/users', :controller => 'groups',
316 318 :action => 'add_users', :id => /\d+/,
317 319 :conditions => {:method => :post}
318 320 map.group_user 'groups/:id/users/:user_id', :controller => 'groups',
319 321 :action => 'remove_user', :id => /\d+/,
320 322 :conditions => {:method => :delete}
321 323 map.connect 'groups/destroy_membership/:id', :controller => 'groups',
322 324 :action => 'destroy_membership', :id => /\d+/,
323 325 :conditions => {:method => :post}
324 326 map.connect 'groups/edit_membership/:id', :controller => 'groups',
325 327 :action => 'edit_membership', :id => /\d+/,
326 328 :conditions => {:method => :post}
327 329
328 330 map.resources :trackers, :except => :show
329 331 map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post}
330 332 map.resources :custom_fields, :except => :show
331 333 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
332 334 map.resources :enumerations, :except => :show
333 335
334 336 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
335 337
336 338 map.connect 'mail_handler', :controller => 'mail_handler',
337 339 :action => 'index', :conditions => {:method => :post}
338 340
339 341 map.connect 'admin', :controller => 'admin', :action => 'index',
340 342 :conditions => {:method => :get}
341 343 map.connect 'admin/projects', :controller => 'admin', :action => 'projects',
342 344 :conditions => {:method => :get}
343 345 map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins',
344 346 :conditions => {:method => :get}
345 347 map.connect 'admin/info', :controller => 'admin', :action => 'info',
346 348 :conditions => {:method => :get}
347 349 map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email',
348 350 :conditions => {:method => :get}
349 351 map.connect 'admin/default_configuration', :controller => 'admin',
350 352 :action => 'default_configuration', :conditions => {:method => :post}
351 353
352 354 # Used by AuthSourcesControllerTest
353 355 # TODO : refactor *AuthSourcesController to remove these routes
354 356 map.connect 'auth_sources', :controller => 'auth_sources',
355 357 :action => 'index', :conditions => {:method => :get}
356 358 map.connect 'auth_sources/new', :controller => 'auth_sources',
357 359 :action => 'new', :conditions => {:method => :get}
358 360 map.connect 'auth_sources/create', :controller => 'auth_sources',
359 361 :action => 'create', :conditions => {:method => :post}
360 362 map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources',
361 363 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
362 364 map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources',
363 365 :action => 'test_connection', :conditions => {:method => :get}
364 366 map.connect 'auth_sources/edit/:id', :controller => 'auth_sources',
365 367 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
366 368 map.connect 'auth_sources/update/:id', :controller => 'auth_sources',
367 369 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
368 370
369 371 map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources',
370 372 :action => 'index', :conditions => {:method => :get}
371 373 map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources',
372 374 :action => 'new', :conditions => {:method => :get}
373 375 map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources',
374 376 :action => 'create', :conditions => {:method => :post}
375 377 map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources',
376 378 :action => 'destroy', :id => /\d+/, :conditions => {:method => :post}
377 379 map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources',
378 380 :action => 'test_connection', :conditions => {:method => :get}
379 381 map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources',
380 382 :action => 'edit', :id => /\d+/, :conditions => {:method => :get}
381 383 map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources',
382 384 :action => 'update', :id => /\d+/, :conditions => {:method => :post}
383 385
384 386 map.connect 'workflows', :controller => 'workflows',
385 387 :action => 'index', :conditions => {:method => :get}
386 388 map.connect 'workflows/edit', :controller => 'workflows',
387 389 :action => 'edit', :conditions => {:method => [:get, :post]}
388 390 map.connect 'workflows/copy', :controller => 'workflows',
389 391 :action => 'copy', :conditions => {:method => [:get, :post]}
390 392
391 393 map.connect 'settings', :controller => 'settings',
392 394 :action => 'index', :conditions => {:method => :get}
393 395 map.connect 'settings/edit', :controller => 'settings',
394 396 :action => 'edit', :conditions => {:method => [:get, :post]}
395 397 map.connect 'settings/plugin/:id', :controller => 'settings',
396 398 :action => 'plugin', :conditions => {:method => [:get, :post]}
397 399
398 400 map.with_options :controller => 'sys' do |sys|
399 401 sys.connect 'sys/projects.:format',
400 402 :action => 'projects',
401 403 :conditions => {:method => :get}
402 404 sys.connect 'sys/projects/:id/repository.:format',
403 405 :action => 'create_project_repository',
404 406 :conditions => {:method => :post}
405 407 sys.connect 'sys/fetch_changesets',
406 408 :action => 'fetch_changesets',
407 409 :conditions => {:method => :get}
408 410 end
409 411
410 412 map.connect 'robots.txt', :controller => 'welcome',
411 413 :action => 'robots', :conditions => {:method => :get}
412 414
413 415 # Used for OpenID
414 416 map.root :controller => 'account', :action => 'login'
415 417 end
@@ -1,33 +1,37
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../../test_helper', __FILE__)
19 19
20 20 class RoutingPreviewsTest < ActionController::IntegrationTest
21 21 def test_previews
22 22 ["get", "post"].each do |method|
23 23 assert_routing(
24 { :method => method, :path => "/issues/preview/123" },
25 { :controller => 'previews', :action => 'issue', :id => '123' }
24 { :method => method, :path => "/issues/preview/new/123" },
25 { :controller => 'previews', :action => 'issue', :project_id => '123' }
26 )
27 assert_routing(
28 { :method => method, :path => "/issues/preview/edit/321" },
29 { :controller => 'previews', :action => 'issue', :id => '321' }
26 30 )
27 31 end
28 32 assert_routing(
29 33 { :method => 'get', :path => "/news/preview" },
30 34 { :controller => 'previews', :action => 'news' }
31 35 )
32 36 end
33 37 end
General Comments 0
You need to be logged in to leave comments. Login now