spree_frontend 4.2.0.rc4 → 4.2.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/frontend/checkout/shipment.js +15 -2
  3. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +27 -22
  4. data/app/assets/stylesheets/spree/frontend/views/spree/orders/show.scss +3 -0
  5. data/app/controllers/spree/products_controller.rb +1 -3
  6. data/app/controllers/spree/store_controller.rb +0 -8
  7. data/app/helpers/spree/frontend_helper.rb +10 -4
  8. data/app/helpers/spree/navigation_helper.rb +1 -1
  9. data/app/models/spree/frontend_configuration.rb +1 -1
  10. data/app/views/kaminari/twitter-bootstrap-4/_first_page.html.erb +2 -2
  11. data/app/views/kaminari/twitter-bootstrap-4/_gap.html.erb +2 -2
  12. data/app/views/kaminari/twitter-bootstrap-4/_last_page.html.erb +2 -2
  13. data/app/views/kaminari/twitter-bootstrap-4/_next_page.html.erb +2 -2
  14. data/app/views/kaminari/twitter-bootstrap-4/_page.html.erb +2 -2
  15. data/app/views/kaminari/twitter-bootstrap-4/_paginator.html.erb +2 -2
  16. data/app/views/kaminari/twitter-bootstrap-4/_prev_page.html.erb +2 -2
  17. data/app/views/spree/address/_form.html.erb +15 -16
  18. data/app/views/spree/addresses/edit.html.erb +2 -2
  19. data/app/views/spree/addresses/new.html.erb +2 -2
  20. data/app/views/spree/checkout/_address.html.erb +2 -2
  21. data/app/views/spree/checkout/_confirm.html.erb +1 -33
  22. data/app/views/spree/checkout/_credit_card.html.erb +2 -2
  23. data/app/views/spree/checkout/_delivery_informations.html.erb +43 -36
  24. data/app/views/spree/checkout/_summary.html.erb +3 -5
  25. data/app/views/spree/checkout/payment/_gateway.html.erb +1 -1
  26. data/app/views/spree/home/index.html.erb +21 -22
  27. data/app/views/spree/orders/_coupon_code.html.erb +2 -3
  28. data/app/views/spree/orders/_line_item.html.erb +1 -1
  29. data/app/views/spree/orders/_line_item_data.html.erb +1 -1
  30. data/app/views/spree/orders/edit.html.erb +2 -3
  31. data/app/views/spree/orders/show.html.erb +1 -71
  32. data/app/views/spree/products/_cart_form.html.erb +2 -3
  33. data/app/views/spree/products/_color_option_type.html.erb +1 -2
  34. data/app/views/spree/products/_filters_desktop.html.erb +1 -2
  35. data/app/views/spree/products/_gallery.html.erb +4 -6
  36. data/app/views/spree/products/_gallery_modal.html.erb +3 -5
  37. data/app/views/spree/products/_option_type.html.erb +1 -2
  38. data/app/views/spree/products/_sort_mobile.html.erb +4 -4
  39. data/app/views/spree/products/related.html.erb +11 -5
  40. data/app/views/spree/products/show.html.erb +1 -2
  41. data/app/views/spree/shared/_carousel_4_products.html.erb +6 -12
  42. data/app/views/spree/shared/_change_store.html.erb +3 -3
  43. data/app/views/spree/shared/_color_select.html.erb +3 -3
  44. data/app/views/spree/shared/_delete_address_popup.html.erb +1 -2
  45. data/app/views/spree/shared/_error_messages.html.erb +2 -2
  46. data/app/views/spree/shared/_footer.html.erb +1 -1
  47. data/app/views/spree/shared/_head.html.erb +1 -1
  48. data/app/views/spree/shared/_header.html.erb +1 -1
  49. data/app/views/spree/shared/_main_nav_bar.html.erb +1 -1
  50. data/app/views/spree/shared/_mobile_change_store.html.erb +3 -3
  51. data/app/views/spree/shared/_mobile_navigation.html.erb +1 -1
  52. data/app/views/spree/shared/_nav_bar.html.erb +4 -4
  53. data/app/views/spree/shared/_no_product_available.html.erb +1 -1
  54. data/app/views/spree/shared/_option_values.html.erb +1 -1
  55. data/app/views/spree/shared/_order_details.html.erb +117 -174
  56. data/app/views/spree/shared/_payment.html.erb +2 -2
  57. data/app/views/spree/shared/_payment_sources.html.erb +2 -2
  58. data/app/views/spree/shared/_product_added_modal.html.erb +1 -1
  59. data/app/views/spree/shared/_search.html.erb +1 -2
  60. data/app/views/spree/shared/_translations.html.erb +6 -6
  61. data/app/views/spree/shared/carousel/_single.html.erb +5 -10
  62. data/app/views/spree/shared/carousel/_thumbnails.html.erb +5 -11
  63. data/app/views/spree/users/_address_controls.html.erb +1 -2
  64. data/app/views/spree/users/show.html.erb +3 -3
  65. data/config/routes.rb +0 -1
  66. data/spree_frontend.gemspec +1 -1
  67. metadata +10 -12
  68. data/app/views/spree/shared/forbidden.html.erb +0 -0
  69. data/app/views/spree/shared/unauthorized.html.erb +0 -0
@@ -22,8 +22,7 @@
22
22
  "presentation" => option_value[:presentation],
23
23
  "variant-id" => option_value[:variant_id],
24
24
  "is-color" => true
25
- }
26
- %>
25
+ } %>
27
26
 
28
27
  <%= render partial: "spree/shared/color_select", locals: {
29
28
  color: option_value[:presentation],
@@ -24,8 +24,7 @@
24
24
  params_ot_downcase_name: params[ot_downcase_name],
25
25
  option_type: option_type,
26
26
  permitted_params: permitted_params,
27
- ot_downcase_name: ot_downcase_name
28
- %>
27
+ ot_downcase_name: ot_downcase_name %>
29
28
  </div>
30
29
  </div>
31
30
  </div>
@@ -2,16 +2,15 @@
2
2
  <% if @product_images.size > 0 %>
3
3
  <div
4
4
  class="w-100 d-flex align-self-start justify-content-between product-details-images"
5
- data-hook="product_left_part_wrap"
6
- >
5
+ data-hook="product_left_part_wrap">
6
+
7
7
  <div class="d-none d-md-block product-details-thumbnails" data-hook="product_thumbnails">
8
8
  <%= render 'spree/shared/carousel/thumbnails',
9
9
  images: @product_images,
10
10
  group_id: 'main-product-carousel',
11
11
  id: 'productThumbnailsCarousel',
12
12
  trigger_id: 'productCarousel',
13
- per_page: 5
14
- %>
13
+ per_page: 5 %>
15
14
  </div>
16
15
  <div class="product-details-single" data-hook="product_images">
17
16
  <%= render 'spree/shared/carousel/single',
@@ -19,8 +18,7 @@
19
18
  group_id: 'main-product-carousel',
20
19
  id: 'productCarousel',
21
20
  trigger_id: 'productCarousel',
22
- zoomed: false
23
- %>
21
+ zoomed: false %>
24
22
  </div>
25
23
  </div>
26
24
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% if @product_images.size > 0 %>
2
- <div class="modal fade" id="picturesModal" tabindex="-1" role="dialog" >
2
+ <div class="modal fade" id="picturesModal" tabindex="-1" role="dialog">
3
3
  <div class="modal-dialog--zoom modal-dialog mw-100 vh-100 mt-0 mb-0" role="document">
4
4
  <div class="modal-content h-100">
5
5
  <div class="modal-body h-100">
@@ -23,8 +23,7 @@
23
23
  group_id: 'main-product-modal-carousel',
24
24
  id: 'productModalThumbnailsCarousel',
25
25
  trigger_id: 'productCarousel',
26
- per_page: 4
27
- %>
26
+ per_page: 4 %>
28
27
  </div>
29
28
  <% end %>
30
29
  <div class="product-details-single">
@@ -33,8 +32,7 @@
33
32
  group_id: 'main-product-modal-carousel',
34
33
  id: 'productModalCarousel',
35
34
  trigger_id: 'productCarousel',
36
- zoomed: true
37
- %>
35
+ zoomed: true %>
38
36
  </div>
39
37
  </div>
40
38
  </div>
@@ -15,8 +15,7 @@
15
15
  "option-type-index" => index,
16
16
  "presentation" => option_value[:presentation],
17
17
  "variant-id" => option_value[:variant_id]
18
- }
19
- %>
18
+ } %>
20
19
 
21
20
  <%= label_tag "variant_option_value_id_#{option_type[:id]}_#{option_value[:id]}",
22
21
  class: "m-1 select-label",
@@ -8,7 +8,7 @@
8
8
  <div class="plp-overlay-header-border"></div>
9
9
  <ul class="pt-1 plp-overlay-ul">
10
10
  <li class="plp-overlay-ul-li <%= 'plp-overlay-ul-li--active' if params[:sort_by].blank? %>">
11
- <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: nil)) %>" >
11
+ <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: nil)) %>">
12
12
  <div class="plp-empty-dot">
13
13
  <div class="filled-dot"></div>
14
14
  </div>
@@ -16,7 +16,7 @@
16
16
  </a>
17
17
  </li>
18
18
  <li class="plp-overlay-ul-li <%= 'plp-overlay-ul-li--active' if params[:sort_by] == 'newest-first' %>">
19
- <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: 'newest-first')) %>" >
19
+ <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: 'newest-first')) %>">
20
20
  <div class="plp-empty-dot">
21
21
  <div class="filled-dot"></div>
22
22
  </div>
@@ -24,7 +24,7 @@
24
24
  </a>
25
25
  </li>
26
26
  <li class="plp-overlay-ul-li <%= 'plp-overlay-ul-li--active' if params[:sort_by] == 'price-high-to-low' %>">
27
- <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: 'price-high-to-low')) %>" >
27
+ <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: 'price-high-to-low')) %>">
28
28
  <div class="plp-empty-dot">
29
29
  <div class="filled-dot"></div>
30
30
  </div>
@@ -32,7 +32,7 @@
32
32
  </a>
33
33
  </li>
34
34
  <li class="plp-overlay-ul-li <%= 'plp-overlay-ul-li--active' if params[:sort_by] == 'price-low-to-high' %>">
35
- <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: 'price-low-to-high')) %>" >
35
+ <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: 'price-low-to-high')) %>">
36
36
  <div class="plp-empty-dot">
37
37
  <div class="filled-dot"></div>
38
38
  </div>
@@ -1,8 +1,14 @@
1
- <% if related_products.any? %>
1
+ <% if product_relation_types.any? %>
2
2
  <div id="related-products">
3
- <div class="product-details-related">
4
- <p class="font-weight-bold text-center text-uppercase product-details-carousel-text"><%= Spree.t('pdp.you_may_also_like') %></p>
5
- <%= render 'spree/shared/carousel_4_products', id: 'related-products-carousel', products: @related_products %>
6
- </div>
3
+ <% product_relation_types.each do |relation_type| %>
4
+ <% products = product_relations_by_type(relation_type) %>
5
+
6
+ <% if products.any? %>
7
+ <div class="product-details-related" id="product-details-related-<%= relation_type.id %>">
8
+ <p class="font-weight-bold text-center text-uppercase product-details-carousel-text"><%= relation_type.name %></p>
9
+ <%= render 'spree/shared/carousel_4_products', id: "related-products-carousel-#{relation_type.id}", products: products %>
10
+ </div>
11
+ <% end %>
12
+ <% end %>
7
13
  </div>
8
14
  <% end %>
@@ -48,5 +48,4 @@
48
48
  <div
49
49
  data-related-products
50
50
  data-related-products-id="<%= @product.slug %>"
51
- data-related-products-enabled="<%= @product.respond_to?(:has_related_products?) %>"
52
- />
51
+ data-related-products-enabled="<%= @product.respond_to?(:has_related_products?) %>" />
@@ -20,8 +20,7 @@
20
20
  class="d-flex position-absolute justify-content-center align-items-center carousel-icon-control carousel-icon-control--previous"
21
21
  href="#<%= id %>-mobile"
22
22
  role="button"
23
- data-slide="prev"
24
- >
23
+ data-slide="prev">
25
24
  <span class="d-flex justify-content-center align-items-center carousel-icon-control-rounded" aria-hidden="true">
26
25
  <%= icon(name: 'arrow-right',
27
26
  classes: 'spree-icon-arrow spree-icon-arrow-left',
@@ -35,8 +34,7 @@
35
34
  class="d-flex position-absolute justify-content-center align-items-center carousel-icon-control carousel-icon-control--next"
36
35
  href="#<%= id %>-mobile"
37
36
  role="button"
38
- data-slide="next"
39
- >
37
+ data-slide="next">
40
38
  <span class="d-flex justify-content-center align-items-center carousel-icon-control-rounded" aria-hidden="true">
41
39
  <%= icon(name: 'arrow-right',
42
40
  classes: 'spree-icon-arrow spree-icon-arrow-right',
@@ -56,14 +54,12 @@
56
54
  class="d-flex position-absolute justify-content-center align-items-center carousel-icon-control carousel-icon-control--previous"
57
55
  href="#<%= id %>-desktop"
58
56
  role="button"
59
- data-slide="prev"
60
- >
57
+ data-slide="prev">
61
58
  <span class="d-flex justify-content-center align-items-center carousel-icon-control-rounded" aria-hidden="true">
62
59
  <%= icon(name: 'arrow-right',
63
60
  classes: 'spree-icon-arrow spree-icon-arrow-left',
64
61
  width: 20,
65
- height: 20)
66
- %>
62
+ height: 20) %>
67
63
  </span>
68
64
  <span class="sr-only"><%= Spree.t(:previous) %></span>
69
65
  </a>
@@ -80,14 +76,12 @@
80
76
  class="d-md-flex position-absolute justify-content-center align-items-center carousel-icon-control carousel-icon-control--next"
81
77
  href="#<%= id %>-desktop"
82
78
  role="button"
83
- data-slide="next"
84
- >
79
+ data-slide="next">
85
80
  <span class="d-flex justify-content-center align-items-center carousel-icon-control-rounded" aria-hidden="true">
86
81
  <%= icon(name: 'arrow-right',
87
82
  classes: 'spree-icon-arrow spree-icon-arrow-right',
88
83
  width: 20,
89
- height: 20)
90
- %>
84
+ height: 20) %>
91
85
  </span>
92
86
  <span class="sr-only"><%= Spree.t(:next) %></span>
93
87
  </a>
@@ -1,15 +1,15 @@
1
1
  <% if Spree::Config.show_store_selector && stores.size > 1 %>
2
2
  <li class="d-none d-xl-block change-store">
3
3
  <div class="dropdown navbar-right-dropdown">
4
- <button id="stores-button" type="button" data-toggle="dropdown" class="navbar-right-dropdown-toggle" aria-label="<%= Spree.t('nav_bar.change_country')%>">
4
+ <button id="stores-button" type="button" data-toggle="dropdown" class="navbar-right-dropdown-toggle" aria-label="<%= Spree.t('nav_bar.change_country') %>">
5
5
  <%= icon(name: 'global',
6
6
  classes: 'd-none d-xl-inline-block',
7
7
  width: 41,
8
- height: 36) %>
8
+ height: 36) %>
9
9
  <%= icon(name: 'arrow-down',
10
10
  classes: 'd-inline-block d-xl-none',
11
11
  width: 15,
12
- height: 15) %>
12
+ height: 15) %>
13
13
  </button>
14
14
 
15
15
  <div id="stores_list" class="dropdown-menu dropdown-menu-right text-right">
@@ -1,9 +1,9 @@
1
1
  <svg class="color-select" height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg">
2
2
  <g class="color-select-border" fill="none" fill-rule="evenodd">
3
- <circle class="<%= 'color-select-border--selected' if selected %> plp-overlay-color-item" cx="16" cy="16" r="15" stroke-width="2"/>
3
+ <circle class="<%= 'color-select-border--selected' if selected %> plp-overlay-color-item" cx="16" cy="16" r="15" stroke-width="2" />
4
4
  <g transform="translate(2 2)">
5
- <circle cx="14" cy="14" fill="<%= color %>" fill-rule="evenodd" r="12"/>
6
- <circle cx="14" cy="14" r="13" stroke="#fff" stroke-width="2"/>
5
+ <circle cx="14" cy="14" fill="<%= color %>" fill-rule="evenodd" r="12" />
6
+ <circle cx="14" cy="14" r="13" stroke="#fff" stroke-width="2" />
7
7
  </g>
8
8
  </g>
9
9
  </svg>
@@ -18,8 +18,7 @@
18
18
  class="btn btn-primary text-uppercase font-weight-bold delete-address-popup-button"
19
19
  data-method="delete"
20
20
  rel="nofollow"
21
- href="#"
22
- >
21
+ href="#">
23
22
  <%= Spree.t("address_action_popup.delete_button") %>
24
23
  </a>
25
24
  </div>
@@ -1,10 +1,10 @@
1
1
  <% if target && target.errors.any? %>
2
2
  <div id="errorExplanation" class="alert alert-danger d-flex justify-content-center mb-0" data-hook>
3
- <ul class="mb-0 pl-0" style="list-style-type: none;">
3
+ <ul class="mb-0 pl-0" style="list-style-type: none;">
4
4
  <% target.errors.full_messages.each do |msg| %>
5
5
  <li><%= msg %></li>
6
6
  <% end %>
7
7
  </ul>
8
- <br/>
8
+ <br>
9
9
  </div>
10
10
  <% end %>
@@ -33,7 +33,7 @@
33
33
  <div class="d-flex flex-column align-items-center align-items-xl-start pb-3 flex-grow-2 footer-spree-contact-note">
34
34
  <div>
35
35
  <strong><%= current_store.name %></strong>
36
- <br/>
36
+ <br>
37
37
  <% if current_store.address %>
38
38
  <%= current_store.address.html_safe %>
39
39
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <title><%= title %></title>
2
- <meta name="viewport" content="width=device-width, initial-scale=1" />
2
+ <meta name="viewport" content="width=device-width, initial-scale=1">
3
3
  <%== og_meta_data_tags %>
4
4
  <%== meta_data_tags %>
5
5
  <%== meta_robots %>
@@ -8,7 +8,7 @@
8
8
  <button class="navbar-toggler border-0 px-0 d-flex" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-label="<%= Spree.t('nav_bar.show_menu') %>">
9
9
  <%= icon(name: 'burger',
10
10
  width: 18.5,
11
- height: 16) %>
11
+ height: 16) %>
12
12
  </button>
13
13
  </div>
14
14
  <figure class="logo flex-grow-0 flex-xl-grow-1 order-xl-0 header-spree-fluid-logo m-0">
@@ -48,7 +48,7 @@
48
48
  </div>
49
49
  </div>
50
50
  </div>
51
- <%end %>
51
+ <% end %>
52
52
  </li>
53
53
  <% end %>
54
54
  </ul>
@@ -1,7 +1,7 @@
1
1
  <% if stores.size > 1 %>
2
2
  <li class="d-flex justify-content-between align-items-center mobile-navigation-list-item">
3
- <span class="w-75"><%= Spree.t('nav_bar.change_country')%></span>
4
- <a class="w-25 text-right mobile-navigation-category-link" data-category="countries" href="#" aria-label="<%= Spree.t('nav_bar.change_country')%>">
3
+ <span class="w-75"><%= Spree.t('nav_bar.change_country') %></span>
4
+ <a class="w-25 text-right mobile-navigation-category-link" data-category="countries" href="#" aria-label="<%= Spree.t('nav_bar.change_country') %>">
5
5
  <%= icon(name: 'arrow-right',
6
6
  classes: 'd-sm-none spree-icon-arrow spree-icon-arrow-right',
7
7
  width: 16,
@@ -14,7 +14,7 @@
14
14
 
15
15
  <ul class="list-unstyled position-absolute mobile-navigation-sublist" data-category="countries">
16
16
  <li class="text-center font-weight-bold mobile-navigation-sublist-header">
17
- <%= Spree.t('nav_bar.change_country')%>
17
+ <%= Spree.t('nav_bar.change_country') %>
18
18
  </li>
19
19
  <% stores.each do |store| %>
20
20
  <li class="d-flex justify-content-between align-items-center mobile-navigation-list-item">
@@ -25,7 +25,7 @@
25
25
  <li class="d-flex justify-content-between align-items-center mobile-navigation-list-item">
26
26
  <%= link_to root[:title], root[:url], class: 'w-75' %>
27
27
  <% if root[:items].present? %>
28
- <a class="w-25 text-right mobile-navigation-category-link" data-category="<%= root[:title].parameterize %>" href="#" aria-label="<%= Spree.t('go_to_category')%>">
28
+ <a class="w-25 text-right mobile-navigation-category-link" data-category="<%= root[:title].parameterize %>" href="#" aria-label="<%= Spree.t('go_to_category') %>">
29
29
  <%= icon(name: 'arrow-right',
30
30
  classes: 'd-inline spree-icon-arrow spree-icon-arrow-right',
31
31
  width: 14,
@@ -1,11 +1,11 @@
1
1
  <ul id="nav-bar" class="nav align-items-center d-flex flex-nowrap justify-content-end navbar-right">
2
2
  <li>
3
3
  <div class="navbar-right-search-menu">
4
- <button type="button" class="navbar-right-dropdown-toggle search-icons" aria-label="<%= Spree.t('nav_bar.show_search')%>">
4
+ <button type="button" class="navbar-right-dropdown-toggle search-icons" aria-label="<%= Spree.t('nav_bar.show_search') %>">
5
5
  <%= icon(name: 'magnifying-glass',
6
6
  classes: 'd-inline-block',
7
7
  width: 36,
8
- height: 36) %>
8
+ height: 36) %>
9
9
  </button>
10
10
 
11
11
  <div id="search-dropdown" class="p-0 px-md-4 py-md-2 w-100 shadow navbar-right-search-menu-dropdown hide-on-esc">
@@ -16,11 +16,11 @@
16
16
  <% if defined?(spree.account_link_path) %>
17
17
  <li>
18
18
  <div class="dropdown navbar-right-dropdown">
19
- <button id="account-button" type="button" data-toggle="dropdown" class="navbar-right-dropdown-toggle account-icon" aria-label="<%= Spree.t('nav_bar.show_user_menu')%>">
19
+ <button id="account-button" type="button" data-toggle="dropdown" class="navbar-right-dropdown-toggle account-icon" aria-label="<%= Spree.t('nav_bar.show_user_menu') %>">
20
20
  <%= icon(name: 'person',
21
21
  classes: 'd-inline-block',
22
22
  width: 41.4,
23
- height: 36) %>
23
+ height: 36) %>
24
24
  </button>
25
25
 
26
26
  <div id="link-to-account" class="dropdown-menu dropdown-menu-right text-right">
@@ -1,5 +1,5 @@
1
1
  <div class="p-0 justify-content-around mx-auto no-product-available">
2
- <div id= "no-product-available-close-button" class="d-flex no-product-available-icon">
2
+ <div id="no-product-available-close-button" class="d-flex no-product-available-icon">
3
3
  <%= inline_svg_tag "close.svg", class: "w-100 h-100" %>
4
4
  </div>
5
5
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  <% option_value_param = (selected_option_values.include?(id) ? selected_option_values - [id] : selected_option_values + [id]).join(',') %>
8
8
  <%= link_to permitted_params.merge(ot_downcase_name => option_value_param, menu_open: 1), data: { params: permitted_params.merge(ot_downcase_name => option_value_param, menu_open: 1), id: id, filter_name: ot_downcase_name, multiselect: true } do %>
9
- <% if Spree::OptionType.color&.name&.downcase == ot_downcase_name %>
9
+ <% if color_option_type_name.present? && color_option_type_name.downcase == ot_downcase_name %>
10
10
 
11
11
  <span class="d-inline-block mb-1">
12
12
  <%= render partial: 'spree/shared/color_select', locals: {
@@ -1,184 +1,127 @@
1
- <!-- FIXME: Should be removed if it is not used anywhere? -->
2
- <div class="row steps-data">
3
- <% if order.has_step?("address") %>
4
- <div class="col-md-3 col-6 mb-3" data-hook="order-bill-address">
5
- <h4 class="h5">
6
- <%= Spree.t(:billing_address) %> <%= link_to "(#{Spree.t(:edit)})", spree.checkout_state_path(:address) unless order.completed? %>
7
- </h4>
8
- <%= render 'spree/shared/address', address: order.bill_address %>
1
+ <div class='checkout-confirm-order-details w-100 d-flex flex-wrap' data-hook>
2
+ <div class="checkout-confirm-delivery-informations text-left mt-3">
3
+ <div class="d-lg-none checkout-confirm-delivery-informations-header">
4
+ <%= Spree.t(:delivery_information) %>
9
5
  </div>
10
-
11
- <% if order.has_step?("delivery") %>
12
- <div class="col-md-3 col-6 mb-3" data-hook="order-ship-address">
13
- <h4 class="h5">
14
- <%= Spree.t(:shipping_address) %> <%= link_to "(#{Spree.t(:edit)})", spree.checkout_state_path(:address) unless order.completed? %>
15
- </h4>
16
- <%= render 'spree/shared/address', address: order.ship_address %>
17
- </div>
18
-
19
- <div class="col-md-3 col-6 mb-3" data-hook="order-shipment">
20
- <h4 class="h5">
21
- <%= Spree.t(:shipments) %> <%= link_to "(#{Spree.t(:edit)})", spree.checkout_state_path(:delivery) unless order.completed? %>
22
- </h4>
23
- <div class="delivery">
24
- <% order.shipments.each do |shipment| %>
25
- <div>
26
- <%= Spree.t(:shipment_details, stock_location: shipment.stock_location.name, shipping_method: shipment.selected_shipping_rate.name) %>
27
- </div>
6
+ <dl>
7
+ <% if order.has_step?("address") %>
8
+ <div data-hook="order-ship-address">
9
+ <dt class="text-uppercase">
10
+ <%= Spree.t(:shipping_address) %>
11
+ <%= checkout_edit_link %>
12
+ </dt>
13
+ <%= render 'spree/shared/address', address: order.ship_address %>
14
+ </div>
15
+ <div data-hook="order-bill-address">
16
+ <dt class="text-uppercase">
17
+ <%= Spree.t(:billing_address) %>
18
+ <%= checkout_edit_link %>
19
+ </dt>
20
+ <%= render 'spree/shared/address', address: order.bill_address %>
21
+ </div>
22
+ <% end %>
23
+ <% if order.has_step?("delivery") %>
24
+ <div data-hook="order-shipment">
25
+ <dt class="text-uppercase">
26
+ <%= Spree.t(:shipping) %>
27
+ <%= checkout_edit_link('delivery') %>
28
+ </dt>
29
+ <% @order.shipments.valid.each do |shipment| %>
30
+ <dd><%= shipment.shipping_method&.name %> </dd>
28
31
  <% end %>
32
+ <%= render 'spree/shared/shipment_tracking', order: order if order.shipped? %>
29
33
  </div>
30
- <%= render 'spree/shared/shipment_tracking', order: order if order.shipped? %>
31
- </div>
32
- <% end %>
33
- <% end %>
34
-
35
- <% if order.has_step?("payment") %>
36
- <div class="col-md-3 col-6 mb-3" data-hook="order-payment">
37
- <h4 class="h5">
38
- <%= Spree.t(:payment_information) %> <%= link_to "(#{Spree.t(:edit)})", spree.checkout_state_path(:payment) unless order.completed? %>
39
- </h4>
40
- <div class="payment-info">
41
- <%= render collection: order.payments.valid, partial: 'spree/shared/payment' %>
42
- </div>
43
- </div>
44
- <% end %>
45
- </div>
46
-
47
- <div class="table-responsive">
48
- <table id='line-items' class="table mt-4" data-hook="order_details">
49
- <col width="15%" valign="middle" halign="center">
50
- <col width="70%" valign="middle">
51
- <col width="5%" valign="middle" halign="center">
52
- <col width="5%" valign="middle" halign="center">
53
- <col width="5%" valign="middle" halign="center">
54
-
55
- <thead data-hook>
56
- <tr class="active" data-hook="order_details_line_items_headers">
57
- <th colspan="2"><%= Spree.t(:item) %></th>
58
- <th class="price"><%= Spree.t(:price) %></th>
59
- <th class="qty"><%= Spree.t(:qty) %></th>
60
- <th class="total"><span><%= Spree.t(:total) %></span></th>
61
- </tr>
62
- </thead>
63
-
64
- <tbody data-hook>
65
- <% order.line_items.each do |item| %>
66
- <tr data-hook="order_details_line_item_row">
67
- <td data-hook="order_item_image">
68
- <%= link_to small_image(line_item.variant), line_item.product %>
69
- </td>
70
- <td data-hook="order_item_description">
71
- <h4><%= item.name %></h4>
72
- <p>
73
- <%= truncate(item.description, length: 100) %>
74
- <%= "(" + item.variant.options_text + ")" unless item.variant.option_values.empty? %>
75
- </p>
76
- </td>
77
- <td data-hook="order_item_price" class="lead text-primary price">
78
- <span><%= item.single_money.to_html %></span>
79
- </td>
80
- <td data-hook="order_item_qty" class="order-qty">
81
- <%= item.quantity %>
82
- </td>
83
- <td data-hook="order_item_total" class="lead text-primary total">
84
- <span><%= item.display_amount.to_html %></span>
85
- </td>
86
- </tr>
87
34
  <% end %>
88
- </tbody>
89
- <tfoot id="order-total" data-hook="order_details_total">
90
- <tr class="table-warning total">
91
- <td colspan="4" align="right">
92
- <strong><%= Spree.t(:order_total) %>:</strong>
93
- </td>
94
- <td class="total">
95
- <span id="order_total" class="lead text-primary">
96
- <%= order.display_total.to_html %>
97
- </span>
98
- </td>
99
- </tr>
100
- </tfoot>
101
-
102
- <tfoot id="subtotal" data-hook="order_details_subtotal">
103
- <tr class="total" id="subtotal-row">
104
- <td colspan="4">
105
- <strong><%= Spree.t(:subtotal) %>:</strong>
106
- </td>
107
- <td class="total">
108
- <span><%= order.display_item_total.to_html %></span>
109
- </td>
110
- </tr>
111
- </tfoot>
112
-
113
- <% if order.line_item_adjustments.exists? %>
114
- <% if order.line_item_adjustments.promotion.eligible.exists? %>
115
- <tfoot id="price-adjustments" data-hook="order_details_price_adjustments">
116
- <% order.line_item_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
117
- <tr class="total">
118
- <td colspan="4">
119
- <%= Spree.t(:promotion) %>: <strong><%= label %></strong>
120
- </td>
121
- <td class="total">
122
- <span>
123
- <%= Spree::Money.new(
124
- adjustments.sum(&:amount), currency: order.currency
125
- ) %>
126
- </span>
127
- </td>
128
- </tr>
129
- <% end %>
130
- </tfoot>
35
+ <% if order.has_step?("payment") %>
36
+ <div data-hook="order-payment">
37
+ <dt class="text-uppercase">
38
+ <%= Spree.t(:payment) %>
39
+ <%= checkout_edit_link('payment') %>
40
+ </dt>
41
+ <dd>
42
+ <%= render collection: @order.payments.valid, partial: 'spree/shared/payment' %>
43
+ </dd>
44
+ <dd>
45
+ <% if !@order.complete? && @order.using_store_credit? %>
46
+ <%= button_tag Spree.t('store_credit.remove'), name: 'remove_store_credit', class: 'continue btn' %>
47
+ <% end %>
48
+ </dd>
49
+ </div>
131
50
  <% end %>
132
- <% end %>
51
+ </dl>
52
+ </div>
133
53
 
134
- <tfoot id='shipment-total'>
135
- <% order.shipments.group_by { |s| s.selected_shipping_rate.name }.each do |name, shipments| %>
136
- <tr class="total" data-hook='shipment-row'>
137
- <td colspan="4" align="right" class="text-muted">
138
- <%= Spree.t(:shipping) %>: <strong><%= name %></strong>
139
- </td>
140
- <td class="total">
141
- <span>
142
- <%= Spree::Money.new(
143
- shipments.sum(&:discounted_cost), currency: order.currency
144
- ).to_html %>
145
- </span>
146
- </td>
147
- </tr>
54
+ <div class="checkout-confirm-order-details-line-items d-flex flex-column mt-5 mr-md-4">
55
+ <div class="checkout-confirm-order-details-line-items-header d-none d-sm-block d-lg-none align-self-start mb-3">
56
+ <%= Spree.t(:products) %>
57
+ </div>
58
+ <div class="d-table" data-hook="order_details">
59
+ <div class="d-none d-lg-table-row text-secondary text-uppercase" data-hook="order_details_line_items_headers">
60
+ <p class="d-table-cell pb-1">
61
+ <%= Spree.t(:product) %>
62
+ </p>
63
+ <p class="d-table-cell pb-1">
64
+ <%= Spree.t(:price) %>
65
+ </p>
66
+ <p class="d-table-cell pb-1">
67
+ <%= Spree.t(:quantity) %>
68
+ </p>
69
+ <p class="d-table-cell pb-1">
70
+ <%= Spree.t(:total) %>
71
+ </p>
72
+ </div>
73
+ <% @order.line_items.each do |item| %>
74
+ <div class="checkout-confirm-order-details-line-items-line-item w-100 d-table-row" data-hook="order_details_line_item_row">
75
+ <div class="checkout-confirm-order-details-line-items-line-item-name d-table-cell align-middle py-3 py-sm-4">
76
+ <div class="d-flex align-items-lg-center">
77
+ <div class="checkout-confirm-order-details-line-items-line-item-name-image" data-hook="order_item_image">
78
+ <%= link_to product_image(item.variant), item.product %>
79
+ </div>
80
+ <div class="d-flex flex-column mt-2 mt-lg-0" data-hook="order_item_description">
81
+ <div data-hook="order_item_name">
82
+ <%= link_to item.name, item.product, class: 'checkout-confirm-order-details-line-items-line-item-name-link' %>
83
+ </div>
84
+ <% unless item.variant.is_master? %>
85
+ <ul class="checkout-confirm-order-details-line-items-line-item-name-options text-uppercase list-unstyled mb-0">
86
+ <% item.variant.option_values.sort { |ov| ov.option_type.position }.each do |ov| %>
87
+ <li>
88
+ <% # TODO: rework option values so options_text method can be used here %>
89
+ <%= "#{ov.option_type.presentation}: #{ov.name.titleize}" %>
90
+ </li>
91
+ <% end %>
92
+ </ul>
93
+ <% end %>
94
+ <div class="d-lg-none" data-hook="order_item_price">
95
+ <div class="font-weight-bold"><%= item.single_money.to_html %></div>
96
+ </div>
97
+ <div class="d-lg-none" data-hook="order_item_qty">
98
+ <span><%= Spree.t(:quantity) %>:</span>
99
+ <span class="font-weight-bold"><%= item.quantity %></span>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ <div class="checkout-confirm-order-details-line-items-line-item-price d-none d-lg-table-cell align-middle py-4" data-hook="order_item_price">
105
+ <div><%= item.single_money.to_html %></div>
106
+ </div>
107
+ <div class="checkout-confirm-order-details-line-items-line-item-quantity d-none d-lg-table-cell align-middle py-4" data-hook="order_item_qty">
108
+ <span class="checkout-confirm-order-details-line-items-line-item-quantity-val d-lg-block"><%= item.quantity %></span>
109
+ </div>
110
+ <div class="checkout-confirm-order-details-line-items-line-item-total d-none d-lg-table-cell align-middle py-4" data-hook="order_item_total">
111
+ <div><%= item.display_total.to_s %></div>
112
+ </div>
113
+ </div>
148
114
  <% end %>
149
- </tfoot>
115
+ </div>
116
+ </div>
150
117
 
151
- <% if order.all_adjustments.tax.exists? %>
152
- <tfoot id="tax-adjustments" data-hook="order_details_tax_adjustments">
153
- <% order.all_adjustments.tax.group_by(&:label).each do |label, adjustments| %>
154
- <tr class="total">
155
- <td colspan="4" align="right" class="text-muted">
156
- <%= Spree.t(:tax) %>: <strong><%= label %></strong>
157
- </td>
158
- <td class="total">
159
- <span>
160
- <%= Spree::Money.new(
161
- adjustments.sum(&:amount), currency: order.currency
162
- ) %>
163
- </span>
164
- </td>
165
- </tr>
166
- <% end %>
167
- </tfoot>
118
+ <div class="mt-5" id="checkout-summary" data-hook="checkout_summary_box">
119
+ <%= render partial: 'spree/checkout/summary', locals: { order: @order } %>
120
+ <% unless @order.complete? %>
121
+ <div data-hook="buttons">
122
+ <% submit_label_key = @order.confirm? ? :place_order : :save_and_continue %>
123
+ <%= submit_tag Spree.t(submit_label_key), class: 'btn btn-primary text-uppercase font-weight-bold w-100 checkout-content-save-continue-button' %>
124
+ </div>
168
125
  <% end %>
169
-
170
- <tfoot id="order-charges" data-hook="order_details_adjustments">
171
- <% order.adjustments.eligible.each do |adjustment| %>
172
- <% next if (adjustment.source_type == 'Spree::TaxRate') and (adjustment.amount == 0) %>
173
- <tr class="total">
174
- <td colspan="4" align="right">
175
- <strong><%= adjustment.label %></strong>
176
- </td>
177
- <td class="total">
178
- <span><%= adjustment.display_amount.to_html %></span>
179
- </td>
180
- </tr>
181
- <% end %>
182
- </tfoot>
183
- </table>
126
+ </div>
184
127
  </div>