Skip to content

Commit

Permalink
Merge pull request #1727 from vfonic/cart-form-code-styling
Browse files Browse the repository at this point in the history
Update code styles for /cart
  • Loading branch information
jhawthorn authored Mar 14, 2017
2 parents 6ca3ab6 + caca97e commit 9cc2f61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions frontend/app/views/spree/orders/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
<% order = order_form.object %>
<%= render 'spree/shared/error_messages', target: order %>
<table id="cart-detail" data-hook>
<thead>
<tr data-hook="cart_items_headers">
Expand All @@ -10,19 +11,19 @@
</tr>
</thead>
<tbody id="line_items" data-hook>
<%= render partial: 'spree/orders/line_item', collection: order_form.object.line_items, locals: {order_form: order_form} %>
<%= render partial: 'spree/orders/line_item', collection: order.line_items, locals: { order_form: order_form } %>
</tbody>
<% if @order.adjustments.nonzero.exists? || @order.line_item_adjustments.nonzero.exists? || @order.shipment_adjustments.nonzero.exists? || @order.shipments.any? %>
<% if order.adjustments.nonzero.exists? || order.line_item_adjustments.nonzero.exists? || order.shipment_adjustments.nonzero.exists? || order.shipments.any? %>
<tr class="cart-subtotal">
<td colspan="4" align='right'><h5><%= Spree.t(:cart_subtotal, count: @order.line_items.sum(:quantity)) %></h5></th>
<td colspan><h5><%= order_form.object.display_item_total %></h5></td>
<td colspan="4" align='right'><h5><%= Spree.t(:cart_subtotal, count: order.line_items.sum(:quantity)) %></h5></th>
<td colspan><h5><%= order.display_item_total %></h5></td>
<td></td>
</tr>
<%= render "spree/orders/adjustments" %>
<% end %>
<tr class="cart-total">
<td colspan="4" align='right'><h5><%= Spree.t(:total) %></h5></th>
<td colspan><h5><%= order_form.object.display_total %></h5></td>
<td colspan><h5><%= order.display_total %></h5></td>
<td></td>
</tr>
</table>
2 changes: 1 addition & 1 deletion frontend/app/views/spree/orders/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div data-hook="inside_cart_form">

<div data-hook="cart_items">
<%= render partial: 'form', locals: { order_form: order_form } %>
<%= render 'form', order_form: order_form %>
</div>

<div class="links columns sixteen alpha omega" data-hook="cart_buttons">
Expand Down

0 comments on commit 9cc2f61

Please sign in to comment.