Permalink
Browse files

fix bulk feedback checkbox bug caused by change in processing order

  • Loading branch information...
emiddleton committed Jul 5, 2009
1 parent c99a2d8 commit 95c04d018ab92fd02d4e5404814c103822843c91
@@ -107,7 +107,8 @@ def bulkops
items = Feedback.find(ids)
@unexpired = true
case params[:bulkop]
bulkop = params[:bulkop_top].empty? ? params[:bulkop_bottom] : params[:bulkop_top]
case bulkop
when 'Delete Checked Items'
count = 0
ids.each do |id|
@@ -74,8 +74,8 @@ def value_for(choice)
class CheckBoxField < self
def input_html(sidebar)
check_box_tag(input_name(sidebar), 1, sidebar.config[key], options)+
hidden_field_tag(input_name(sidebar),0)
hidden_field_tag(input_name(sidebar),0)+
check_box_tag(input_name(sidebar), 1, sidebar.config[key], options)
end
def line_html(sidebar)
@@ -1,7 +1,7 @@
<p>
<%= hidden_field_tag "confirmed", params[:confirmed] %>
<%= hidden_field_tag "published", params[:published] %>
<%= hidden_field_tag "bulkop", "",{:id=>"bulkop"} %>
<%= hidden_field_tag "bulkop_#{position}", "",{:id=>"bulkop"} %>
<%= submit_tag _("Delete Checked Items"), {:class => 'submit',:onclick=>"getElementById('bulkop').value='Delete Checked Items'"} %> &nbsp;
<%= submit_tag _("Mark Checked Items as Ham"), {:class => 'submit',:onclick=>"getElementById('bulkop').value='Mark Checked Items as Ham'"} %>
<%= submit_tag _("Mark Checked Items as Spam"), {:class => 'submit',:onclick=>"getElementById('bulkop').value='Mark Checked Items as Spam'"} %>
@@ -11,7 +11,7 @@
<div class="list">
<% form_tag({:action => 'bulkops'}, :method => :post) do %>
<%= render :partial => 'button' %>
<%= render :partial => 'button', :locals => { :position => 'top' } %>
<%= hidden_field_tag "search", params[:search]%>
<%= hidden_field_tag "page", params[:page]%>
@@ -31,7 +31,7 @@
<tr><td class="paginate" colspan="9"><%= will_paginate @feedback %></td></tr>
</table>
<%= render :partial => 'button' %>
<%= render :partial => 'button', :locals => { :position => 'bottom' } %>
<% end %>
</div>
@@ -296,7 +296,7 @@ def feedback_from_not_own_article
describe '#bulkops action' do
before :each do
post :bulkops, :bulkop => 'Delete all spam'
post :bulkops, :bulkop_top => 'Delete all spam'
end
it 'should redirect to action' do

0 comments on commit 95c04d0

Please sign in to comment.