Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11071 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
a4f989a5e0
commit
ad246e81ad
|
@ -1,12 +1,12 @@
|
||||||
<h2><%= @copy ? l(:button_copy) : l(:label_bulk_edit_selected_issues) %></h2>
|
<h2><%= @copy ? l(:button_copy) : l(:label_bulk_edit_selected_issues) %></h2>
|
||||||
|
|
||||||
<ul>
|
<ul id="bulk-selection">
|
||||||
<% @issues.each do |issue| %>
|
<% @issues.each do |issue| %>
|
||||||
<%= content_tag 'li', link_to_issue(issue) %>
|
<%= content_tag 'li', link_to_issue(issue) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= form_tag({:action => 'bulk_update'}, :id => 'bulk_edit_form') do %>
|
<%= form_tag(bulk_update_issues_path, :id => 'bulk_edit_form') do %>
|
||||||
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
|
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
|
||||||
<div class="box tabular">
|
<div class="box tabular">
|
||||||
<fieldset class="attributes">
|
<fieldset class="attributes">
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<h2><%= l(:label_bulk_edit_selected_time_entries) %></h2>
|
<h2><%= l(:label_bulk_edit_selected_time_entries) %></h2>
|
||||||
|
|
||||||
<ul>
|
<ul id="bulk-selection">
|
||||||
<% @time_entries.each do |entry| %>
|
<% @time_entries.each do |entry| %>
|
||||||
<%= content_tag 'li',
|
<%= content_tag 'li',
|
||||||
link_to("#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => entry.hours)}", edit_time_entry_path(entry)) %>
|
link_to("#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => entry.hours)}", edit_time_entry_path(entry)) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= form_tag(:action => 'bulk_update') do %>
|
<%= form_tag(bulk_update_time_entries_path, :id => 'bulk_edit_form') do %>
|
||||||
<%= @time_entries.collect {|i| hidden_field_tag('ids[]', i.id)}.join.html_safe %>
|
<%= @time_entries.collect {|i| hidden_field_tag('ids[]', i.id)}.join.html_safe %>
|
||||||
<div class="box tabular">
|
<div class="box tabular">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -3155,23 +3155,33 @@ class IssuesControllerTest < ActionController::TestCase
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'bulk_edit'
|
assert_template 'bulk_edit'
|
||||||
|
|
||||||
assert_select 'select[name=?]', 'issue[project_id]'
|
assert_select 'ul#bulk-selection' do
|
||||||
assert_select 'input[name=?]', 'issue[parent_issue_id]'
|
assert_select 'li', 2
|
||||||
|
assert_select 'li a', :text => 'Bug #1'
|
||||||
|
end
|
||||||
|
|
||||||
# Project specific custom field, date type
|
assert_select 'form#bulk_edit_form[action=?]', '/issues/bulk_update' do
|
||||||
field = CustomField.find(9)
|
assert_select 'input[name=?]', 'ids[]', 2
|
||||||
assert !field.is_for_all?
|
assert_select 'input[name=?][value=1][type=hidden]', 'ids[]'
|
||||||
assert_equal 'date', field.field_format
|
|
||||||
assert_select 'input[name=?]', 'issue[custom_field_values][9]'
|
|
||||||
|
|
||||||
# System wide custom field
|
assert_select 'select[name=?]', 'issue[project_id]'
|
||||||
assert CustomField.find(1).is_for_all?
|
assert_select 'input[name=?]', 'issue[parent_issue_id]'
|
||||||
assert_select 'select[name=?]', 'issue[custom_field_values][1]'
|
|
||||||
|
# Project specific custom field, date type
|
||||||
# Be sure we don't display inactive IssuePriorities
|
field = CustomField.find(9)
|
||||||
assert ! IssuePriority.find(15).active?
|
assert !field.is_for_all?
|
||||||
assert_select 'select[name=?]', 'issue[priority_id]' do
|
assert_equal 'date', field.field_format
|
||||||
assert_select 'option[value=15]', 0
|
assert_select 'input[name=?]', 'issue[custom_field_values][9]'
|
||||||
|
|
||||||
|
# System wide custom field
|
||||||
|
assert CustomField.find(1).is_for_all?
|
||||||
|
assert_select 'select[name=?]', 'issue[custom_field_values][1]'
|
||||||
|
|
||||||
|
# Be sure we don't display inactive IssuePriorities
|
||||||
|
assert ! IssuePriority.find(15).active?
|
||||||
|
assert_select 'select[name=?]', 'issue[priority_id]' do
|
||||||
|
assert_select 'option[value=15]', 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -293,13 +293,20 @@ class TimelogControllerTest < ActionController::TestCase
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'bulk_edit'
|
assert_template 'bulk_edit'
|
||||||
|
|
||||||
# System wide custom field
|
assert_select 'ul#bulk-selection' do
|
||||||
assert_tag :select, :attributes => {:name => 'time_entry[custom_field_values][10]'}
|
assert_select 'li', 2
|
||||||
|
assert_select 'li a', :text => '03/23/2007 - eCookbook: 4.25 hours'
|
||||||
|
end
|
||||||
|
|
||||||
# Activities
|
assert_select 'form#bulk_edit_form[action=?]', '/time_entries/bulk_update' do
|
||||||
assert_select 'select[name=?]', 'time_entry[activity_id]' do
|
# System wide custom field
|
||||||
assert_select 'option[value=]', :text => '(No change)'
|
assert_select 'select[name=?]', 'time_entry[custom_field_values][10]'
|
||||||
assert_select 'option[value=9]', :text => 'Design'
|
|
||||||
|
# Activities
|
||||||
|
assert_select 'select[name=?]', 'time_entry[activity_id]' do
|
||||||
|
assert_select 'option[value=]', :text => '(No change)'
|
||||||
|
assert_select 'option[value=9]', :text => 'Design'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue