Skip to content

Commit

Permalink
update line item buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
jozw committed Feb 17, 2015
1 parent f28fc74 commit 9e45b6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 51 deletions.
37 changes: 0 additions & 37 deletions app/assets/javascripts/spree/backend/line_items.js.coffee

This file was deleted.

18 changes: 7 additions & 11 deletions app/views/spree/admin/orders/_assemblies.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
<td class="item-price align-center">
<%= item.single_money.to_html %>
</td>
<td class="item-qty-show align-center">
<td class="line-item-qty-show align-center">
<%= item.quantity %>
</td>

<td class="item-qty-edit hidden">
<%= number_field_tag :quantity, item.quantity, :min => 0, :class => "line_item_quantity", :size => 5 %>
<td class="line-item-qty-edit hidden">
<%= number_field_tag :quantity, item.quantity, :min => 0, class: "line_item_quantity", :size => 5 %>
</td>

<td class="item-total align-center">
Expand All @@ -48,14 +48,10 @@
<td class="cart-item-delete actions" data-hook="cart_item_delete">
<% unless item.any_units_shipped? %>
<% if can? :update, item %>
<%= link_to '', [:admin, @order, item], :class => 'save-line-item fa fa-ok no-text with-tip',
:title => Spree.t('actions.save'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'cancel-line-item fa fa-cancel no-text with-tip',
:title => Spree.t('actions.cancel'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'edit-line-item fa fa-edit no-text with-tip',
:title => Spree.t('edit') %>
<%= link_to '', [:admin, @order, item], :class => 'delete-line-item fa fa-trash no-text with-tip',
data: { confirm: Spree.t(:are_you_sure) }, :title => Spree.t('delete') %>
<%= link_to '', '#', :class => 'save-line-item fa fa-ok no-text with-tip', :data => { 'line-item-id' => item.id, :action => 'save'}, :title => Spree.t('actions.save'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'cancel-line-item fa fa-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'edit-line-item fa fa-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
<%= link_to '', '#', :class => 'delete-line-item fa fa-trash no-text with-tip', :data => { 'line-item-id' => item.id, :action => 'remove'}, :title => Spree.t('delete') %>
<% end %>
<% end %>
</td>
Expand Down
4 changes: 1 addition & 3 deletions spec/features/admin/orders_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
within("table.product-bundles") do
find(".edit-line-item").click
fill_in "quantity", :with => "2"
# The buttons are not working correctly in testing but work fine in development
# Clicking the edit button again here to not fail the test
find(".edit-line-item").click
find(".save-line-item").click

sleep(1) # avoid odd "cannot rollback - no transaction is active: rollback transaction"
end
Expand Down

0 comments on commit 9e45b6a

Please sign in to comment.