-
-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5350 from luisramos0/edit_order_snail
Improve order edit page in data inconsistency scenario (follow up from S2 #4186)
- Loading branch information
Showing
1 changed file
with
22 additions
and
22 deletions.
There are no files selected for viewing
44 changes: 22 additions & 22 deletions
44
app/views/spree/admin/orders/_shipment_manifest.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
- shipment.manifest.each do |item| | ||
- line_item = order.find_line_item_by_variant(item.variant) | ||
- break if line_item.blank? | ||
|
||
%tr.stock-item{ "data-item-quantity" => "#{item.quantity}" } | ||
%td.item-image | ||
= mini_image(item.variant) | ||
%td.item-name | ||
= item.variant.product_and_full_name | ||
%td.item-price.align-center | ||
= line_item.single_money.to_html | ||
%td.item-qty-show.align-center | ||
- item.states.each do |state,count| | ||
= "#{count} x #{t(state.humanize.downcase, scope: [:spree, :shipment_states], default: [:missing, "none"])}" | ||
- unless shipment.shipped? | ||
%td.item-qty-edit.hidden | ||
= number_field_tag :quantity, item.quantity, :min => 0, :class => "line_item_quantity", :size => 5 | ||
%td.item-total.align-center | ||
= line_item_shipment_price(line_item, item.quantity) | ||
- if line_item.present? | ||
%tr.stock-item{ "data-item-quantity" => "#{item.quantity}" } | ||
%td.item-image | ||
= mini_image(item.variant) | ||
%td.item-name | ||
= item.variant.product_and_full_name | ||
%td.item-price.align-center | ||
= line_item.single_money.to_html | ||
%td.item-qty-show.align-center | ||
- item.states.each do |state,count| | ||
= "#{count} x #{t(state.humanize.downcase, scope: [:spree, :shipment_states], default: [:missing, "none"])}" | ||
- unless shipment.shipped? | ||
%td.item-qty-edit.hidden | ||
= number_field_tag :quantity, item.quantity, :min => 0, :class => "line_item_quantity", :size => 5 | ||
%td.item-total.align-center | ||
= line_item_shipment_price(line_item, item.quantity) | ||
|
||
%td.cart-item-delete.actions{ "data-hook" => "cart_item_delete" } | ||
- if !shipment.shipped? && can?(:update, shipment) | ||
= link_to '', '#', :class => 'save-item icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => t('actions.save'), :style => 'display: none' | ||
= link_to '', '#', :class => 'cancel-item icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => t('actions.cancel'), :style => 'display: none' | ||
= link_to '', '#', :class => 'edit-item icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => t('actions.edit') | ||
= link_to '', '#', :class => 'delete-item icon-trash no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'remove', :confirm => t(:are_you_sure)}, :title => t('actions.delete') | ||
%td.cart-item-delete.actions{ "data-hook" => "cart_item_delete" } | ||
- if !shipment.shipped? && can?(:update, shipment) | ||
= link_to '', '#', :class => 'save-item icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => t('actions.save'), :style => 'display: none' | ||
= link_to '', '#', :class => 'cancel-item icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => t('actions.cancel'), :style => 'display: none' | ||
= link_to '', '#', :class => 'edit-item icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => t('actions.edit') | ||
= link_to '', '#', :class => 'delete-item icon-trash no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'remove', :confirm => t(:are_you_sure)}, :title => t('actions.delete') |