spree_frontend 3.7.14.1 → 4.0.0.beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/app/assets/javascripts/spree/frontend/checkout/address.js +42 -14
  4. data/app/assets/javascripts/spree/frontend/checkout/address_book.js +56 -0
  5. data/app/assets/javascripts/spree/frontend/product.js +54 -39
  6. data/app/assets/javascripts/spree/frontend.js +4 -1
  7. data/app/assets/stylesheets/spree/frontend/_variables.scss +1 -1
  8. data/app/assets/stylesheets/spree/frontend/address_book.scss +8 -0
  9. data/app/assets/stylesheets/spree/frontend/frontend_bootstrap.css.scss +13 -35
  10. data/app/assets/stylesheets/spree/frontend.css +1 -0
  11. data/app/controllers/concerns/spree/checkout/address_book.rb +53 -0
  12. data/app/controllers/spree/addresses_controller.rb +72 -0
  13. data/app/controllers/spree/checkout_controller.rb +2 -0
  14. data/app/controllers/spree/orders_controller.rb +0 -55
  15. data/app/controllers/spree/products_controller.rb +5 -1
  16. data/app/controllers/spree/store_controller.rb +1 -1
  17. data/app/helpers/spree/addresses_helper.rb +36 -0
  18. data/app/helpers/spree/frontend_helper.rb +16 -15
  19. data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_first_page.html.erb +2 -2
  20. data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_gap.html.erb +5 -1
  21. data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_last_page.html.erb +2 -2
  22. data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_next_page.html.erb +2 -2
  23. data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_page.html.erb +8 -2
  24. data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_paginator.html.erb +1 -1
  25. data/app/views/kaminari/{twitter-bootstrap-3 → twitter-bootstrap-4}/_prev_page.html.erb +2 -2
  26. data/app/views/spree/address/_form.html.erb +27 -24
  27. data/app/views/spree/addresses/_form.html.erb +18 -0
  28. data/app/views/spree/addresses/destroy.js.erb +2 -0
  29. data/app/views/spree/addresses/edit.html.erb +23 -0
  30. data/app/views/spree/addresses/new.html.erb +23 -0
  31. data/app/views/spree/checkout/_address.html.erb +61 -37
  32. data/app/views/spree/checkout/_confirm.html.erb +12 -10
  33. data/app/views/spree/checkout/_delivery.html.erb +27 -15
  34. data/app/views/spree/checkout/_payment.html.erb +14 -9
  35. data/app/views/spree/checkout/_summary.html.erb +59 -57
  36. data/app/views/spree/checkout/edit.html.erb +6 -6
  37. data/app/views/spree/checkout/payment/_gateway.html.erb +43 -35
  38. data/app/views/spree/layouts/spree_application.html.erb +5 -2
  39. data/app/views/spree/orders/_form.html.erb +38 -25
  40. data/app/views/spree/orders/edit.html.erb +28 -22
  41. data/app/views/spree/orders/show.html.erb +2 -1
  42. data/app/views/spree/products/_cart_form.html.erb +28 -26
  43. data/app/views/spree/products/_product.html.erb +7 -8
  44. data/app/views/spree/products/_promotions.html.erb +13 -11
  45. data/app/views/spree/products/_properties.html.erb +10 -3
  46. data/app/views/spree/products/_thumbnails.html.erb +5 -7
  47. data/app/views/spree/products/show.html.erb +8 -8
  48. data/app/views/spree/shared/_filters.html.erb +29 -9
  49. data/app/views/spree/shared/_header.html.erb +2 -2
  50. data/app/views/spree/shared/_login_bar.html.erb +9 -3
  51. data/app/views/spree/shared/_main_nav_bar.html.erb +15 -15
  52. data/app/views/spree/shared/_nav_bar.html.erb +2 -2
  53. data/app/views/spree/shared/_order_details.html.erb +143 -89
  54. data/app/views/spree/shared/_products.html.erb +2 -2
  55. data/app/views/spree/shared/_search.html.erb +19 -12
  56. data/app/views/spree/shared/_sidebar.html.erb +1 -1
  57. data/app/views/spree/shared/_taxonomies.html.erb +7 -3
  58. data/config/routes.rb +2 -0
  59. data/lib/spree/frontend/engine.rb +4 -0
  60. data/lib/spree/frontend.rb +3 -3
  61. data/spree_frontend.gemspec +4 -3
  62. metadata +48 -25
@@ -1,14 +1,16 @@
1
- <div class="panel panel-default" id='shipping_method' data-hook>
2
- <div class="panel-heading">
3
- <h3 class="panel-title"><%= Spree.t(:delivery) %></h3>
1
+ <div class="card" id='shipping_method' data-hook>
2
+ <div class="card-header">
3
+ <h3 class="card-title mb-0 h5"><%= Spree.t(:delivery) %></h3>
4
4
  </div>
5
- <div class="panel-body" data-hook="shipping_method_inner">
5
+ <div class="card-body" data-hook="shipping_method_inner">
6
6
  <div id="methods">
7
7
  <%= form.fields_for :shipments do |ship_form| %>
8
8
  <div class="shipment">
9
- <h4 class="stock-location" data-hook="stock-location">
9
+ <h4 class="stock-location h5" data-hook="stock-location">
10
10
  <%= Spree.t(:package_from) %>
11
- <strong class="stock-location-name" data-hook="stock-location-name"><%= ship_form.object.stock_location.name %></strong>
11
+ <strong class="stock-location-name" data-hook="stock-location-name">
12
+ <%= ship_form.object.stock_location.name %>
13
+ </strong>
12
14
  </h4>
13
15
 
14
16
  <table class="table stock-contents" data-hook="stock-contents">
@@ -38,14 +40,22 @@
38
40
  </tbody>
39
41
  </table>
40
42
 
41
- <h4 class="stock-shipping-method-title"><%= Spree.t(:shipping_method) %></h4>
43
+ <h4 class="stock-shipping-method-title h5">
44
+ <%= Spree.t(:shipping_method) %>
45
+ </h4>
46
+
42
47
  <ul class="list-group shipping-methods">
43
48
  <% ship_form.object.shipping_rates.each do |rate| %>
44
49
  <li class="list-group-item shipping-method">
45
50
  <label>
46
- <%= ship_form.radio_button :selected_shipping_rate_id, rate.id, data: { behavior: 'shipping-method-selector', cost: rate.display_cost } %>
51
+ <%= ship_form.radio_button :selected_shipping_rate_id,
52
+ rate.id,
53
+ data: {
54
+ behavior: 'shipping-method-selector',
55
+ cost: rate.display_cost
56
+ } %>
47
57
  <span class="rate-name"><%= rate.name %></span>
48
- <span class="badge rate-cost"><%= rate.display_cost %></span>
58
+ <span class="badge badge-secondary rate-cost"><%= rate.display_cost %></span>
49
59
  </label>
50
60
  </li>
51
61
  <% end %>
@@ -55,7 +65,7 @@
55
65
 
56
66
  <% if @differentiator.try(:missing?) %>
57
67
  <div class="shipment unshippable">
58
- <h3 class="stock-location" data-hook="stock-location">
68
+ <h3 class="stock-location mb-0 h5" data-hook="stock-location">
59
69
  <%= Spree.t(:unshippable_items) %>
60
70
  </h3>
61
71
  <table class="table stock-contents" data-hook="stock-missing">
@@ -87,17 +97,19 @@
87
97
  </div>
88
98
  <% if Spree::Config[:shipping_instructions] %>
89
99
  <p id="minstrs" data-hook>
90
- <h4><%= Spree.t(:shipping_instructions) %></h4>
100
+ <h4 class="h5">
101
+ <%= Spree.t(:shipping_instructions) %>
102
+ </h4>
91
103
  <%= form.text_area :special_instructions, cols: 40, rows: 4, class: "form-control" %>
92
104
  </p>
93
105
  <% end %>
94
106
  </div>
95
107
  </div>
96
108
 
97
- <br />
98
-
99
- <div class="well text-right form-buttons" data-hook="buttons">
100
- <%= submit_tag Spree.t(:save_and_continue), class: 'btn btn-lg btn-success' %>
109
+ <div class="card my-4 text-right form-buttons" data-hook="buttons">
110
+ <div class="card-body">
111
+ <%= submit_tag Spree.t(:save_and_continue), class: 'btn btn-lg btn-success' %>
112
+ </div>
101
113
  </div>
102
114
 
103
115
  <%= javascript_include_tag 'spree/frontend/checkout/shipment' %>
@@ -1,8 +1,11 @@
1
- <div class="panel panel-default" id="payment" data-hook>
2
- <div class="panel-heading">
3
- <h3 class="panel-title"><%= Spree.t(:payment_information) %></h3>
1
+ <div class="card" id="payment" data-hook>
2
+ <div class="card-header">
3
+ <h3 class="card-title mb-0 h5">
4
+ <%= Spree.t(:payment_information) %>
5
+ </h3>
4
6
  </div>
5
- <div class="panel-body" data-hook="checkout_payment_step">
7
+
8
+ <div class="card-body" data-hook="checkout_payment_step">
6
9
  <% if @payment_sources.present? %>
7
10
  <div class="card_options">
8
11
  <%= radio_button_tag 'use_existing_card', 'yes', true %>
@@ -48,7 +51,7 @@
48
51
  <% end %>
49
52
  </ul>
50
53
 
51
- <ul class="nav" id="payment-methods" data-hook>
54
+ <ul id="payment-methods" class="list-unstyled position-relative" data-hook>
52
55
  <% @order.available_payment_methods.each do |method| %>
53
56
  <li id="payment_method_<%= method.id %>" class="<%= 'last' if method == @order.available_payment_methods.last %>" data-hook>
54
57
  <fieldset>
@@ -60,7 +63,7 @@
60
63
 
61
64
 
62
65
  <% if Spree::Frontend::Config[:coupon_codes_enabled] %>
63
- <p class='field' data-hook='coupon_code'>
66
+ <p class='field mb-0' data-hook='coupon_code'>
64
67
  <%= form.label :coupon_code %>
65
68
  <%= form.text_field :coupon_code, class: 'form-control' %>
66
69
  </p>
@@ -68,7 +71,9 @@
68
71
  </div>
69
72
  </div>
70
73
 
71
- <div class="well text-right form-buttons" data-hook="buttons">
72
- <%= submit_tag Spree.t(:save_and_continue), class: 'btn btn-lg btn-success primary' %>
73
- <script>Spree.disableSaveOnClick();</script>
74
+ <div class="card text-right form-buttons my-4" data-hook="buttons">
75
+ <div class="card-body">
76
+ <%= submit_tag Spree.t(:save_and_continue), class: 'btn btn-lg btn-success primary' %>
77
+ <script>Spree.disableSaveOnClick();</script>
78
+ </div>
74
79
  </div>
@@ -1,77 +1,79 @@
1
1
  <h3><%= Spree.t(:order_summary) %></h3>
2
2
 
3
- <table class="table" data-hook="order_summary">
4
- <tbody>
5
- <tr data-hook="item_total">
6
- <td><strong><%= Spree.t(:item_total) %>:</strong></td>
7
- <td><strong><%= order.display_item_total.to_html %></strong></td>
8
- </tr>
3
+ <div class="table-responsive">
4
+ <table class="table" data-hook="order_summary">
5
+ <tbody>
6
+ <tr data-hook="item_total">
7
+ <td><strong><%= Spree.t(:item_total) %>:</strong></td>
8
+ <td><strong><%= order.display_item_total.to_html %></strong></td>
9
+ </tr>
10
+
11
+ <% if order.line_item_adjustments.nonzero.exists? %>
12
+ <tbody data-hook="order_details_promotion_adjustments">
13
+ <% order.line_item_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
14
+ <tr class="total">
15
+ <td><%= label %></td>
16
+ <td><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %></td>
17
+ </tr>
18
+ <% end %>
19
+ </tbody>
20
+ <% end %>
9
21
 
10
- <% if order.line_item_adjustments.nonzero.exists? %>
11
- <tbody data-hook="order_details_promotion_adjustments">
12
- <% order.line_item_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
22
+ <tbody data-hook="order_details_tax_adjustments">
23
+ <% order.all_adjustments.nonzero.tax.eligible.group_by(&:label).each do |label, adjustments| %>
13
24
  <tr class="total">
14
25
  <td><%= label %></td>
15
26
  <td><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %></td>
16
27
  </tr>
17
28
  <% end %>
18
29
  </tbody>
19
- <% end %>
20
30
 
21
- <tbody data-hook="order_details_tax_adjustments">
22
- <% order.all_adjustments.nonzero.tax.eligible.group_by(&:label).each do |label, adjustments| %>
23
- <tr class="total">
24
- <td><%= label %></td>
25
- <td><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %></td>
31
+ <% if order.passed_checkout_step?("address") && order.shipments.any? %>
32
+ <tr data-hook="shipping_total">
33
+ <td><%= Spree.t(:shipping_total) %>:</td>
34
+ <% shipping_total = Spree::Money.new(order.shipments.to_a.sum(&:cost), currency: order.currency) %>
35
+ <td data-hook='shipping-total' data-currency='<%= Money::Currency.find(order.currency).symbol %>' thousands-separator='<%= shipping_total.thousands_separator %>' decimal-mark='<%= shipping_total.decimal_mark %>'><%= shipping_total.to_html %></td>
26
36
  </tr>
27
- <% end %>
28
- </tbody>
29
37
 
30
- <% if order.passed_checkout_step?("address") && order.shipments.any? %>
31
- <tr data-hook="shipping_total">
32
- <td><%= Spree.t(:shipping_total) %>:</td>
33
- <% shipping_total = Spree::Money.new(order.shipments.to_a.sum(&:cost), currency: order.currency) %>
34
- <td data-hook='shipping-total' data-currency='<%= Money::Currency.find(order.currency).symbol %>' thousands-separator='<%= shipping_total.thousands_separator %>' decimal-mark='<%= shipping_total.decimal_mark %>'><%= shipping_total.to_html %></td>
35
- </tr>
38
+ <% if order.shipment_adjustments.nonzero.exists? %>
39
+ <tbody data-hook="order_details_shipment_promotion_adjustments">
40
+ <% order.shipment_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
41
+ <tr class="total">
42
+ <td><%= label %>:</td>
43
+ <td><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %></td>
44
+ </tr>
45
+ <% end %>
46
+ </tbody>
47
+ <% end %>
48
+ <% end %>
36
49
 
37
- <% if order.shipment_adjustments.nonzero.exists? %>
38
- <tbody data-hook="order_details_shipment_promotion_adjustments">
39
- <% order.shipment_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
50
+ <% if order.adjustments.nonzero.eligible.exists? %>
51
+ <tbody id="summary-order-charges" data-hook>
52
+ <% order.adjustments.nonzero.eligible.each do |adjustment| %>
53
+ <% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
40
54
  <tr class="total">
41
- <td><%= label %>:</td>
42
- <td><%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %></td>
55
+ <td><%= adjustment.label %>:</td>
56
+ <td><%= adjustment.display_amount.to_html %></td>
43
57
  </tr>
44
58
  <% end %>
45
59
  </tbody>
46
60
  <% end %>
47
- <% end %>
48
-
49
- <% if order.adjustments.nonzero.eligible.exists? %>
50
- <tbody id="summary-order-charges" data-hook>
51
- <% order.adjustments.nonzero.eligible.each do |adjustment| %>
52
- <% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
53
- <tr class="total">
54
- <td><%= adjustment.label %>:</td>
55
- <td><%= adjustment.display_amount.to_html %></td>
56
- </tr>
57
- <% end %>
58
- </tbody>
59
- <% end %>
60
-
61
- <tr data-hook="order_total">
62
- <td><strong><%= Spree.t(:order_total) %>:</strong></td>
63
- <td>
64
- <strong>
65
- <span id='summary-order-total' class="lead text-primary" data-currency="<%= Money::Currency.find(order.currency).symbol %>"><%= order.display_total.to_html %></span>
66
- </strong>
67
- </td>
68
- </tr>
69
61
 
70
- <% if order.using_store_credit? %>
71
- <tr data-hook="order_details_store_credit">
72
- <td><strong><%= Spree.t(:store_credit_name) %>:</strong></td>
73
- <td><span id='summary-store-credit'><%= order.display_total_applied_store_credit.to_html %></span></td>
62
+ <tr data-hook="order_total">
63
+ <td><strong><%= Spree.t(:order_total) %>:</strong></td>
64
+ <td>
65
+ <strong>
66
+ <span id='summary-order-total' class="lead text-primary" data-currency="<%= Money::Currency.find(order.currency).symbol %>"><%= order.display_total.to_html %></span>
67
+ </strong>
68
+ </td>
74
69
  </tr>
75
- <% end %>
76
- </tbody>
77
- </table>
70
+
71
+ <% if order.using_store_credit? %>
72
+ <tr data-hook="order_details_store_credit">
73
+ <td><strong><%= Spree.t(:store_credit_name) %>:</strong></td>
74
+ <td><span id='summary-store-credit'><%= order.display_total_applied_store_credit.to_html %></span></td>
75
+ </tr>
76
+ <% end %>
77
+ </tbody>
78
+ </table>
79
+ </div>
@@ -3,11 +3,11 @@
3
3
  <div id="checkout" data-hook>
4
4
  <%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
5
5
 
6
- <div class="row" data-hook="checkout_header">
7
- <div class="col-sm-3">
8
- <h1 data-hook="checkout_title"><%= Spree.t(:checkout) %></h1>
6
+ <div class="row align-items-center" data-hook="checkout_header">
7
+ <div class="col-md-3 mb-4">
8
+ <h1 class="mb-0" data-hook="checkout_title"><%= Spree.t(:checkout) %></h1>
9
9
  </div>
10
- <div class="col-sm-9" data-hook="checkout_progress">
10
+ <div class="col-md-9 mb-4" data-hook="checkout_progress">
11
11
  <%= checkout_progress %>
12
12
  </div>
13
13
  </div>
@@ -16,8 +16,8 @@
16
16
  <div class="<%= if @order.state != 'confirm' then 'col-md-9' else 'col-md-12' end %>" data-hook="checkout_form_wrapper">
17
17
  <%= form_for @order, url: update_checkout_path(@order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
18
18
  <% if @order.state == 'address' || !@order.email? %>
19
- <div class="panel panel-default">
20
- <div class="panel-body">
19
+ <div class="card card-default mb-4">
20
+ <div class="card-body">
21
21
  <div class="form-group">
22
22
  <%= form.label :email %>
23
23
  <%= form.email_field :email, class: 'form-control', required: true %>
@@ -1,42 +1,50 @@
1
- <div class="well clearfix">
2
- <%= image_tag 'credit_cards/credit_card.gif', id: 'credit-card-image', class: 'pull-right', width: '170', height: '28' %>
3
- <% param_prefix = "payment_source[#{payment_method.id}]" %>
1
+ <div class="card mt-4 w-100">
2
+ <div class="card-body">
3
+ <%= image_tag 'credit_cards/credit_card.gif',
4
+ id: 'credit-card-image',
5
+ width: '170',
6
+ height: '28',
7
+ class: 'position-absolute',
8
+ style: 'right: 1rem' %>
4
9
 
5
- <p class="field">
6
- <%= label_tag "name_on_card_#{payment_method.id}" do %>
7
- <%= Spree.t(:name_on_card) %><abbr class="required" title="required">*</abbr>
8
- <% end %>
9
- <%= text_field_tag "#{param_prefix}[name]", "#{@order.bill_address_firstname} #{@order.bill_address_lastname}", { id: "name_on_card_#{payment_method.id}", class: 'form-control required'} %>
10
- </p>
10
+ <% param_prefix = "payment_source[#{payment_method.id}]" %>
11
11
 
12
- <p class="field" data-hook="card_number">
13
- <%= label_tag "card_number" do %>
14
- <%= Spree.t(:card_number) %><abbr class="required" title="required">*</abbr>
15
- <% end %>
16
- <% options_hash = Rails.env.production? ? {autocomplete: 'off'} : {} %>
17
- <%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(id: 'card_number', class: 'form-control required cardNumber', size: 19, maxlength: 19, autocomplete: "off") %>
18
- &nbsp;
19
- <span id="card_type" style="display:none;">
20
- ( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
21
- <span id="unrecognized"><%= Spree.t(:unrecognized_card_type) %></span>
22
- )
23
- </span>
24
- </p>
25
- <div class="row">
26
- <div class="col-md-8 field" data-hook="card_expiration">
27
- <%= label_tag "card_expiry" do %>
28
- <%= Spree.t(:expiration) %><abbr class="required" title="required">*</abbr>
12
+ <p class="field">
13
+ <%= label_tag "name_on_card_#{payment_method.id}" do %>
14
+ <%= Spree.t(:name_on_card) %><abbr class="required" title="required">*</abbr>
29
15
  <% end %>
30
- <%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "form-control required cardExpiry", placeholder: "MM / YY" %>
31
- </div>
32
- <div class="col-md-4 field" data-hook="card_code">
33
- <%= label_tag "card_code" do %>
34
- <%= Spree.t(:card_code) %><abbr class="required" title="required">*</abbr>
16
+ <%= text_field_tag "#{param_prefix}[name]", "#{@order.bill_address_firstname} #{@order.bill_address_lastname}", { id: "name_on_card_#{payment_method.id}", class: 'form-control required'} %>
17
+ </p>
18
+
19
+ <p class="field" data-hook="card_number">
20
+ <%= label_tag "card_number" do %>
21
+ <%= Spree.t(:card_number) %><abbr class="required" title="required">*</abbr>
35
22
  <% end %>
36
- <%= text_field_tag "#{param_prefix}[verification_value]", '', options_hash.merge(id: 'card_code', class: 'form-control required cardCode', size: 5) %>
37
- <%= link_to Spree.t(:what_is_this), spree.cvv_path, target: :blank, "data-hook" => "cvv_link", id: "cvv_link" %>
23
+ <% options_hash = Rails.env.production? ? {autocomplete: 'off'} : {} %>
24
+ <%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(id: 'card_number', class: 'form-control required cardNumber', size: 19, maxlength: 19, autocomplete: "off") %>
25
+ &nbsp;
26
+ <span id="card_type" style="display:none;">
27
+ ( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
28
+ <span id="unrecognized"><%= Spree.t(:unrecognized_card_type) %></span>
29
+ )
30
+ </span>
31
+ </p>
32
+ <div class="row">
33
+ <div class="col-md-8 field" data-hook="card_expiration">
34
+ <%= label_tag "card_expiry" do %>
35
+ <%= Spree.t(:expiration) %><abbr class="required" title="required">*</abbr>
36
+ <% end %>
37
+ <%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "form-control required cardExpiry", placeholder: "MM / YY" %>
38
+ </div>
39
+ <div class="col-md-4 field" data-hook="card_code">
40
+ <%= label_tag "card_code" do %>
41
+ <%= Spree.t(:card_code) %><abbr class="required" title="required">*</abbr>
42
+ <% end %>
43
+ <%= text_field_tag "#{param_prefix}[verification_value]", '', options_hash.merge(id: 'card_code', class: 'form-control required cardCode', size: 5) %>
44
+ <%= link_to Spree.t(:what_is_this), spree.cvv_path, target: :blank, "data-hook" => "cvv_link", id: "cvv_link" %>
45
+ </div>
38
46
  </div>
39
- </div>
40
47
 
41
- <%= hidden_field_tag "#{param_prefix}[cc_type]", '', id: "cc_type", class: 'ccType' %>
48
+ <%= hidden_field_tag "#{param_prefix}[cc_type]", '', id: "cc_type", class: 'ccType' %>
49
+ </div>
42
50
  </div>
@@ -16,10 +16,13 @@
16
16
 
17
17
  <%= render partial: 'spree/shared/sidebar' if content_for? :sidebar %>
18
18
 
19
- <div id="content" class="<%= !content_for?(:sidebar) ? "col-sm-12" : "col-sm-8 col-md-9" %>" data-hook>
19
+ <main
20
+ id="content"
21
+ class="mt-4 <%= !content_for?(:sidebar) ? "col-sm-12" : "col-sm-12 col-md-9" %>"
22
+ data-hook>
20
23
  <%= flash_messages %>
21
24
  <%= yield %>
22
- </div>
25
+ </main>
23
26
 
24
27
  <%= yield :templates %>
25
28
  </div>
@@ -1,28 +1,41 @@
1
1
  <%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
2
- <table class="table" id="cart-detail" data-hook>
3
- <thead>
4
- <tr class="active" data-hook="cart_items_headers">
5
- <th class="cart-item-description-header" colspan="2"><%= Spree.t(:item) %></th>
6
- <th class="cart-item-price-header"><%= Spree.t(:price) %></th>
7
- <th class="cart-item-quantity-header"><%= Spree.t(:qty) %></th>
8
- <th class="cart-item-total-header"><%= Spree.t(:total) %></th>
9
- <th class="cart-item-delete-header"></th>
10
- </tr>
11
- </thead>
12
- <tbody id="line_items" data-hook>
13
- <%= render partial: 'spree/orders/line_item', collection: order_form.object.line_items, locals: { order_form: order_form } %>
14
- </tbody>
15
- <% if @order.adjustments.nonzero.exists? || @order.line_item_adjustments.nonzero.exists? || @order.shipment_adjustments.nonzero.exists? || @order.shipments.any? %>
16
- <tr class="cart-subtotal">
17
- <td colspan="4" align='right'><h5><%= Spree.t(:cart_subtotal, count: @order.line_items.sum(:quantity)) %></h5></td>
18
- <td colspan><h5><%= order_form.object.display_item_total %></h5></td>
2
+
3
+ <div class="table-responsive">
4
+ <table class="table" id="cart-detail" data-hook>
5
+ <thead>
6
+ <tr class="active" data-hook="cart_items_headers">
7
+ <th class="cart-item-description-header" colspan="2"><%= Spree.t(:item) %></th>
8
+ <th class="cart-item-price-header"><%= Spree.t(:price) %></th>
9
+ <th class="cart-item-quantity-header"><%= Spree.t(:qty) %></th>
10
+ <th class="cart-item-total-header"><%= Spree.t(:total) %></th>
11
+ <th class="cart-item-delete-header"></th>
12
+ </tr>
13
+ </thead>
14
+ <tbody id="line_items" data-hook>
15
+ <%= render partial: 'spree/orders/line_item', collection: order_form.object.line_items, locals: { order_form: order_form } %>
16
+ </tbody>
17
+ <% if @order.adjustments.nonzero.exists? || @order.line_item_adjustments.nonzero.exists? || @order.shipment_adjustments.nonzero.exists? || @order.shipments.any? %>
18
+ <tr class="cart-subtotal">
19
+ <td colspan="4" align='right'><h5><%= Spree.t(:cart_subtotal, count: @order.line_items.sum(:quantity)) %></h5></td>
20
+ <td colspan>
21
+ <h5>
22
+ <%= order_form.object.display_item_total %>
23
+ </h5>
24
+ </td>
25
+ <td></td>
26
+ </tr>
27
+ <%= render "spree/orders/adjustments" %>
28
+ <% end %>
29
+ <tr class="table-warning cart-total">
30
+ <td colspan="4" align='right' class="align-middle">
31
+ <h5 class="mb-0">
32
+ <%= Spree.t(:total) %>
33
+ </h5>
34
+ </td>
35
+ <td class="lead" colspan>
36
+ <%= order_form.object.display_total %>
37
+ </td>
19
38
  <td></td>
20
39
  </tr>
21
- <%= render "spree/orders/adjustments" %>
22
- <% end %>
23
- <tr class="warning cart-total">
24
- <td colspan="4" align='right'><h5><%= Spree.t(:total) %></h5></td>
25
- <td class="lead" colspan><%= order_form.object.display_total %></td>
26
- <td></td>
27
- </tr>
28
- </table>
40
+ </table>
41
+ </div>
@@ -1,12 +1,14 @@
1
1
  <% @body_id = 'cart' %>
2
2
 
3
- <div data-hook="cart_container">
3
+ <div data-hook="cart_container" class="col-12">
4
4
  <h1><%= Spree.t(:shopping_cart) %></h1>
5
5
 
6
6
  <% if @order.line_items.empty? %>
7
7
  <div data-hook="empty_cart">
8
8
  <div class="alert alert-info"><%= Spree.t(:your_cart_is_empty) %></div>
9
- <p><%= link_to Spree.t(:continue_shopping), products_path, class: 'btn btn-default' %></p>
9
+ <p>
10
+ <%= link_to Spree.t(:continue_shopping), products_path, class: 'btn btn-outline-secondary' %>
11
+ </p>
10
12
  </div>
11
13
  <% else %>
12
14
  <div data-hook="outside_cart_form">
@@ -17,34 +19,38 @@
17
19
  <%= render partial: 'form', locals: { order_form: order_form } %>
18
20
  </div>
19
21
 
20
- <div class="links col-md-3 navbar-form pull-right text-right" data-hook="cart_buttons">
21
- <div class="form-group">
22
- <%= button_tag class: 'btn btn-primary', id: 'update-button' do %>
23
- <%= Spree.t(:update) %>
24
- <% end %>
25
- <%= button_tag class: 'btn btn-lg btn-success', id: 'checkout-link', name: 'checkout' do %>
26
- <%= Spree.t(:checkout) %>
27
- <% end %>
28
- </div>
29
- </div>
22
+ <div class="row">
23
+ <% if Spree::Frontend::Config[:coupon_codes_enabled] %>
24
+ <div class='col-md-6 form-inline' data-hook='coupon_code'>
25
+ <%= order_form.label :coupon_code, class: 'mr-2' %>
26
+ <div class="input-group">
27
+ <%= order_form.text_field :coupon_code, size: '30', class: 'form-control' %>
28
+ <div class="input-group-append">
29
+ <%= button_tag Spree.t(:coupon_code_apply), class: 'btn btn-outline-secondary' %>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ <% end %>
30
34
 
31
- <% if Spree::Frontend::Config[:coupon_codes_enabled] %>
32
- <div class='col-md-6 form-inline pull-right' data-hook='coupon_code'>
33
- <label>
34
- <%= order_form.label :coupon_code %>
35
- <%= order_form.text_field :coupon_code, size: '30', class: 'form-control' %>
36
- <%= button_tag Spree.t(:coupon_code_apply), class: 'btn btn-default' %>
37
- </label>
35
+ <div class="links col-md-6 d-flex justify-content-end" data-hook="cart_buttons">
36
+ <div class="form-group">
37
+ <%= button_tag class: 'btn btn-primary', id: 'update-button' do %>
38
+ <%= Spree.t(:update) %>
39
+ <% end %>
40
+ <%= button_tag class: 'btn btn-lg btn-success', id: 'checkout-link', name: 'checkout' do %>
41
+ <%= Spree.t(:checkout) %>
42
+ <% end %>
43
+ </div>
38
44
  </div>
39
- <% end %>
45
+ </div>
40
46
  </div>
41
47
  <% end %>
42
48
  </div>
43
49
 
44
- <div id="empty-cart" class="col-md-3 pull-left" data-hook>
50
+ <div id="empty-cart" class="mt-4" data-hook>
45
51
  <%= form_tag empty_cart_path, method: :put do %>
46
52
  <p id="clear_cart_link" data-hook>
47
- <%= submit_tag Spree.t(:empty_cart), class: 'btn btn-default' %>
53
+ <%= submit_tag Spree.t(:empty_cart), class: 'btn btn-outline-secondary' %>
48
54
  <%= Spree.t(:or) %>
49
55
  <%= link_to Spree.t(:continue_shopping), products_path, class: 'continue' %>
50
56
  </p>
@@ -1,7 +1,8 @@
1
1
  <fieldset id="order_summary" data-hook>
2
2
  <h1><%= accurate_title %></h1>
3
+
3
4
  <% if order_just_completed?(@order) %>
4
- <strong><%= Spree.t(:thank_you_for_your_order) %></strong>
5
+ <p><strong><%= Spree.t(:thank_you_for_your_order) %></strong></p>
5
6
  <% end %>
6
7
 
7
8
  <div id="order" data-hook>