##// END OF EJS Templates
Code cleanup, use named routes....
Jean-Philippe Lang -
r10841:ad246e81ad52
parent child
Show More
@@ -1,12 +1,12
1 <h2><%= @copy ? l(:button_copy) : l(:label_bulk_edit_selected_issues) %></h2>
1 <h2><%= @copy ? l(:button_copy) : l(:label_bulk_edit_selected_issues) %></h2>
2
2
3 <ul>
3 <ul id="bulk-selection">
4 <% @issues.each do |issue| %>
4 <% @issues.each do |issue| %>
5 <%= content_tag 'li', link_to_issue(issue) %>
5 <%= content_tag 'li', link_to_issue(issue) %>
6 <% end %>
6 <% end %>
7 </ul>
7 </ul>
8
8
9 <%= form_tag({:action => 'bulk_update'}, :id => 'bulk_edit_form') do %>
9 <%= form_tag(bulk_update_issues_path, :id => 'bulk_edit_form') do %>
10 <%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
10 <%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
11 <div class="box tabular">
11 <div class="box tabular">
12 <fieldset class="attributes">
12 <fieldset class="attributes">
@@ -1,13 +1,13
1 <h2><%= l(:label_bulk_edit_selected_time_entries) %></h2>
1 <h2><%= l(:label_bulk_edit_selected_time_entries) %></h2>
2
2
3 <ul>
3 <ul id="bulk-selection">
4 <% @time_entries.each do |entry| %>
4 <% @time_entries.each do |entry| %>
5 <%= content_tag 'li',
5 <%= content_tag 'li',
6 link_to("#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => entry.hours)}", edit_time_entry_path(entry)) %>
6 link_to("#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => entry.hours)}", edit_time_entry_path(entry)) %>
7 <% end %>
7 <% end %>
8 </ul>
8 </ul>
9
9
10 <%= form_tag(:action => 'bulk_update') do %>
10 <%= form_tag(bulk_update_time_entries_path, :id => 'bulk_edit_form') do %>
11 <%= @time_entries.collect {|i| hidden_field_tag('ids[]', i.id)}.join.html_safe %>
11 <%= @time_entries.collect {|i| hidden_field_tag('ids[]', i.id)}.join.html_safe %>
12 <div class="box tabular">
12 <div class="box tabular">
13 <div>
13 <div>
@@ -3155,6 +3155,15 class IssuesControllerTest < ActionController::TestCase
3155 assert_response :success
3155 assert_response :success
3156 assert_template 'bulk_edit'
3156 assert_template 'bulk_edit'
3157
3157
3158 assert_select 'ul#bulk-selection' do
3159 assert_select 'li', 2
3160 assert_select 'li a', :text => 'Bug #1'
3161 end
3162
3163 assert_select 'form#bulk_edit_form[action=?]', '/issues/bulk_update' do
3164 assert_select 'input[name=?]', 'ids[]', 2
3165 assert_select 'input[name=?][value=1][type=hidden]', 'ids[]'
3166
3158 assert_select 'select[name=?]', 'issue[project_id]'
3167 assert_select 'select[name=?]', 'issue[project_id]'
3159 assert_select 'input[name=?]', 'issue[parent_issue_id]'
3168 assert_select 'input[name=?]', 'issue[parent_issue_id]'
3160
3169
@@ -3174,6 +3183,7 class IssuesControllerTest < ActionController::TestCase
3174 assert_select 'option[value=15]', 0
3183 assert_select 'option[value=15]', 0
3175 end
3184 end
3176 end
3185 end
3186 end
3177
3187
3178 def test_get_bulk_edit_on_different_projects
3188 def test_get_bulk_edit_on_different_projects
3179 @request.session[:user_id] = 2
3189 @request.session[:user_id] = 2
@@ -293,8 +293,14 class TimelogControllerTest < ActionController::TestCase
293 assert_response :success
293 assert_response :success
294 assert_template 'bulk_edit'
294 assert_template 'bulk_edit'
295
295
296 assert_select 'ul#bulk-selection' do
297 assert_select 'li', 2
298 assert_select 'li a', :text => '03/23/2007 - eCookbook: 4.25 hours'
299 end
300
301 assert_select 'form#bulk_edit_form[action=?]', '/time_entries/bulk_update' do
296 # System wide custom field
302 # System wide custom field
297 assert_tag :select, :attributes => {:name => 'time_entry[custom_field_values][10]'}
303 assert_select 'select[name=?]', 'time_entry[custom_field_values][10]'
298
304
299 # Activities
305 # Activities
300 assert_select 'select[name=?]', 'time_entry[activity_id]' do
306 assert_select 'select[name=?]', 'time_entry[activity_id]' do
@@ -302,6 +308,7 class TimelogControllerTest < ActionController::TestCase
302 assert_select 'option[value=9]', :text => 'Design'
308 assert_select 'option[value=9]', :text => 'Design'
303 end
309 end
304 end
310 end
311 end
305
312
306 def test_get_bulk_edit_on_different_projects
313 def test_get_bulk_edit_on_different_projects
307 @request.session[:user_id] = 2
314 @request.session[:user_id] = 2
General Comments 0
You need to be logged in to leave comments. Login now