##// 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,23 +3155,33 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 'select[name=?]', 'issue[project_id]'
3158 assert_select 'ul#bulk-selection' do
3159 assert_select 'input[name=?]', 'issue[parent_issue_id]'
3159 assert_select 'li', 2
3160
3160 assert_select 'li a', :text => 'Bug #1'
3161 # Project specific custom field, date type
3161 end
3162 field = CustomField.find(9)
3163 assert !field.is_for_all?
3164 assert_equal 'date', field.field_format
3165 assert_select 'input[name=?]', 'issue[custom_field_values][9]'
3166
3162
3167 # System wide custom field
3163 assert_select 'form#bulk_edit_form[action=?]', '/issues/bulk_update' do
3168 assert CustomField.find(1).is_for_all?
3164 assert_select 'input[name=?]', 'ids[]', 2
3169 assert_select 'select[name=?]', 'issue[custom_field_values][1]'
3165 assert_select 'input[name=?][value=1][type=hidden]', 'ids[]'
3170
3166
3171 # Be sure we don't display inactive IssuePriorities
3167 assert_select 'select[name=?]', 'issue[project_id]'
3172 assert ! IssuePriority.find(15).active?
3168 assert_select 'input[name=?]', 'issue[parent_issue_id]'
3173 assert_select 'select[name=?]', 'issue[priority_id]' do
3169
3174 assert_select 'option[value=15]', 0
3170 # Project specific custom field, date type
3171 field = CustomField.find(9)
3172 assert !field.is_for_all?
3173 assert_equal 'date', field.field_format
3174 assert_select 'input[name=?]', 'issue[custom_field_values][9]'
3175
3176 # System wide custom field
3177 assert CustomField.find(1).is_for_all?
3178 assert_select 'select[name=?]', 'issue[custom_field_values][1]'
3179
3180 # Be sure we don't display inactive IssuePriorities
3181 assert ! IssuePriority.find(15).active?
3182 assert_select 'select[name=?]', 'issue[priority_id]' do
3183 assert_select 'option[value=15]', 0
3184 end
3175 end
3185 end
3176 end
3186 end
3177
3187
@@ -293,13 +293,20 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 # System wide custom field
296 assert_select 'ul#bulk-selection' do
297 assert_tag :select, :attributes => {:name => 'time_entry[custom_field_values][10]'}
297 assert_select 'li', 2
298 assert_select 'li a', :text => '03/23/2007 - eCookbook: 4.25 hours'
299 end
298
300
299 # Activities
301 assert_select 'form#bulk_edit_form[action=?]', '/time_entries/bulk_update' do
300 assert_select 'select[name=?]', 'time_entry[activity_id]' do
302 # System wide custom field
301 assert_select 'option[value=]', :text => '(No change)'
303 assert_select 'select[name=?]', 'time_entry[custom_field_values][10]'
302 assert_select 'option[value=9]', :text => 'Design'
304
305 # Activities
306 assert_select 'select[name=?]', 'time_entry[activity_id]' do
307 assert_select 'option[value=]', :text => '(No change)'
308 assert_select 'option[value=9]', :text => 'Design'
309 end
303 end
310 end
304 end
311 end
305
312
General Comments 0
You need to be logged in to leave comments. Login now