solidus_frontend 2.4.2 → 2.5.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_frontend might be problematic. Click here for more details.

Files changed (132) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +1 -5
  3. data/Rakefile +7 -7
  4. data/app/assets/config/solidus_frontend_manifest.js +0 -2
  5. data/app/assets/javascripts/spree/frontend.js +0 -1
  6. data/app/assets/javascripts/spree/frontend/cart.js +30 -0
  7. data/app/assets/javascripts/spree/frontend/checkout.js +24 -0
  8. data/app/assets/javascripts/spree/frontend/checkout/address.js +128 -0
  9. data/app/assets/javascripts/spree/frontend/checkout/coupon-code.js +40 -0
  10. data/app/assets/javascripts/spree/frontend/checkout/payment.js +55 -0
  11. data/app/assets/javascripts/spree/frontend/product.js +81 -0
  12. data/app/assets/stylesheets/spree/frontend/_variables.scss +3 -0
  13. data/app/assets/stylesheets/spree/frontend/screen.css.scss +2 -2
  14. data/app/controllers/spree/checkout_controller.rb +3 -3
  15. data/app/controllers/spree/locale_controller.rb +2 -2
  16. data/app/controllers/spree/orders_controller.rb +5 -6
  17. data/app/controllers/spree/products_controller.rb +0 -1
  18. data/app/controllers/spree/store_controller.rb +1 -1
  19. data/app/controllers/spree/taxons_controller.rb +0 -1
  20. data/app/views/spree/address/_form.html.erb +23 -21
  21. data/app/views/spree/checkout/_address.html.erb +5 -5
  22. data/app/views/spree/checkout/_confirm.html.erb +3 -3
  23. data/app/views/spree/checkout/_delivery.html.erb +18 -14
  24. data/app/views/spree/checkout/_payment.html.erb +6 -6
  25. data/app/views/spree/checkout/_summary.html.erb +5 -5
  26. data/app/views/spree/checkout/edit.html.erb +2 -6
  27. data/app/views/spree/checkout/payment/_gateway.html.erb +9 -9
  28. data/app/views/spree/content/cvv.html.erb +1 -1
  29. data/app/views/spree/orders/_adjustments.html.erb +4 -4
  30. data/app/views/spree/orders/_form.html.erb +6 -6
  31. data/app/views/spree/orders/_line_item.html.erb +4 -4
  32. data/app/views/spree/orders/edit.html.erb +9 -9
  33. data/app/views/spree/orders/show.html.erb +4 -4
  34. data/app/views/spree/payments/_payment.html.erb +1 -1
  35. data/app/views/spree/products/_cart_form.html.erb +7 -7
  36. data/app/views/spree/products/_image.html.erb +2 -2
  37. data/app/views/spree/products/_promotions.html.erb +1 -1
  38. data/app/views/spree/products/_properties.html.erb +1 -1
  39. data/app/views/spree/products/_taxons.html.erb +1 -1
  40. data/app/views/spree/products/index.html.erb +1 -1
  41. data/app/views/spree/products/show.html.erb +1 -1
  42. data/app/views/spree/shared/_address.html.erb +2 -2
  43. data/app/views/spree/shared/_filters.html.erb +2 -2
  44. data/app/views/spree/shared/_footer.html.erb +1 -1
  45. data/app/views/spree/shared/_image.html.erb +12 -0
  46. data/app/views/spree/shared/_login_bar_items.html.erb +1 -0
  47. data/app/views/spree/shared/_main_nav_bar.html.erb +2 -2
  48. data/app/views/spree/shared/_nav_bar.html.erb +1 -0
  49. data/app/views/spree/shared/_order_details.html.erb +20 -20
  50. data/app/views/spree/shared/_products.html.erb +3 -3
  51. data/app/views/spree/shared/_search.html.erb +3 -3
  52. data/app/views/spree/shared/_shipment_tracking.html.erb +1 -1
  53. data/app/views/spree/shared/_taxonomies.html.erb +2 -2
  54. data/lib/generators/solidus/views/override_generator.rb +1 -0
  55. data/lib/spree/frontend.rb +4 -2
  56. data/solidus_frontend.gemspec +1 -2
  57. data/spec/controllers/spree/checkout_controller_spec.rb +12 -12
  58. data/spec/controllers/spree/current_order_tracking_spec.rb +1 -1
  59. data/spec/controllers/spree/orders_controller_ability_spec.rb +6 -4
  60. data/spec/controllers/spree/orders_controller_spec.rb +4 -3
  61. data/spec/controllers/spree/orders_controller_transitions_spec.rb +1 -1
  62. data/spec/controllers/spree/products_controller_spec.rb +3 -2
  63. data/spec/features/caching/products_spec.rb +7 -7
  64. data/spec/features/cart_spec.rb +1 -1
  65. data/spec/features/checkout_spec.rb +10 -9
  66. data/spec/features/coupon_code_spec.rb +12 -13
  67. data/spec/features/locale_spec.rb +0 -38
  68. data/spec/features/order_spec.rb +1 -1
  69. data/spec/features/products_spec.rb +4 -4
  70. data/spec/features/promotion_code_invalidation_spec.rb +3 -3
  71. data/spec/features/quantity_promotions_spec.rb +5 -5
  72. data/spec/generators/solidus/views/override_generator_spec.rb +2 -1
  73. data/spec/spec_helper.rb +19 -41
  74. data/spec/support/shared_contexts/custom_products.rb +17 -17
  75. metadata +19 -88
  76. data/Gemfile +0 -7
  77. data/app/assets/javascripts/spree/frontend/cart.js.coffee +0 -15
  78. data/app/assets/javascripts/spree/frontend/checkout.js.coffee +0 -17
  79. data/app/assets/javascripts/spree/frontend/checkout/address.js.coffee +0 -91
  80. data/app/assets/javascripts/spree/frontend/checkout/coupon-code.js.coffee +0 -34
  81. data/app/assets/javascripts/spree/frontend/checkout/payment.js.coffee +0 -42
  82. data/app/assets/javascripts/spree/frontend/product.js.coffee +0 -47
  83. data/vendor/assets/javascripts/jquery.validate/additional-methods.min.js +0 -12
  84. data/vendor/assets/javascripts/jquery.validate/jquery.validate.min.js +0 -12
  85. data/vendor/assets/javascripts/jquery.validate/localization/messages_ar.js +0 -25
  86. data/vendor/assets/javascripts/jquery.validate/localization/messages_bg.js +0 -25
  87. data/vendor/assets/javascripts/jquery.validate/localization/messages_ca.js +0 -25
  88. data/vendor/assets/javascripts/jquery.validate/localization/messages_cs.js +0 -25
  89. data/vendor/assets/javascripts/jquery.validate/localization/messages_da.js +0 -22
  90. data/vendor/assets/javascripts/jquery.validate/localization/messages_de.js +0 -22
  91. data/vendor/assets/javascripts/jquery.validate/localization/messages_el.js +0 -25
  92. data/vendor/assets/javascripts/jquery.validate/localization/messages_es.js +0 -25
  93. data/vendor/assets/javascripts/jquery.validate/localization/messages_et.js +0 -23
  94. data/vendor/assets/javascripts/jquery.validate/localization/messages_eu.js +0 -25
  95. data/vendor/assets/javascripts/jquery.validate/localization/messages_fa.js +0 -25
  96. data/vendor/assets/javascripts/jquery.validate/localization/messages_fi.js +0 -23
  97. data/vendor/assets/javascripts/jquery.validate/localization/messages_fr.js +0 -47
  98. data/vendor/assets/javascripts/jquery.validate/localization/messages_ge.js +0 -23
  99. data/vendor/assets/javascripts/jquery.validate/localization/messages_he.js +0 -25
  100. data/vendor/assets/javascripts/jquery.validate/localization/messages_hr.js +0 -25
  101. data/vendor/assets/javascripts/jquery.validate/localization/messages_hu.js +0 -24
  102. data/vendor/assets/javascripts/jquery.validate/localization/messages_it.js +0 -25
  103. data/vendor/assets/javascripts/jquery.validate/localization/messages_ja.js +0 -25
  104. data/vendor/assets/javascripts/jquery.validate/localization/messages_ka.js +0 -25
  105. data/vendor/assets/javascripts/jquery.validate/localization/messages_kk.js +0 -25
  106. data/vendor/assets/javascripts/jquery.validate/localization/messages_ko.js +0 -25
  107. data/vendor/assets/javascripts/jquery.validate/localization/messages_lt.js +0 -25
  108. data/vendor/assets/javascripts/jquery.validate/localization/messages_lv.js +0 -25
  109. data/vendor/assets/javascripts/jquery.validate/localization/messages_ms.js +0 -25
  110. data/vendor/assets/javascripts/jquery.validate/localization/messages_nl.js +0 -35
  111. data/vendor/assets/javascripts/jquery.validate/localization/messages_no.js +0 -25
  112. data/vendor/assets/javascripts/jquery.validate/localization/messages_pl.js +0 -25
  113. data/vendor/assets/javascripts/jquery.validate/localization/messages_ptbr.js +0 -24
  114. data/vendor/assets/javascripts/jquery.validate/localization/messages_ptpt.js +0 -24
  115. data/vendor/assets/javascripts/jquery.validate/localization/messages_ro.js +0 -25
  116. data/vendor/assets/javascripts/jquery.validate/localization/messages_ru.js +0 -25
  117. data/vendor/assets/javascripts/jquery.validate/localization/messages_se.js +0 -23
  118. data/vendor/assets/javascripts/jquery.validate/localization/messages_si.js +0 -25
  119. data/vendor/assets/javascripts/jquery.validate/localization/messages_sk.js +0 -22
  120. data/vendor/assets/javascripts/jquery.validate/localization/messages_sl.js +0 -25
  121. data/vendor/assets/javascripts/jquery.validate/localization/messages_sr.js +0 -25
  122. data/vendor/assets/javascripts/jquery.validate/localization/messages_sv.js +0 -23
  123. data/vendor/assets/javascripts/jquery.validate/localization/messages_th.js +0 -25
  124. data/vendor/assets/javascripts/jquery.validate/localization/messages_tr.js +0 -25
  125. data/vendor/assets/javascripts/jquery.validate/localization/messages_tw.js +0 -24
  126. data/vendor/assets/javascripts/jquery.validate/localization/messages_uk.js +0 -25
  127. data/vendor/assets/javascripts/jquery.validate/localization/messages_vi.js +0 -25
  128. data/vendor/assets/javascripts/jquery.validate/localization/messages_zh.js +0 -25
  129. data/vendor/assets/javascripts/jquery.validate/localization/messages_zhtw.js +0 -26
  130. data/vendor/assets/javascripts/jquery.validate/localization/methods_de.js +0 -12
  131. data/vendor/assets/javascripts/jquery.validate/localization/methods_nl.js +0 -9
  132. data/vendor/assets/javascripts/jquery.validate/localization/methods_pt.js +0 -9
@@ -2,7 +2,7 @@
2
2
  <%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
3
3
 
4
4
  <div class="row" data-hook="checkout_header">
5
- <h1 class="columns three alpha" data-hook="checkout_title"><%= Spree.t(:checkout) %></h1>
5
+ <h1 class="columns three alpha" data-hook="checkout_title"><%= t('spree.checkout') %></h1>
6
6
  <div class="columns thirteen omega" data-hook="checkout_progress"><%= checkout_progress %></div>
7
7
  </div>
8
8
 
@@ -12,7 +12,7 @@
12
12
  <% if @order.state == 'address' || !@order.email? %>
13
13
  <p class="field" style='clear: both'>
14
14
  <%= form.label :email %><br />
15
- <%= form.email_field :email %>
15
+ <%= form.email_field :email, required: true %>
16
16
  </p>
17
17
  <% end %>
18
18
  <%= render @order.state, form: form %>
@@ -30,7 +30,3 @@
30
30
  Spree.current_order_id = "<%= @order.number %>"
31
31
  Spree.current_order_token = "<%= @order.guest_token %>"
32
32
  </script>
33
-
34
- <% if I18n.locale != :en %>
35
- <%= javascript_include_tag 'jquery.validate/localization/messages_' + I18n.locale.to_s.downcase.gsub('-', '') %>
36
- <% end %>
@@ -2,30 +2,30 @@
2
2
  <% param_prefix = "payment_source[#{payment_method.id}]" %>
3
3
 
4
4
  <p class="field">
5
- <%= label_tag "name_on_card_#{payment_method.id}", Spree.t(:name_on_card) %><span class="required">*</span><br />
5
+ <%= label_tag "name_on_card_#{payment_method.id}", t('spree.name_on_card') %><span class="required">*</span><br />
6
6
  <%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}", autocomplete: "cc-name" } %>
7
7
  </p>
8
8
 
9
9
  <p class="field" data-hook="card_number">
10
- <%= label_tag "card_number", Spree.t(:card_number) %><span class="required">*</span><br />
11
- <%= text_field_tag "#{param_prefix}[number]", '', {id: 'card_number', class: 'required cardNumber', size: 19, maxlength: 19, autocomplete: "cc-number", type: "tel"} %>
10
+ <%= label_tag "card_number", t('spree.card_number') %><span class="required">*</span><br />
11
+ <%= text_field_tag "#{param_prefix}[number]", '', {id: 'card_number', class: 'required cardNumber', size: 19, maxlength: 19, autocomplete: "cc-number", type: "tel" } %>
12
12
  &nbsp;
13
13
  <span id="card_type" style="display:none;">
14
- ( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
15
- <span id="unrecognized"><%= Spree.t(:unrecognized_card_type) %></span>
14
+ ( <span id="looks_like" ><%= t('spree.card_type_is') %> <span id="type"></span></span>
15
+ <span id="unrecognized"><%= t('spree.unrecognized_card_type') %></span>
16
16
  )
17
17
  </span>
18
18
  </p>
19
19
 
20
20
  <p class="field" data-hook="card_expiration">
21
- <%= label_tag "card_expiry", Spree.t(:expiration) %><span class="required">*</span><br />
21
+ <%= label_tag "card_expiry", t('spree.expiration') %><span class="required">*</span><br />
22
22
  <%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "required cardExpiry", placeholder: "MM / YY", type: "tel" %>
23
23
  </p>
24
24
 
25
25
  <p class="field" data-hook="card_code">
26
- <%= label_tag "card_code", Spree.t(:card_code) %><span class="required">*</span><br />
27
- <%= text_field_tag "#{param_prefix}[verification_value]", '', {id: 'card_code', class: 'required cardCode', size: 5, type: "tel", autocomplete: "off"} %>
28
- <%= link_to "(#{Spree.t(:what_is_this)})", spree.cvv_path, target: '_blank', "data-hook" => "cvv_link", id: "cvv_link" %>
26
+ <%= label_tag "card_code", t('spree.card_code') %><span class="required">*</span><br />
27
+ <%= text_field_tag "#{param_prefix}[verification_value]", '', {id: 'card_code', class: 'required cardCode', size: 5, type: "tel", autocomplete: "off" } %>
28
+ <%= link_to "(#{t('spree.what_is_this')})", spree.cvv_path, target: '_blank', "data-hook" => "cvv_link", id: "cvv_link" %>
29
29
  </p>
30
30
 
31
31
  <% if @order.bill_address %>
@@ -1,5 +1,5 @@
1
1
  <div class="cvv" data-hook>
2
- <h1><%= Spree.t(:what_is_a_cvv) %></h1>
2
+ <h1><%= t('spree.what_is_a_cvv') %></h1>
3
3
  <p>For Visa, MasterCard, and Discover cards, the card code is the last 3 digit number located on the back of your card on or above your signature line. For an American Express card, it is the 4 digits on the FRONT above the end of your card number.</p>
4
4
  <p>To help reduce fraud in the card-not-present environment, credit card companies have introduced a card code program. Visa calls this code Card Verification Value (CVV); MasterCard calls it Card Validation Code (CVC); Discover calls it Card ID (CID). The card code is a three- or four- digit security code that is printed on the back of cards. The number typically appears at the end of the signature panel.</p>
5
5
  <div class="cid-caption">Visa</div>
@@ -1,17 +1,17 @@
1
1
  <tbody id="cart_adjustments" data-hook>
2
2
  <% if @order.line_item_adjustments.exists? %>
3
3
  <% @order.line_item_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
4
- <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: Spree.t(:promotion) %>
4
+ <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: t('spree.promotion') %>
5
5
  <% end %>
6
6
  <% end %>
7
7
 
8
8
  <% @order.all_adjustments.tax.eligible.group_by(&:label).each do |label, adjustments| %>
9
- <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: Spree.t(:tax) %>
9
+ <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: t('spree.tax') %>
10
10
  <% end %>
11
11
 
12
12
  <% @order.shipments.each do |shipment| %>
13
13
  <tr>
14
- <td colspan="4" align='right'><h5><%= Spree.t(:shipping) %>: <%= shipment.shipping_method.name %></h5></td>
14
+ <td colspan="4" align='right'><h5><%= t('spree.shipping') %>: <%= shipment.shipping_method.name %></h5></td>
15
15
  <td colspan='2'>
16
16
  <h5><%= shipment.display_total_before_tax %></h5>
17
17
  </td>
@@ -19,6 +19,6 @@
19
19
  <% end %>
20
20
 
21
21
  <% @order.adjustments.eligible.group_by(&:label).each do |label, adjustments| %>
22
- <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: Spree.t(:adjustment) %>
22
+ <%= render "spree/orders/adjustment_row", label: label, adjustments: adjustments, type: t('spree.adjustment') %>
23
23
  <% end %>
24
24
  </tbody>
@@ -3,10 +3,10 @@
3
3
  <table id="cart-detail" data-hook>
4
4
  <thead>
5
5
  <tr data-hook="cart_items_headers">
6
- <th class="cart-item-description-header" colspan="2"><%= Spree.t(:item) %></th>
7
- <th class="cart-item-price-header"><%= Spree.t(:price) %></th>
8
- <th class="cart-item-quantity-header"><%= Spree.t(:qty) %></th>
9
- <th class="cart-item-total-header"><%= Spree.t(:total) %></th>
6
+ <th class="cart-item-description-header" colspan="2"><%= t('spree.item') %></th>
7
+ <th class="cart-item-price-header"><%= t('spree.price') %></th>
8
+ <th class="cart-item-quantity-header"><%= t('spree.qty') %></th>
9
+ <th class="cart-item-total-header"><%= t('spree.total') %></th>
10
10
  <th class="cart-item-delete-header"></th>
11
11
  </tr>
12
12
  </thead>
@@ -15,14 +15,14 @@
15
15
  </tbody>
16
16
  <% if order.adjustments.nonzero.exists? || order.line_item_adjustments.nonzero.exists? || order.shipment_adjustments.nonzero.exists? || order.shipments.any? %>
17
17
  <tr class="cart-subtotal">
18
- <td colspan="4" align='right'><h5><%= Spree.t(:cart_subtotal, count: order.line_items.sum(:quantity)) %></h5></th>
18
+ <td colspan="4" align='right'><h5><%= t('spree.cart_subtotal', count: order.line_items.sum(:quantity)) %></h5></th>
19
19
  <td colspan><h5><%= order.display_item_total %></h5></td>
20
20
  <td></td>
21
21
  </tr>
22
22
  <%= render "spree/orders/adjustments" %>
23
23
  <% end %>
24
24
  <tr class="cart-total">
25
- <td colspan="4" align='right'><h5><%= Spree.t(:total) %></h5></th>
25
+ <td colspan="4" align='right'><h5><%= t('spree.total') %></h5></th>
26
26
  <td colspan><h5><%= order.display_total %></h5></td>
27
27
  <td></td>
28
28
  </tr>
@@ -2,10 +2,10 @@
2
2
  <%= order_form.fields_for :line_items, line_item do |item_form| -%>
3
3
  <tr class="<%= cycle('', 'alt') %> line-item">
4
4
  <td class="cart-item-image" data-hook="cart_item_image">
5
- <% if variant.images.length == 0 %>
6
- <%= link_to image_tag(variant.product.display_image.attachment(:small)), variant.product %>
5
+ <% if variant.images.empty? %>
6
+ <%= link_to(render('spree/shared/image', image: variant.product.display_image, size: :small), variant.product) %>
7
7
  <% else %>
8
- <%= link_to image_tag(variant.images.first.attachment.url(:small)), variant.product %>
8
+ <%= link_to(render('spree/shared/image', image: variant.images.first, size: :small), variant.product) %>
9
9
  <% end %>
10
10
  </td>
11
11
  <td class="cart-item-description" data-hook="cart_item_description">
@@ -13,7 +13,7 @@
13
13
  <%= variant.options_text %>
14
14
  <% if line_item.insufficient_stock? %>
15
15
  <span class="out-of-stock">
16
- <%= Spree.t(:out_of_stock) %>&nbsp;&nbsp;<br />
16
+ <%= t('spree.out_of_stock') %>&nbsp;&nbsp;<br />
17
17
  </span>
18
18
  <% end %>
19
19
  <span class="line-item-description" data-hook="line_item_description">
@@ -1,12 +1,12 @@
1
1
  <% @body_id = 'cart' %>
2
2
  <div data-hook="cart_container">
3
- <h1><%= Spree.t(:shopping_cart) %></h1>
3
+ <h1><%= t('spree.shopping_cart') %></h1>
4
4
 
5
5
  <% if @order.line_items.empty? %>
6
6
 
7
7
  <div data-hook="empty_cart">
8
- <p><%= Spree.t(:your_cart_is_empty) %></p>
9
- <p><%= link_to Spree.t(:continue_shopping), products_path, class: 'button continue' %></p>
8
+ <p><%= t('spree.your_cart_is_empty') %></p>
9
+ <p><%= link_to t('spree.continue_shopping'), products_path, class: 'button continue' %></p>
10
10
  </div>
11
11
 
12
12
  <% else %>
@@ -20,12 +20,12 @@
20
20
  </div>
21
21
 
22
22
  <div class="links columns sixteen alpha omega" data-hook="cart_buttons">
23
- <%= order_form.text_field :coupon_code, size: 10, placeholder: Spree.t(:coupon_code) %>
23
+ <%= order_form.text_field :coupon_code, size: 10, placeholder: t('spree.coupon_code') %>
24
24
  <%= button_tag class: 'primary', id: 'update-button' do %>
25
- <%= Spree.t(:update) %>
25
+ <%= t('spree.update') %>
26
26
  <% end %>
27
27
  <%= button_tag class: 'button checkout primary', id: 'checkout-link', name: 'checkout' do %>
28
- <%= Spree.t(:checkout) %>
28
+ <%= t('spree.checkout') %>
29
29
  <% end %>
30
30
  </div>
31
31
 
@@ -36,9 +36,9 @@
36
36
  <div id="empty-cart" data-hook>
37
37
  <%= form_tag empty_cart_path, method: :put do %>
38
38
  <p id="clear_cart_link" data-hook>
39
- <%= submit_tag Spree.t(:empty_cart), class: 'button gray' %>
40
- <%= Spree.t(:or) %>
41
- <%= link_to Spree.t(:continue_shopping), products_path, class: 'continue button gray' %>
39
+ <%= submit_tag t('spree.empty_cart'), class: 'button gray' %>
40
+ <%= t('spree.or') %>
41
+ <%= link_to t('spree.continue_shopping'), products_path, class: 'continue button gray' %>
42
42
  </p>
43
43
  <% end %>
44
44
  </div>
@@ -1,8 +1,8 @@
1
1
  <fieldset id="order_summary" data-hook>
2
- <legend><%= Spree.t(:order_number, number: @order.number) %></legend>
2
+ <legend><%= t('spree.order_number', number: @order.number) %></legend>
3
3
  <h1><%= accurate_title %></h1>
4
4
  <% if order_just_completed?(@order) %>
5
- <strong><%= Spree.t(:thank_you_for_your_order) %></strong>
5
+ <strong><%= t('spree.thank_you_for_your_order') %></strong>
6
6
  <% end %>
7
7
 
8
8
  <div id="order" data-hook>
@@ -11,10 +11,10 @@
11
11
  <br class="clear" />
12
12
 
13
13
  <p data-hook="links">
14
- <%= link_to Spree.t(:back_to_store), spree.root_path, class: "button" %>
14
+ <%= link_to t('spree.back_to_store'), spree.root_path, class: "button" %>
15
15
  <% unless order_just_completed?(@order) %>
16
16
  <% if try_spree_current_user && respond_to?(:account_path) %>
17
- <%= link_to Spree.t(:my_account), spree.account_path, class: "button" %>
17
+ <%= link_to t('spree.my_account'), spree.account_path, class: "button" %>
18
18
  <% end %>
19
19
  <% end %>
20
20
  </p>
@@ -5,7 +5,7 @@
5
5
  <%= image_tag "credit_cards/icons/#{cc_type}.png" %>
6
6
  <% end %>
7
7
  <% if source.last_digits %>
8
- <%= Spree.t(:ending_in) %> <%= source.last_digits %>
8
+ <%= t('spree.ending_in') %> <%= source.last_digits %>
9
9
  <% end %>
10
10
  </span>
11
11
  <br />
@@ -3,7 +3,7 @@
3
3
 
4
4
  <% if @product.variants_and_option_values_for(current_pricing_options).any? %>
5
5
  <div id="product-variants" class="columns five alpha">
6
- <h6 class="product-section-title"><%= Spree.t(:variants) %></h6>
6
+ <h6 class="product-section-title"><%= t('spree.variants') %></h6>
7
7
  <ul>
8
8
  <% @product.variants_and_option_values_for(current_pricing_options).each_with_index do |variant, index| %>
9
9
  <li>
@@ -17,11 +17,11 @@
17
17
  <% end %>
18
18
 
19
19
  <% unless variant.can_supply? %>
20
- <span class="out-of-stock"><%= Spree.t(:out_of_stock) %></span>
20
+ <span class="out-of-stock"><%= t('spree.out_of_stock') %></span>
21
21
  <% end %>
22
22
  <% end %>
23
23
  </li>
24
- <% end%>
24
+ <% end %>
25
25
  </ul>
26
26
  </div>
27
27
  <% else %>
@@ -32,7 +32,7 @@
32
32
  <div data-hook="product_price" class="columns five <%= !@product.has_variants? ? 'alpha' : 'omega' %>">
33
33
 
34
34
  <div id="product-price">
35
- <h6 class="product-section-title"><%= Spree.t(:price) %></h6>
35
+ <h6 class="product-section-title"><%= t('spree.price') %></h6>
36
36
  <div>
37
37
  <span class="price selling" itemprop="price" content="<%= @product.price_for(current_pricing_options).to_d %>">
38
38
  <%= display_price(@product) %>
@@ -44,21 +44,21 @@
44
44
  <link itemprop="availability" href="http://schema.org/InStock" />
45
45
  <% elsif @product.variants.empty? %>
46
46
  <br />
47
- <span class="out-of-stock"><%= Spree.t(:out_of_stock) %></span>
47
+ <span class="out-of-stock"><%= t('spree.out_of_stock') %></span>
48
48
  <% end %>
49
49
  </div>
50
50
 
51
51
  <div class="add-to-cart">
52
52
  <%= number_field_tag :quantity, 1, class: 'title', min: 1 %>
53
53
  <%= button_tag class: 'large primary', id: 'add-to-cart-button', type: :submit do %>
54
- <%= Spree.t(:add_to_cart) %>
54
+ <%= t('spree.add_to_cart') %>
55
55
  <% end %>
56
56
  </div>
57
57
  </div>
58
58
  <% else %>
59
59
  <div id="product-price">
60
60
  <br>
61
- <div><span class="price selling" itemprop="price"><%= Spree.t('product_not_available_in_this_currency') %></span></div>
61
+ <div><span class="price selling" itemprop="price"><%= t('spree.product_not_available_in_this_currency') %></span></div>
62
62
  </div>
63
63
  <% end %>
64
64
  </div>
@@ -1,5 +1,5 @@
1
1
  <% if defined?(image) && image %>
2
- <%= image_tag image.attachment.url(:product), itemprop: "image" %>
2
+ <%= render 'spree/shared/image', image: image, size: :product, itemprop: "image" %>
3
3
  <% else %>
4
- <%= image_tag @product.display_image.attachment(:product), itemprop: "image" %>
4
+ <%= render 'spree/shared/image', image: @product.display_image, size: :product, itemprop: "image" %>
5
5
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <% promotions = @product.possible_promotions %>
2
2
  <% if promotions.any? %>
3
3
  <div id="promotions">
4
- <h3><%= Spree.t(:promotions) %></h3>
4
+ <h3><%= t('spree.promotions') %></h3>
5
5
  <% promotions.each do |promotion| %>
6
6
  <div>
7
7
  <h4><%= promotion.name %></h4>
@@ -1,5 +1,5 @@
1
1
  <% unless @product_properties.empty? %>
2
- <h6 class="product-section-title"><%= Spree.t('properties')%></h6>
2
+ <h6 class="product-section-title"><%= t('spree.properties')%></h6>
3
3
  <table id="product-properties" class="table-display" data-hook>
4
4
  <tbody>
5
5
  <% @product_properties.each do |product_property| %>
@@ -1,6 +1,6 @@
1
1
  <% if !@product.taxons.blank? %>
2
2
  <div id="taxon-crumbs" data-hook class="alpha columns five omega">
3
- <h6 class="product-section-title"><%= Spree.t(:look_for_similar_items) %></h6>
3
+ <h6 class="product-section-title"><%= t('spree.look_for_similar_items') %></h6>
4
4
 
5
5
  <div data-hook="product_taxons">
6
6
  <ul id="similar_items_by_taxon" data-hook>
@@ -13,7 +13,7 @@
13
13
 
14
14
  <div data-hook="search_results">
15
15
  <% if @products.empty? %>
16
- <h6 class="search-results-title"><%= Spree.t(:no_products_found) %></h6>
16
+ <h6 class="search-results-title"><%= t('spree.no_products_found') %></h6>
17
17
  <% else %>
18
18
  <%= render partial: 'spree/shared/products', locals: { products: @products, taxon: @taxon } %>
19
19
  <% end %>
@@ -33,7 +33,7 @@
33
33
  <h1 class="product-title" itemprop="name"><%= @product.name %></h1>
34
34
 
35
35
  <div itemprop="description" data-hook="description">
36
- <%= product_description(@product) rescue Spree.t(:product_has_no_description) %>
36
+ <%= product_description(@product) rescue t('spree.product_has_no_description') %>
37
37
  </div>
38
38
 
39
39
  <div id="cart-form" data-hook="cart_form">
@@ -25,13 +25,13 @@
25
25
  </div>
26
26
  <% unless address.phone.blank? %>
27
27
  <div class="tel">
28
- <span class="type"><%= Spree.t(:phone) %></span>
28
+ <span class="type"><%= t('spree.phone') %></span>
29
29
  <%= address.phone %>
30
30
  </div>
31
31
  <% end %>
32
32
  <% unless address.alternative_phone.blank? %>
33
33
  <div class="alternative-phone tel">
34
- <span class="type"><%= Spree.t(:alternative_phone) %></span>
34
+ <span class="type"><%= t('spree.alternative_phone') %></span>
35
35
  <%= address.alternative_phone %>
36
36
  </div>
37
37
  <% end %>
@@ -1,4 +1,4 @@
1
- <% filters = @taxon ? @taxon.applicable_filters : [Spree::Core::ProductFilters.all_taxons] %>
1
+ <% filters = @taxon.applicable_filters %>
2
2
  <% unless filters.empty? %>
3
3
  <%= form_tag '', method: :get, id: 'sidebar_products_search' do %>
4
4
  <%= hidden_field_tag 'per_page', params[:per_page] %>
@@ -22,6 +22,6 @@
22
22
  </ul>
23
23
  </div>
24
24
  <% end %>
25
- <%= submit_tag Spree.t(:search), name: nil %>
25
+ <%= submit_tag t('spree.search'), name: nil %>
26
26
  <% end %>
27
27
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <footer id="footer" class="sixteen columns" data-hook>
2
2
  <div id="footer-left" class="columns alpha eight" data-hook>
3
- <p><%= Spree.t :powered_by %> <%= link_to 'Solidus', 'http://solidus.io/' %></p>
3
+ <p><%= t 'spree.powered_by' %> <%= link_to 'Solidus', 'http://solidus.io/' %></p>
4
4
  </div>
5
5
  <div id="footer-right" class="columns omega eight" data-hook></div>
6
6
  </footer>
@@ -0,0 +1,12 @@
1
+ <% size ||= :mini %>
2
+ <% itemprop ||= nil %>
3
+
4
+ <% if image && image.attachment? %>
5
+ <% if itemprop %>
6
+ <%= image_tag image.attachment(size), itemprop: itemprop %>
7
+ <% else %>
8
+ <%= image_tag image.attachment(size) %>
9
+ <% end %>
10
+ <% else %>
11
+ <span class="image-placeholder <%= size %>"></span>
12
+ <% end %>
@@ -0,0 +1 @@
1
+ <%# solidus_auth_devise or a custom auth system can replace this partial %>
@@ -1,9 +1,9 @@
1
1
  <nav class="columns sixteen">
2
2
  <ul id="main-nav-bar" class="inline" data-hook>
3
- <li id="home-link" data-hook><%= link_to Spree.t(:home), spree.root_path %></li>
3
+ <li id="home-link" data-hook><%= link_to t('spree.home'), spree.root_path %></li>
4
4
  <li id="link-to-cart" data-hook>
5
5
  <noscript>
6
- <%= link_to Spree.t(:cart), spree.cart_path %>
6
+ <%= link_to t('spree.cart'), spree.cart_path %>
7
7
  </noscript>
8
8
  &nbsp;
9
9
  </li>
@@ -1,5 +1,6 @@
1
1
  <nav id="top-nav-bar" class="columns ten">
2
2
  <ul id="nav-bar" class="inline" data-hook>
3
+ <%= render 'spree/shared/login_bar_items' %>
3
4
  <li id="search-bar" data-hook>
4
5
  <%= render partial: 'spree/shared/search' %>
5
6
  </li>
@@ -3,23 +3,23 @@
3
3
  <% if order.has_checkout_step?("address") %>
4
4
 
5
5
  <div class="columns alpha four" data-hook="order-bill-address">
6
- <h6><%= Spree.t(:billing_address) %> <%= link_to "(#{Spree.t('actions.edit')})", checkout_state_path(:address) unless order.completed? %></h6>
6
+ <h6><%= t('spree.billing_address') %> <%= link_to "(#{t('spree.actions.edit')})", checkout_state_path(:address) unless order.completed? %></h6>
7
7
  <%= render partial: 'spree/shared/address', locals: { address: order.bill_address } %>
8
8
  </div>
9
9
 
10
10
  <% if order.has_checkout_step?("delivery") %>
11
11
  <div class="columns alpha four" data-hook="order-ship-address">
12
- <h6><%= Spree.t(:shipping_address) %> <%= link_to "(#{Spree.t('actions.edit')})", checkout_state_path(:address) unless order.completed? %></h6>
12
+ <h6><%= t('spree.shipping_address') %> <%= link_to "(#{t('spree.actions.edit')})", checkout_state_path(:address) unless order.completed? %></h6>
13
13
  <%= render partial: 'spree/shared/address', locals: { address: order.ship_address } %>
14
14
  </div>
15
15
 
16
16
  <div class="columns alpha four" data-hook="order-shipment">
17
- <h6><%= Spree.t(:shipments) %> <%= link_to "(#{Spree.t('actions.edit')})", checkout_state_path(:delivery) unless order.completed? %></h6>
17
+ <h6><%= t('spree.shipments') %> <%= link_to "(#{t('spree.actions.edit')})", checkout_state_path(:delivery) unless order.completed? %></h6>
18
18
  <div class="delivery">
19
19
  <% order.shipments.each do |shipment| %>
20
20
  <div>
21
21
  <i class='fa fa-truck'></i>
22
- <%= Spree.t(:shipment_details, stock_location: shipment.stock_location.name, shipping_method: shipment.selected_shipping_rate.name) %>
22
+ <%= t('spree.shipment_details', stock_location: shipment.stock_location.name, shipping_method: shipment.selected_shipping_rate.name) %>
23
23
  </div>
24
24
  <% end %>
25
25
  </div>
@@ -30,7 +30,7 @@
30
30
 
31
31
  <% if order.has_checkout_step?("payment") %>
32
32
  <div class="columns omega four">
33
- <h6><%= Spree.t(:payment_information) %> <%= link_to "(#{Spree.t('actions.edit')})", checkout_state_path(:payment) unless order.completed? %></h6>
33
+ <h6><%= t('spree.payment_information') %> <%= link_to "(#{t('spree.actions.edit')})", checkout_state_path(:payment) unless order.completed? %></h6>
34
34
  <div class="payment-info">
35
35
  <% order.payments.valid.each do |payment| %>
36
36
  <%= render payment %><br/>
@@ -51,10 +51,10 @@
51
51
 
52
52
  <thead data-hook>
53
53
  <tr data-hook="order_details_line_items_headers">
54
- <th colspan="2"><%= Spree.t(:item) %></th>
55
- <th class="price"><%= Spree.t(:price) %></th>
56
- <th class="qty"><%= Spree.t(:qty) %></th>
57
- <th class="total"><span><%= Spree.t(:total) %></span></th>
54
+ <th colspan="2"><%= t('spree.item') %></th>
55
+ <th class="price"><%= t('spree.price') %></th>
56
+ <th class="qty"><%= t('spree.qty') %></th>
57
+ <th class="total"><span><%= t('spree.total') %></span></th>
58
58
  </tr>
59
59
  </thead>
60
60
 
@@ -62,10 +62,10 @@
62
62
  <% order.line_items.each do |item| %>
63
63
  <tr data-hook="order_details_line_item_row">
64
64
  <td data-hook="order_item_image">
65
- <% if item.variant.images.length == 0 %>
66
- <%= link_to image_tag(item.variant.product.display_image.attachment(:small)), item.variant.product %>
65
+ <% if item.variant.images.empty? %>
66
+ <%= link_to(render('spree/shared/image', image: item.variant.product.display_image, size: :small), item.variant.product) %>
67
67
  <% else %>
68
- <%= link_to image_tag(item.variant.images.first.attachment.url(:small)), item.variant.product %>
68
+ <%= link_to(render('spree/shared/image', image: item.variant.images.first, size: :small), item.variant.product) %>
69
69
  <% end %>
70
70
  </td>
71
71
  <td data-hook="order_item_description">
@@ -81,24 +81,24 @@
81
81
  </tbody>
82
82
  <tfoot id="order-total" data-hook="order_details_total">
83
83
  <tr class="total">
84
- <td colspan="4"><b><%= Spree.t(:order_total) %>:</b></td>
84
+ <td colspan="4"><b><%= t('spree.order_total') %>:</b></td>
85
85
  <td class="total"><span id="order_total"><%= order.display_order_total_after_store_credit.to_html %></span></td>
86
86
  </tr>
87
87
  </tfoot>
88
88
 
89
89
  <tfoot id="subtotal" data-hook="order_details_subtotal">
90
90
  <tr class="total" id="subtotal-row">
91
- <td colspan="4"><b><%= Spree.t(:subtotal) %>:</b></td>
91
+ <td colspan="4"><b><%= t('spree.subtotal') %>:</b></td>
92
92
  <td class="total"><span><%= order.display_item_total.to_html %></span></td>
93
93
  </tr>
94
94
  </tfoot>
95
95
 
96
96
  <% if order.line_item_adjustments.exists? %>
97
- <% if order.all_adjustments.promotion.eligible.exists? %>
97
+ <% if order.line_item_adjustments.promotion.eligible.exists? %>
98
98
  <tfoot id="price-adjustments" data-hook="order_details_price_adjustments">
99
- <% order.all_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
99
+ <% order.line_item_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
100
100
  <tr class="total">
101
- <td colspan="4"><%= Spree.t(:promotion) %>: <strong><%= label %></strong></td>
101
+ <td colspan="4"><%= t('spree.promotion') %>: <strong><%= label %></strong></td>
102
102
  <td class="total"><span><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency) %></span></td>
103
103
  </tr>
104
104
  <% end %>
@@ -109,7 +109,7 @@
109
109
  <tfoot id='shipment-total'>
110
110
  <% order.shipments.group_by { |s| s.selected_shipping_rate.name }.each do |name, shipments| %>
111
111
  <tr class="total" data-hook='shipment-row'>
112
- <td colspan="4"><%= Spree.t(:shipping) %>: <strong><%= name %></strong></td>
112
+ <td colspan="4"><%= t('spree.shipping') %>: <strong><%= name %></strong></td>
113
113
  <td class="total"><span><%= Spree::Money.new(shipments.sum(&:total_before_tax), currency: order.currency).to_html %></span></td>
114
114
  </tr>
115
115
  <% end %>
@@ -119,7 +119,7 @@
119
119
  <tfoot id="tax-adjustments" data-hook="order_details_tax_adjustments">
120
120
  <% order.all_adjustments.tax.group_by(&:label).each do |label, adjustments| %>
121
121
  <tr class="total">
122
- <td colspan="4"><%= Spree.t(:tax) %>: <strong><%= label %></strong></td>
122
+ <td colspan="4"><%= t('spree.tax') %>: <strong><%= label %></strong></td>
123
123
  <td class="total"><span><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency) %></span></td>
124
124
  </tr>
125
125
  <% end %>
@@ -129,7 +129,7 @@
129
129
  <% if order.total_applicable_store_credit > 0.0 %>
130
130
  <tfoot id="store-credit" data-hook="order_details_store_credit">
131
131
  <tr class="total">
132
- <td colspan='4'><%= Spree.t("store_credit.store_credit") %>:</td>
132
+ <td colspan='4'><%= t('spree.store_credit.store_credit') %>:</td>
133
133
  <td class='total'><span><%= order.display_total_applicable_store_credit.to_html %></span></td>
134
134
  </tr>
135
135
  </tfoot>