app/views/bodega/orders/new.html.erb in bodega-0.2.0 vs app/views/bodega/orders/new.html.erb in bodega-0.3.0
- old
+ new
@@ -1,9 +1,12 @@
+<% if current_products.empty? -%>
+<h3><%= t 'bodega.empty_cart' %></h3>
+<% else -%>
<%= form_for(current_order, url: root_path) do |form| %>
<table id="bodega-cart">
<thead>
- <tr><th class="product-name" colspan="2"><%= Bodega.config.product_name.titleize %></th><th class="price">Price</th><th class="total">Total</th></tr>
+ <tr><th class="product-name" colspan="2"><%= t 'bodega.product' %></th><th class="price"><%= t 'bodega.price' %></th><th class="total" colspan="2"><%= t 'bodega.total' %></th></tr>
</thead>
<tbody>
<% current_order.order_products.each do |order_product| -%>
<tr>
<td class="quantity-field">
@@ -13,17 +16,26 @@
<%= order_product.name %>
<%= hidden_field_tag 'products[][type]', order_product.product_type %>
<%= hidden_field_tag 'products[][id]', order_product.product_id %>
</td>
<td class="price">
- $<%= order_product.price %>
+ <%= humanized_money_with_symbol order_product.price %>
</td>
<td class="subtotal">
- $<%= order_product.subtotal %>
+ <%= humanized_money_with_symbol order_product.subtotal %>
</td>
+ <td class="remove">
+ <%= link_to t('bodega.remove'), bodega.remove_path(product_id: order_product.identifier) %>
+ </td>
</tr>
<% end -%>
+ <tr>
+ <td colspan="3"></td>
+ <td><%= humanized_money_with_symbol current_order.subtotal %></td>
+ <td></td>
+ </tr>
</tbody>
</table>
- <%= button_tag 'Update Cart', name: :update, value: 1 %>
- <%= button_tag 'Checkout', name: :checkout, value: 1 %>
+ <%= button_tag t('bodega.update_cart'), id: 'bodega-update', name: :update, value: 1 %>
+ <%= button_tag t('bodega.checkout'), id: 'bodega-checkout', name: :checkout, value: 1 %>
<% end =%>
+<% end -%>