spree_frontend 4.2.6 → 4.3.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/app/assets/config/spree_frontend_manifest.js +4 -0
  4. data/app/assets/images/card-image.svg +4 -0
  5. data/app/assets/images/file-image.svg +4 -0
  6. data/app/assets/images/image.svg +4 -0
  7. data/app/assets/images/noimage/large.png +0 -0
  8. data/app/assets/images/noimage/mini.png +0 -0
  9. data/app/assets/images/noimage/plp.svg +23 -0
  10. data/app/assets/images/noimage/product.png +0 -0
  11. data/app/assets/images/noimage/small.png +0 -0
  12. data/app/assets/javascripts/spree/api/main.js +36 -0
  13. data/app/assets/javascripts/spree/api/storefront/cart.js +49 -0
  14. data/app/assets/javascripts/spree/frontend/checkout/payment.js +18 -5
  15. data/app/assets/javascripts/spree/frontend/checkout.js +16 -0
  16. data/app/assets/javascripts/spree/frontend/locale.es6 +13 -0
  17. data/app/assets/javascripts/spree/frontend/views/spree/home/product_carousels.js +3 -3
  18. data/app/assets/javascripts/spree/frontend/views/spree/products/index.js +0 -9
  19. data/app/assets/javascripts/spree/frontend/views/spree/products/price_filters.es6 +46 -0
  20. data/app/assets/javascripts/spree/frontend.js +3 -0
  21. data/app/assets/javascripts/spree.js +78 -0
  22. data/app/assets/stylesheets/spree/frontend/application.scss +1 -0
  23. data/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss +8 -0
  24. data/app/assets/stylesheets/spree/frontend/helpers/spree/frontend_helper.scss +41 -0
  25. data/app/assets/stylesheets/spree/frontend/variables/variables.scss +2 -2
  26. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +17 -5
  27. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/_index.scss +1 -0
  28. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/product_buy_bar.scss +20 -0
  29. data/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss +54 -67
  30. data/app/assets/stylesheets/spree/frontend/views/spree/shared/category_nav_bar.scss +3 -3
  31. data/app/assets/stylesheets/spree/frontend/views/spree/shared/footer.scss +4 -0
  32. data/app/assets/stylesheets/spree/frontend/views/spree/shared/main_nav_bar.scss +12 -1
  33. data/app/controllers/spree/addresses_controller.rb +14 -19
  34. data/app/controllers/spree/checkout_controller.rb +5 -3
  35. data/app/controllers/spree/cms_pages_controller.rb +29 -0
  36. data/app/controllers/spree/content_controller.rb +0 -2
  37. data/app/controllers/spree/errors_controller.rb +11 -0
  38. data/app/controllers/spree/home_controller.rb +34 -1
  39. data/app/controllers/spree/locale_controller.rb +7 -1
  40. data/app/controllers/spree/orders_controller.rb +9 -7
  41. data/app/controllers/spree/products_controller.rb +14 -13
  42. data/app/controllers/spree/store_controller.rb +25 -1
  43. data/app/controllers/spree/taxons_controller.rb +12 -5
  44. data/app/helpers/spree/addresses_helper.rb +9 -4
  45. data/app/helpers/spree/cms_pages_helper.rb +23 -0
  46. data/app/helpers/spree/frontend_helper.rb +109 -10
  47. data/app/helpers/spree/navigation_helper.rb +73 -4
  48. data/app/helpers/spree/products_filters_helper.rb +168 -0
  49. data/app/helpers/spree/store_helper.rb +3 -1
  50. data/app/views/spree/checkout/_address.html.erb +1 -1
  51. data/app/views/spree/checkout/_credit_card.html.erb +1 -0
  52. data/app/views/spree/cms_pages/show.html.erb +16 -0
  53. data/app/views/spree/errors/forbidden.html.erb +0 -0
  54. data/app/views/spree/errors/unauthorized.html.erb +0 -0
  55. data/app/views/spree/home/index.html.erb +19 -118
  56. data/app/views/spree/layouts/spree_application.html.erb +1 -1
  57. data/app/views/spree/products/_description.html.erb +16 -19
  58. data/app/views/spree/products/_filters_desktop.html.erb +50 -15
  59. data/app/views/spree/products/_filters_mobile.html.erb +38 -10
  60. data/app/views/spree/products/_sort_desktop.html.erb +17 -11
  61. data/app/views/spree/products/_sort_mobile.html.erb +16 -0
  62. data/app/views/spree/products/index.html.erb +1 -1
  63. data/app/views/spree/shared/_carousel_4_products.html.erb +2 -2
  64. data/app/views/spree/shared/_checkout_header.html.erb +22 -21
  65. data/app/views/spree/shared/_copyright.html.erb +1 -1
  66. data/app/views/spree/shared/_footer.html.erb +15 -9
  67. data/app/views/spree/shared/_head.html.erb +1 -1
  68. data/app/views/spree/shared/_header.html.erb +3 -3
  69. data/app/views/spree/shared/_main_nav_bar.html.erb +61 -43
  70. data/app/views/spree/shared/_mobile_navigation.html.erb +30 -19
  71. data/app/views/spree/shared/_nav_bar.html.erb +1 -1
  72. data/app/views/spree/shared/_option_values.html.erb +2 -21
  73. data/app/views/spree/shared/_order_details.html.erb +1 -1
  74. data/app/views/spree/shared/_paths.html.erb +8 -0
  75. data/app/views/spree/shared/_properties.html.erb +4 -0
  76. data/app/views/spree/shared/_translations.html.erb +2 -1
  77. data/app/views/spree/shared/carousel/_single.html.erb +1 -1
  78. data/app/views/spree/shared/carousel/_thumbnails.html.erb +1 -1
  79. data/app/views/spree/shared/cms/pages/_edit_mode.html.erb +13 -0
  80. data/app/views/spree/shared/cms/sections/_featured_article.html.erb +27 -0
  81. data/app/views/spree/shared/cms/sections/_hero_image.html.erb +60 -0
  82. data/app/views/spree/shared/cms/sections/_image_gallery.html.erb +171 -0
  83. data/app/views/spree/shared/cms/sections/_product_carousel.html.erb +5 -0
  84. data/app/views/spree/shared/cms/sections/_rich_text_content.html.erb +3 -0
  85. data/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb +118 -0
  86. data/app/views/spree/taxons/_header.html.erb +6 -1
  87. data/app/views/spree/users/show.html.erb +1 -1
  88. data/config/initializers/assets.rb +4 -13
  89. data/config/routes.rb +9 -3
  90. data/lib/generators/spree/frontend/install/install_generator.rb +5 -5
  91. data/lib/generators/spree/frontend/install/templates/app/assets/config/manifest.js +2 -0
  92. data/lib/generators/spree/frontend/install/templates/vendor/assets/javascripts/spree/frontend/all.js +8 -0
  93. data/lib/generators/spree/frontend/install/templates/vendor/assets/stylesheets/spree/frontend/all.css +9 -0
  94. data/lib/spree/frontend/engine.rb +6 -0
  95. data/lib/spree/frontend.rb +6 -3
  96. data/spec/fixtures/files/store_favicon.ico +0 -0
  97. data/spree_frontend.gemspec +7 -3
  98. data/vendor/assets/javascripts/cleave.js +8 -0
  99. data/vendor/assets/javascripts/fetch.umd.js +531 -0
  100. data/vendor/assets/javascripts/jquery.payment.js +652 -0
  101. data/vendor/assets/javascripts/jsuri.js +458 -0
  102. data/vendor/assets/javascripts/polyfill.min.js +1 -0
  103. metadata +116 -70
  104. data/app/assets/images/homepage/big_category_banner.jpg +0 -0
  105. data/app/assets/images/homepage/big_category_banner_mobile.jpg +0 -0
  106. data/app/assets/images/homepage/big_category_banner_tablet_landscape.jpg +0 -0
  107. data/app/assets/images/homepage/big_category_banner_tablet_portrait.jpg +0 -0
  108. data/app/assets/images/homepage/category_banner_lower.jpg +0 -0
  109. data/app/assets/images/homepage/category_banner_lower_mobile.jpg +0 -0
  110. data/app/assets/images/homepage/category_banner_lower_tablet_landscape.jpg +0 -0
  111. data/app/assets/images/homepage/category_banner_lower_tablet_portrait.jpg +0 -0
  112. data/app/assets/images/homepage/category_banner_upper.jpg +0 -0
  113. data/app/assets/images/homepage/category_banner_upper_mobile.jpg +0 -0
  114. data/app/assets/images/homepage/category_banner_upper_tablet_landscape.jpg +0 -0
  115. data/app/assets/images/homepage/category_banner_upper_tablet_portrait.jpg +0 -0
  116. data/app/assets/images/homepage/main_banner.jpg +0 -0
  117. data/app/assets/images/homepage/main_banner_mobile.jpg +0 -0
  118. data/app/assets/images/homepage/main_banner_tablet_landscape.jpg +0 -0
  119. data/app/assets/images/homepage/main_banner_tablet_portrait.jpg +0 -0
  120. data/app/assets/images/homepage/promo_banner_left.jpg +0 -0
  121. data/app/assets/images/homepage/promo_banner_left_mobile.jpg +0 -0
  122. data/app/assets/images/homepage/promo_banner_left_tablet_landscape.jpg +0 -0
  123. data/app/assets/images/homepage/promo_banner_left_tablet_portrait.jpg +0 -0
  124. data/app/assets/images/homepage/promo_banner_right.jpg +0 -0
  125. data/app/assets/images/homepage/promo_banner_right_mobile.jpg +0 -0
  126. data/app/assets/images/homepage/promo_banner_right_tablet_landscape.jpg +0 -0
  127. data/app/assets/images/homepage/promo_banner_right_tablet_portrait.jpg +0 -0
  128. data/app/assets/images/meganav/promo_banner_left-first-category.jpg +0 -0
  129. data/app/assets/images/meganav/promo_banner_left-second-category.jpg +0 -0
  130. data/app/assets/images/meganav/promo_banner_left-third-category.jpg +0 -0
  131. data/app/assets/images/meganav/promo_banner_right-first-category.jpg +0 -0
  132. data/app/assets/images/meganav/promo_banner_right-second-category.jpg +0 -0
  133. data/app/assets/images/meganav/promo_banner_right-third-category.jpg +0 -0
  134. data/app/assets/images/noimage/big_category_banner.jpg +0 -0
  135. data/app/assets/images/noimage/big_category_banner_mobile.jpg +0 -0
  136. data/app/assets/images/noimage/big_category_banner_tablet_landscape.jpg +0 -0
  137. data/app/assets/images/noimage/big_category_banner_tablet_portrait.jpg +0 -0
  138. data/app/assets/images/noimage/category_banner.jpg +0 -0
  139. data/app/assets/images/noimage/category_banner_mobile.jpg +0 -0
  140. data/app/assets/images/noimage/category_banner_plp.jpg +0 -0
  141. data/app/assets/images/noimage/category_banner_tablet_landscape.jpg +0 -0
  142. data/app/assets/images/noimage/category_banner_tablet_portrait.jpg +0 -0
  143. data/app/assets/images/noimage/main_banner.jpg +0 -0
  144. data/app/assets/images/noimage/main_banner_mobile.jpg +0 -0
  145. data/app/assets/images/noimage/main_banner_tablet_landscape.jpg +0 -0
  146. data/app/assets/images/noimage/main_banner_tablet_portrait.jpg +0 -0
  147. data/app/assets/images/noimage/product_photo.jpg +0 -0
  148. data/app/assets/images/noimage/promo_banner.jpg +0 -0
  149. data/app/assets/images/noimage/promo_banner_megamenu.jpg +0 -0
  150. data/app/assets/images/noimage/promo_banner_mobile.jpg +0 -0
  151. data/app/assets/images/noimage/promo_banner_tablet_landscape.jpg +0 -0
  152. data/app/assets/images/noimage/promo_banner_tablet_portrait.jpg +0 -0
  153. data/app/assets/javascripts/spree/frontend/locale.js +0 -13
  154. data/app/assets/javascripts/spree/frontend/multi_currency.js +0 -13
  155. data/lib/generators/spree/frontend/install/templates/config/initializers/spree_storefront.rb +0 -1
  156. data/lib/generators/spree/frontend/install/templates/config/spree_storefront.yml +0 -99
@@ -1,55 +1,73 @@
1
- <% if spree_navigation_data.any? %>
1
+ <% if spree_menu.present? %>
2
2
  <div class="h-100" role="navigation" aria-label="<%= Spree.t('nav_bar.desktop') %>">
3
3
  <ul class="nav h-100 main-nav-bar">
4
- <% spree_navigation_data.each do |root| %>
5
- <li class="p-0 nav-item main-nav-bar-category">
6
- <% has_dropdown = root[:items].present? || root[:promo_banners].present? %>
7
- <% dropdown_toggle_class = has_dropdown ? "dropdown-toggle" : "" %>
8
- <% data_attr = has_dropdown ? { toggle: "dropdown" } : {} %>
9
- <% aria_attr = has_dropdown ? { haspopup: true, expanded: false } : {} %>
10
- <%= link_to root[:title], root[:url], class: "nav-link main-nav-bar-item main-nav-bar-category-button #{dropdown_toggle_class}", data: data_attr, aria: aria_attr %>
11
- <% if has_dropdown %>
12
- <div class="dropdown-menu w-100 shadow main-nav-bar-category-dropdown">
13
- <div class="container p-0 d-flex justify-content-xl-around mx-auto">
14
- <div class="row">
15
- <% if root[:items].present? %>
16
- <div class="category-links">
17
- <% if root[:subtitle].present? %>
18
- <div class="category-links-header text-uppercase">
19
- <%= root[:subtitle] %>
4
+ <% spree_menu.children.each do |parent| %>
5
+ <li class="p-0 nav-item main-nav-bar-category">
6
+ <% has_dropdown = parent.children.present? %>
7
+ <% dropdown_toggle_class = has_dropdown ? "dropdown-toggle" : "" %>
8
+ <% data_attr = has_dropdown ? { toggle: "dropdown" } : {} %>
9
+ <% aria_attr = has_dropdown ? { haspopup: true, expanded: false } : {} %>
10
+ <% if parent.container? %>
11
+ <%= content_tag :span, parent.name, class: "nav-link main-nav-bar-item main-nav-bar-category-button #{dropdown_toggle_class}", data: data_attr, aria: aria_attr %>
12
+ <% else %>
13
+ <%= spree_nav_link_tag(parent, { class: "nav-link main-nav-bar-item main-nav-bar-category-button #{dropdown_toggle_class}", data: data_attr, aria: aria_attr }) %>
14
+ <% end %>
15
+
16
+ <% if has_dropdown %>
17
+ <div class="dropdown-menu w-100 shadow main-nav-bar-category-dropdown">
18
+ <div class="container p-0 d-flex justify-content-xl-around mx-auto">
19
+ <div class="row px-5">
20
+ <% parent.children.each do |child| %>
21
+
22
+ <!-- Categories -->
23
+ <% if child.container? && child.code?('category') %>
24
+ <div class="category-links my-4 mx-2">
25
+ <div class="category-links-header text-uppercase">
26
+ <%= child.name %>
27
+ </div>
28
+ <% if child.children.present? %>
29
+ <ul class="pl-0">
30
+ <% child.children.each do |category_link| %>
31
+ <li>
32
+ <%= spree_nav_link_tag(category_link, { class: "text-uppercase main-nav-bar-category-links dropdown-item truncate" }) %>
33
+ </li>
34
+ <% end %>
35
+ </ul>
36
+ <% end %>
20
37
  </div>
21
38
  <% end %>
22
- <ul class="pl-0">
23
- <% root[:items].each do |item| %>
24
- <li>
25
- <%= link_to item[:title], item[:url], class: "text-uppercase main-nav-bar-category-links dropdown-item" %>
26
- </li>
39
+
40
+ <!-- Promos -->
41
+ <% if child.container? && child.code?('promo') %>
42
+ <% if child.children.present? %>
43
+ <% child.children.each do |promo_banner| %>
44
+ <%= spree_nav_link_tag(promo_banner, { class: "dropdown-item" }) do %>
45
+ <div class="category-image text-center my-4 mx-3">
46
+ <% if promo_banner.icon.present? %>
47
+ <%= image_tag main_app.url_for(promo_banner.icon.attachment), alt: promo_banner.icon.alt ,title: promo_banner.subtitle %>
48
+ <% end %>
49
+ <div class="category-box">
50
+ <div class="category-box-small-text">
51
+ <%= promo_banner.subtitle %>
52
+ </div>
53
+ <div class="category-box-big-text">
54
+ <%= promo_banner.name %>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <% end %>
59
+ <% end %>
27
60
  <% end %>
28
- </ul>
29
- </div>
30
- <% end %>
31
- <% if root[:promo_banners].present? %>
32
- <% root[:promo_banners].each do |promo_banner| %>
33
- <%= link_to promo_banner[:url], class: "dropdown-item" do %>
34
- <div class="category-image text-center mx-3">
35
- <%= main_nav_image(promo_banner[:image], promo_banner[:title]) %>
36
- <div class="category-box">
37
- <div class="category-box-small-text">
38
- <%= promo_banner[:subtitle] %>
39
- </div>
40
- <div class="category-box-big-text">
41
- <%= promo_banner[:title] %>
42
- </div>
43
- </div>
44
- </div>
45
61
  <% end %>
62
+
46
63
  <% end %>
47
- <% end %>
64
+ </div>
48
65
  </div>
49
66
  </div>
50
- </div>
51
- <% end %>
52
- </li>
67
+
68
+ <% end %>
69
+ </li>
70
+
53
71
  <% end %>
54
72
  </ul>
55
73
  </div>
@@ -1,4 +1,4 @@
1
- <% if spree_navigation_data.any? %>
1
+ <% if spree_menu.present? %>
2
2
  <div class="position-fixed text-uppercase d-xl-none mobile-navigation" role="navigation" aria-label="<%= Spree.t('nav_bar.mobile') %>">
3
3
  <div class="container d-flex align-items-center justify-content-between header-spree" data-hook>
4
4
  <button class="m-0 p-0" id="mobile-navigation-back-button" aria-label="<%= Spree.t('nav_bar.go_to_previous_menu') %>">
@@ -18,30 +18,41 @@
18
18
  </div>
19
19
 
20
20
  <ul class="list-unstyled position-relative h-100 mobile-navigation-list">
21
- <% spree_navigation_data.each do |root| %>
22
- <li class="d-flex justify-content-between align-items-center mobile-navigation-list-item">
23
- <%= link_to root[:title], root[:url], class: 'w-75' %>
24
- <% if root[:items].present? %>
25
- <a class="w-25 text-right mobile-navigation-category-link" data-category="<%= root[:title].parameterize %>" href="#" aria-label="<%= Spree.t('go_to_category') %>">
21
+ <% spree_menu.children.each do |parent| %>
22
+ <li class="d-flex justify-content-between align-items-center mobile-navigation-list-item">
23
+ <% if parent.container? %>
24
+ <%= content_tag :span, parent.name %>
25
+ <% else %>
26
+ <%= spree_nav_link_tag(parent, {class: 'w-75'}) %>
27
+ <% end %>
28
+
29
+ <% if parent.children.present? %>
30
+ <a class="w-25 text-right mobile-navigation-category-link" data-category="<%= parent.name.parameterize %>" href="#" aria-label="<%= Spree.t('go_to_category') %>">
26
31
  <%= icon(name: 'arrow-right',
27
32
  classes: 'd-inline spree-icon-arrow spree-icon-arrow-right',
28
33
  width: 14,
29
34
  height: 27) %>
30
35
  </a>
31
- <ul class="list-unstyled position-absolute mobile-navigation-sublist" data-category="<%= root[:title].parameterize %>">
32
- <li class="text-center font-weight-bold mobile-navigation-sublist-header">
33
- <%= root[:title] %>
34
- </li>
35
- <% root[:items].each do |item| %>
36
- <li class="d-flex justify-content-between align-items-center mobile-navigation-list-item">
37
- <%= link_to item[:title], item[:url], class: 'w-75' %>
36
+ <ul class="list-unstyled position-absolute mobile-navigation-sublist" data-category="<%= parent.name.parameterize %>">
37
+ <li class="text-center font-weight-bold mobile-navigation-sublist-header">
38
+ <%= parent.name %>
38
39
  </li>
39
- <% end %>
40
- </ul>
41
- <% end %>
42
- </li>
40
+
41
+ <% parent.children.each do |child| %>
42
+ <% if child.container? && child.code?('category') %>
43
+ <li class="text-muted mt-2"><%= child.name %></li>
44
+ <% if child.children.present? %>
45
+ <% child.children.each do |category_link| %>
46
+ <li class="d-flex justify-content-between align-items-center mobile-navigation-list-item">
47
+ <%= spree_nav_link_tag(category_link, {class: 'w-75'}) %>
48
+ </li>
49
+ <% end %>
50
+ <% end %>
51
+ <% end %>
52
+ <% end %>
53
+ </ul>
54
+ <% end %>
55
+ </li>
43
56
  <% end %>
44
- <%= render partial: 'spree/shared/mobile_internationalization_options' %>
45
57
  </ul>
46
- </div>
47
58
  <% end %>
@@ -1,4 +1,4 @@
1
- <ul id="nav-bar" class="nav align-items-center d-flex flex-nowrap justify-content-end navbar-right">
1
+ <ul id="nav-bar" class="nav align-items-center d-flex flex-nowrap justify-content-end navbar-right" data-turbo-permanent data-turbolinks-permanent>
2
2
  <li>
3
3
  <div class="navbar-right-search-menu">
4
4
  <button type="button" class="navbar-right-dropdown-toggle search-icons" aria-label="<%= Spree.t('nav_bar.show_search') %>">
@@ -1,24 +1,5 @@
1
- <% cache base_cache_key + [ot_downcase_name, params_ot_downcase_name, filtering_params_cache_key, @taxon&.id] do %>
2
- <% selected_option_values = params_ot_downcase_name&.split(',')&.map(&:to_i) || [] %>
1
+ <% cache option_type_cache_key(option_type) do %>
3
2
  <% option_type.option_values.each do |option_value| %>
4
- <% id = option_value.id %>
5
- <% name = option_value.name %>
6
-
7
- <% option_value_param = (selected_option_values.include?(id) ? selected_option_values - [id] : selected_option_values + [id]).join(',') %>
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 color_option_type_name.present? && color_option_type_name.downcase == ot_downcase_name %>
10
-
11
- <span class="d-inline-block mb-1">
12
- <%= render partial: 'spree/shared/color_select', locals: {
13
- color: option_value.presentation,
14
- selected: selected_option_values.include?(id)
15
- } %>
16
- </span>
17
- <% else %>
18
- <div class="d-inline-block text-uppercase py-1 px-2 m-1 plp-overlay-card-item <%= 'plp-overlay-card-item--selected' if selected_option_values.include?(id) %>">
19
- <%= name %>
20
- </div>
21
- <% end %>
22
- <% end %>
3
+ <%= option_value_filter_link(option_value, permitted_params) %>
23
4
  <% end %>
24
5
  <% end %>
@@ -117,7 +117,7 @@
117
117
 
118
118
  <div class="mt-5" id="checkout-summary" data-hook="checkout_summary_box">
119
119
  <%= render partial: 'spree/checkout/summary', locals: { order: @order } %>
120
- <% unless @order.complete? %>
120
+ <% unless @order.uneditable? %>
121
121
  <div data-hook="buttons">
122
122
  <% submit_label_key = @order.confirm? ? :place_order : :save_and_continue %>
123
123
  <%= submit_tag Spree.t(submit_label_key), class: 'btn btn-primary text-uppercase font-weight-bold w-100 checkout-content-save-continue-button' %>
@@ -0,0 +1,8 @@
1
+ <script>
2
+ SpreePaths = <%==
3
+ {
4
+ mounted_at: Rails.application.routes.url_helpers.spree_path(trailing_slash: true),
5
+ admin: Spree.admin_path.gsub(/\A(\/)?(.*[^\/])(\/)?\z/, '\\2/')
6
+ }.to_json
7
+ %>
8
+ </script>
@@ -0,0 +1,4 @@
1
+ <% selected_properties = params.dig(:properties, "#{property.filter_param}")&.split(',') || [] %>
2
+ <% property.uniq_values.each do |value| %>
3
+ <%= property_value_filter_link(property, value, permitted_params) %>
4
+ <% end %>
@@ -4,7 +4,8 @@
4
4
  {
5
5
  coupon_code_applied: Spree.t(:coupon_code_applied),
6
6
  coupon_code_removed: Spree.t(:coupon_code_removed),
7
- coupon_code_error_icon: image_path('error.svg')
7
+ coupon_code_error_icon: image_path('error.svg'),
8
+ credit_card_remove_confirmation: Spree.t(:credit_card_remove_confirmation)
8
9
  }.to_json
9
10
  %>
10
11
  });
@@ -43,7 +43,7 @@
43
43
  <% images.each_with_index do |image, imageIndex| %>
44
44
  <div
45
45
  class="carousel-item product-carousel-item<%= ' active' if imageIndex == 0 %>"
46
- data-variant-is-master="<%= image.viewable_id == @product.master_id %>"
46
+ data-variant-is-master="<%= image.viewable_id == @product.master.id %>"
47
47
  data-variant-id="<%= image.viewable_id %>">
48
48
  <div class="product-carousel-item-squared <%= 'product-carousel-item-squared-only' if images.length == 1 %>">
49
49
  <% image_attrs = {
@@ -17,7 +17,7 @@
17
17
  <div
18
18
  class="product-thumbnails-carousel-item-single product-thumbnails-carousel-item-single--visible"
19
19
  data-product-carousel-to-slide="<%= image_index %>"
20
- data-variant-is-master="<%= image.viewable_id == @product.master_id %>"
20
+ data-variant-is-master="<%= image.viewable_id == @product.master.id %>"
21
21
  data-variant-id="<%= image.viewable_id %>">
22
22
  <%= lazy_image(
23
23
  src: main_app.url_for(image.url(:pdp_thumbnail)),
@@ -0,0 +1,13 @@
1
+ <% if edit_mode %>
2
+ <div class="fixed-bottom text-center">
3
+ <div class="row">
4
+ <div id="draftNotice" class="col-12 d-flex w-100 p-4 justify-content-center align-items-center bg-dark">
5
+ <span class="text-white">
6
+ <h5 class="mb-0">
7
+ <%= Spree.t('draft_mode') %>
8
+ </h5>
9
+ </span>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ <% end %>
@@ -0,0 +1,27 @@
1
+ <% if section.gutters? %>
2
+ <% section_padding = 'px-3' %>
3
+ <% else %>
4
+ <% section_padding = 'px-0' %>
5
+ <% end %>
6
+
7
+ <div class="col-12 <%= section_padding %>">
8
+ <div class="text-center homepage-fashion-trends-box">
9
+ <% if section.title.present? %>
10
+ <div class="homepage-fashion-trends-box-summer-text mb-1"><%= section.title %></div>
11
+ <% end %>
12
+
13
+ <% if section.subtitle.present? %>
14
+ <div class="homepage-fashion-trends-box-fashion-trends-text mb-2"><%= section.subtitle %></div>
15
+ <% end %>
16
+
17
+ <div class="homepage-fashion-trends-box-description-text text-center mb-3">
18
+ <div class="mb-3">
19
+ <%= raw section.rte_content %>
20
+ </div>
21
+
22
+ <% if section.button_text.present? && section.link.present? %>
23
+ <%= link_to section.button_text, spree_localized_link(section), class: 'btn text-center spree-btn btn-outline-primary w-75' %>
24
+ <% end %>
25
+ </div>
26
+ </div>
27
+ </div>
@@ -0,0 +1,60 @@
1
+ <% if section.fullscreen? %>
2
+ <% if section.gutters? %>
3
+ <% section_padding = 'px-3' %>
4
+ <% else %>
5
+ <% section_padding = 'px-0' %>
6
+ <% end %>
7
+ <% else %>
8
+ <% section_padding = 'px-2' %>
9
+ <% end %>
10
+ <div class="col-12 homepage-hero-image position-relative p-0 <%= section_padding %>">
11
+
12
+ <div class="bg-light" style="--aspect-ratio:12/5;">
13
+ <% if section.image_one.attached? %>
14
+
15
+ <!-- SM to MD -->
16
+ <img class="d-block d-md-none lazyload"
17
+ data-src="<%= main_app.url_for(section.img_one_sm) %>"
18
+ data-srcset="<%= main_app.url_for(section.img_one_sm) %>"
19
+ alt="<%= section&.title %>">
20
+
21
+ <!-- MD to LG -->
22
+ <img class="d-none d-md-block d-lg-none lazyload"
23
+ data-src="<%= main_app.url_for(section.img_one_md) %>"
24
+ data-srcset="<%= main_app.url_for(section.img_one_md) %>"
25
+ alt="<%= section&.title %>">
26
+
27
+ <!-- LG to XL -->
28
+ <img class="d-none d-lg-block d-xl-none lazyload"
29
+ data-src="<%= main_app.url_for(section.img_one_lg) %>"
30
+ data-srcset="<%= main_app.url_for(section.img_one_lg) %>"
31
+ alt="<%= section&.title %>">
32
+
33
+ <!-- XL UP -->
34
+ <img class="d-none d-xl-block lazyload"
35
+ data-src="<%= main_app.url_for(section.img_one_xl) %>"
36
+ data-srcset="<%= main_app.url_for(section.img_one_xl) %>"
37
+ alt="<%= section&.title %>">
38
+
39
+ <% else %>
40
+ <%= icon( name: 'card-image',
41
+ classes: 'text-black-50',
42
+ width: 26,
43
+ height: 26) %>
44
+ <% end %>
45
+
46
+ <div class="hero-content position-absolute-y-center">
47
+ <% if section.title.present? %>
48
+ <div class="homepage-hero-image-text mx-auto pb-0 pb-sm-2 pb-md-3">
49
+ <%= section.title %>
50
+ </div>
51
+ <% end %>
52
+
53
+ <% if section.link.present? && section.button_text.present? %>
54
+ <div>
55
+ <%= link_to section.button_text, spree_localized_link(section), class: 'btn btn-primary spree-btn px-5' %>
56
+ </div>
57
+ <% end %>
58
+ </div>
59
+ </div>
60
+ </div>
@@ -0,0 +1,171 @@
1
+ <% if section.fullscreen? %>
2
+ <% if section.default_layout? %>
3
+ <% section_one_padding = 'pl-3' %>
4
+ <% section_two_padding = 'pr-3' %>
5
+ <% else %>
6
+ <% section_one_padding = 'pr-3 order-2' %>
7
+ <% section_two_padding = 'pl-3 order-1' %>
8
+ <% end %>
9
+ <% else %>
10
+ <% if section.default_layout? %>
11
+ <% section_one_padding = '' %>
12
+ <% section_two_padding = '' %>
13
+ <% else %>
14
+ <% section_one_padding = 'order-2' %>
15
+ <% section_two_padding = 'order-1' %>
16
+ <% end %>
17
+ <% end %>
18
+
19
+ <% if section.show_labels? %>
20
+ <% labels_class = 'homepage-taxon-box-text' %>
21
+ <% else %>
22
+ <% labels_class = 'd-none' %>
23
+ <% end %>
24
+
25
+ <% if section.link_one.present? && section.link_type_one == 'Spree::Taxon' %>
26
+ <% link_one = spree.nested_taxons_path(section.link_one) %>
27
+ <% link_one_classes = 'homepage-taxon-box bg-light' %>
28
+ <% elsif section.link_one.present? && section.link_type_one == 'Spree::Product' %>
29
+ <% link_one = spree.product_path(section.link_one) %>
30
+ <% link_one_classes = 'homepage-taxon-box bg-light' %>
31
+ <% else %>
32
+ <% link_one = nil %>
33
+ <% link_one_classes = 'homepage-taxon-box bg-light pointer-events-none cursor-default' %>
34
+ <% end %>
35
+
36
+ <% if section.link_two.present? && section.link_type_two == 'Spree::Taxon' %>
37
+ <% link_two = spree.nested_taxons_path(section.link_two) %>
38
+ <% link_two_classes = 'homepage-taxon-box bg-light' %>
39
+ <% elsif section.link_two.present? && section.link_type_two == 'Spree::Product' %>
40
+ <% link_two = spree.product_path(section.link_two) %>
41
+ <% link_two_classes = 'homepage-taxon-box bg-light' %>
42
+ <% else %>
43
+ <% link_two = nil %>
44
+ <% link_two_classes = 'homepage-taxon-box bg-light pointer-events-none cursor-default' %>
45
+ <% end %>
46
+
47
+ <% if section.link_three.present? && section.link_type_three == 'Spree::Taxon' %>
48
+ <% link_three = spree.nested_taxons_path(section.link_three) %>
49
+ <% link_three_classes = 'homepage-taxon-box bg-light' %>
50
+ <% elsif section.link_three.present? && section.link_type_three == 'Spree::Product' %>
51
+ <% link_three = spree.product_path(section.link_three) %>
52
+ <% link_three_classes = 'homepage-taxon-box bg-light' %>
53
+ <% else %>
54
+ <% link_three = nil %>
55
+ <% link_three_classes = 'homepage-taxon-box bg-light pointer-events-none cursor-default' %>
56
+ <% end %>
57
+
58
+ <!-- Left Block -->
59
+ <div class="col-6 <%= section_one_padding %>">
60
+
61
+ <!-- Top Left Block SQUARE -->
62
+ <!-- margin-bottom: 3.7% is important for keeping the bottom of the sections aligned -->
63
+ <div class="row" style="margin-bottom: 3.7%;">
64
+ <div class="col-12">
65
+
66
+ <%= link_to link_one, class: link_one_classes, style: '--aspect-ratio:18/13;' do %>
67
+ <% if section.image_one.attached? && section.image_one.variable? %>
68
+
69
+ <!-- XS to MD -->
70
+ <img class="d-md-none lazyload"
71
+ data-src="<%= main_app.url_for(section.img_one_md) %>"
72
+ data-srcset="<%= main_app.url_for(section.img_one_md) %>"
73
+ alt="<%= section&.title_one %>">
74
+
75
+ <!-- MD to XL -->
76
+ <img class="d-none d-md-block d-xl-none lazyload"
77
+ data-src="<%= main_app.url_for(section.img_one_lg) %>"
78
+ data-srcset="<%= main_app.url_for(section.img_one_lg) %>"
79
+ alt="<%= section&.title_one %>">
80
+
81
+ <!-- XL UP -->
82
+ <img class="d-none d-xl-block lazyload"
83
+ data-src="<%= main_app.url_for(section.img_one_xl) %>"
84
+ data-srcset="<%= main_app.url_for(section.img_one_xl) %>"
85
+ alt="<%= section&.title_one %>">
86
+ <% else %>
87
+ <%= icon( name: 'card-image',
88
+ classes: 'homepage-taxon-box text-black-50',
89
+ width: 26,
90
+ height: 26) %>
91
+ <% end %>
92
+ <div class="<%= labels_class %>" aria-label="<%= section&.title_one %>">
93
+ <h3 class="homepage-hpb"><%= section&.title_one %></h3>
94
+ </div>
95
+ <% end %>
96
+
97
+ </div>
98
+ </div>
99
+
100
+ <!-- Bottom Left Block SQUARE -->
101
+ <div class="row">
102
+ <div class="col-12">
103
+
104
+ <%= link_to link_three, class: link_three_classes, style: '--aspect-ratio:18/13;' do %>
105
+ <% if section.image_three.attached? && section.image_three.variable? %>
106
+
107
+ <!-- XS to MD -->
108
+ <img class="d-md-none lazyload"
109
+ data-src="<%= main_app.url_for(section.img_three_md) %>"
110
+ data-srcset="<%= main_app.url_for(section.img_three_md) %>"
111
+ alt="<%= section&.title_three %>">
112
+
113
+ <!-- MD to XL -->
114
+ <img class="d-none d-md-block d-xl-none lazyload"
115
+ data-src="<%= main_app.url_for(section.img_three_lg) %>"
116
+ data-srcset="<%= main_app.url_for(section.img_three_lg) %>"
117
+ alt="<%= section&.title_three %>">
118
+
119
+ <!-- XL UP -->
120
+ <img class="d-none d-xl-block lazyload"
121
+ data-src="<%= main_app.url_for(section.img_three_xl) %>"
122
+ data-srcset="<%= main_app.url_for(section.img_three_xl) %>"
123
+ alt="<%= section&.title_three %>">
124
+ <% else %>
125
+ <%= icon( name: 'card-image',
126
+ classes: 'homepage-taxon-box text-black-50',
127
+ width: 26,
128
+ height: 26) %>
129
+ <% end %>
130
+ <div class="<%= labels_class %>" aria-label="<%= section&.title_three %>">
131
+ <h3 class="homepage-hpb"><%= section&.title_three %></h3>
132
+ </div>
133
+ <% end %>
134
+
135
+ </div>
136
+ </div>
137
+ </div>
138
+
139
+ <!-- Right Block TALL -->
140
+ <div class="col-6 <%= section_two_padding %>">
141
+ <%= link_to link_two, class: link_two_classes, style: '--aspect-ratio:27/40;' do %>
142
+ <% if section.image_two.attached? && section.image_two.variable? %>
143
+
144
+ <!-- XS to MD -->
145
+ <img class="d-md-none lazyload"
146
+ data-src="<%= main_app.url_for(section.img_two_md) %>"
147
+ data-srcset="<%= main_app.url_for(section.img_two_md) %>"
148
+ alt="<%= section&.title_two %>">
149
+
150
+ <!-- MD to XL -->
151
+ <img class="d-none d-md-block d-xl-none lazyload"
152
+ data-src="<%= main_app.url_for(section.img_two_lg) %>"
153
+ data-srcset="<%= main_app.url_for(section.img_two_lg) %>"
154
+ alt="<%= section&.title_two %>">
155
+
156
+ <!-- XL UP -->
157
+ <img class="d-none d-xl-block lazyload"
158
+ data-src="<%= main_app.url_for(section.img_two_xl) %>"
159
+ data-srcset="<%= main_app.url_for(section.img_two_xl) %>"
160
+ alt="<%= section&.title_two %>">
161
+ <% else %>
162
+ <%= icon( name: 'file-image',
163
+ classes: 'homepage-taxon-box text-black-50',
164
+ width: 26,
165
+ height: 26) %>
166
+ <% end %>
167
+ <div class="<%= labels_class %>" aria-label="<%= section&.title_two %>">
168
+ <h3 class="homepage-hpb"><%= section&.title_two %></h3>
169
+ </div>
170
+ <% end %>
171
+ </div>
@@ -0,0 +1,5 @@
1
+ <div class="col-12">
2
+ <% if section.linked_resource %>
3
+ <div data-product-carousel-taxon-id='<%= section.linked_resource.id %>' class="my-3"></div>
4
+ <% end %>
5
+ </div>
@@ -0,0 +1,3 @@
1
+ <div class="col-12">
2
+ <%= raw section.rte_content %>
3
+ </div>