spree_frontend 4.2.4 → 4.3.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) 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/arrow-right-circle-fill.svg +3 -0
  5. data/app/assets/images/card-image.svg +4 -0
  6. data/app/assets/images/file-image.svg +4 -0
  7. data/app/assets/images/image.svg +4 -0
  8. data/app/assets/images/noimage/large.png +0 -0
  9. data/app/assets/images/noimage/mini.png +0 -0
  10. data/app/assets/images/noimage/plp.svg +23 -0
  11. data/app/assets/images/noimage/product.png +0 -0
  12. data/app/assets/images/noimage/small.png +0 -0
  13. data/app/assets/javascripts/spree/api/main.js +36 -0
  14. data/app/assets/javascripts/spree/api/storefront/cart.js +49 -0
  15. data/app/assets/javascripts/spree/frontend/checkout/payment.js +18 -5
  16. data/app/assets/javascripts/spree/frontend/checkout.js +16 -0
  17. data/app/assets/javascripts/spree/frontend/currency.js +11 -9
  18. data/app/assets/javascripts/spree/frontend/locale.es6 +13 -0
  19. data/app/assets/javascripts/spree/frontend/views/spree/home/product_carousels.js +3 -3
  20. data/app/assets/javascripts/spree/frontend/views/spree/products/index.js +0 -9
  21. data/app/assets/javascripts/spree/frontend/views/spree/products/price_filters.es6 +46 -0
  22. data/app/assets/javascripts/spree/frontend.js +3 -0
  23. data/app/assets/javascripts/spree.js +78 -0
  24. data/app/assets/stylesheets/spree/frontend/application.scss +1 -0
  25. data/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss +8 -0
  26. data/app/assets/stylesheets/spree/frontend/helpers/spree/frontend_helper.scss +41 -0
  27. data/app/assets/stylesheets/spree/frontend/variables/variables.scss +2 -2
  28. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +17 -5
  29. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/_index.scss +1 -0
  30. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/product_buy_bar.scss +20 -0
  31. data/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss +54 -67
  32. data/app/assets/stylesheets/spree/frontend/views/spree/shared/category_nav_bar.scss +3 -3
  33. data/app/assets/stylesheets/spree/frontend/views/spree/shared/footer.scss +4 -0
  34. data/app/assets/stylesheets/spree/frontend/views/spree/shared/main_nav_bar.scss +12 -1
  35. data/app/controllers/spree/addresses_controller.rb +14 -19
  36. data/app/controllers/spree/checkout_controller.rb +5 -3
  37. data/app/controllers/spree/cms_pages_controller.rb +29 -0
  38. data/app/controllers/spree/content_controller.rb +0 -2
  39. data/app/controllers/spree/errors_controller.rb +11 -0
  40. data/app/controllers/spree/home_controller.rb +34 -1
  41. data/app/controllers/spree/locale_controller.rb +7 -1
  42. data/app/controllers/spree/orders_controller.rb +9 -7
  43. data/app/controllers/spree/products_controller.rb +14 -13
  44. data/app/controllers/spree/store_controller.rb +25 -1
  45. data/app/controllers/spree/taxons_controller.rb +12 -5
  46. data/app/helpers/spree/addresses_helper.rb +9 -4
  47. data/app/helpers/spree/cms_pages_helper.rb +23 -0
  48. data/app/helpers/spree/frontend_helper.rb +109 -10
  49. data/app/helpers/spree/navigation_helper.rb +73 -4
  50. data/app/helpers/spree/products_filters_helper.rb +168 -0
  51. data/app/helpers/spree/store_helper.rb +3 -1
  52. data/app/views/spree/checkout/_address.html.erb +1 -1
  53. data/app/views/spree/checkout/_credit_card.html.erb +1 -0
  54. data/app/views/spree/cms_pages/show.html.erb +16 -0
  55. data/app/views/spree/errors/forbidden.html.erb +0 -0
  56. data/app/views/spree/errors/unauthorized.html.erb +0 -0
  57. data/app/views/spree/home/index.html.erb +19 -118
  58. data/app/views/spree/layouts/spree_application.html.erb +3 -2
  59. data/app/views/spree/products/_description.html.erb +16 -19
  60. data/app/views/spree/products/_filters_desktop.html.erb +50 -15
  61. data/app/views/spree/products/_filters_mobile.html.erb +38 -10
  62. data/app/views/spree/products/_sort_desktop.html.erb +17 -11
  63. data/app/views/spree/products/_sort_mobile.html.erb +16 -0
  64. data/app/views/spree/products/index.html.erb +1 -1
  65. data/app/views/spree/shared/_carousel_4_products.html.erb +8 -8
  66. data/app/views/spree/shared/_checkout_header.html.erb +22 -21
  67. data/app/views/spree/shared/_copyright.html.erb +1 -10
  68. data/app/views/spree/shared/_footer.html.erb +18 -12
  69. data/app/views/spree/shared/_get_started.html.erb +32 -0
  70. data/app/views/spree/shared/_head.html.erb +1 -1
  71. data/app/views/spree/shared/_header.html.erb +3 -3
  72. data/app/views/spree/shared/_main_nav_bar.html.erb +61 -43
  73. data/app/views/spree/shared/_mobile_navigation.html.erb +30 -19
  74. data/app/views/spree/shared/_nav_bar.html.erb +1 -1
  75. data/app/views/spree/shared/_option_values.html.erb +2 -21
  76. data/app/views/spree/shared/_order_details.html.erb +1 -1
  77. data/app/views/spree/shared/_paths.html.erb +8 -0
  78. data/app/views/spree/shared/_properties.html.erb +4 -0
  79. data/app/views/spree/shared/_translations.html.erb +2 -1
  80. data/app/views/spree/shared/carousel/_single.html.erb +1 -1
  81. data/app/views/spree/shared/carousel/_thumbnails.html.erb +1 -1
  82. data/app/views/spree/shared/cms/pages/_edit_mode.html.erb +13 -0
  83. data/app/views/spree/shared/cms/sections/_featured_article.html.erb +27 -0
  84. data/app/views/spree/shared/cms/sections/_hero_image.html.erb +60 -0
  85. data/app/views/spree/shared/cms/sections/_image_gallery.html.erb +171 -0
  86. data/app/views/spree/shared/cms/sections/_product_carousel.html.erb +5 -0
  87. data/app/views/spree/shared/cms/sections/_rich_text_content.html.erb +3 -0
  88. data/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb +118 -0
  89. data/app/views/spree/taxons/_header.html.erb +6 -1
  90. data/app/views/spree/users/show.html.erb +4 -1
  91. data/config/initializers/assets.rb +4 -13
  92. data/config/routes.rb +9 -3
  93. data/lib/generators/spree/frontend/install/install_generator.rb +5 -5
  94. data/lib/generators/spree/frontend/install/templates/app/assets/config/manifest.js +2 -0
  95. data/lib/generators/spree/frontend/install/templates/vendor/assets/javascripts/spree/frontend/all.js +8 -0
  96. data/lib/generators/spree/frontend/install/templates/vendor/assets/stylesheets/spree/frontend/all.css +9 -0
  97. data/lib/spree/frontend/engine.rb +6 -0
  98. data/lib/spree/frontend.rb +6 -3
  99. data/spec/fixtures/files/store_favicon.ico +0 -0
  100. data/spree_frontend.gemspec +13 -9
  101. data/vendor/assets/javascripts/cleave.js +8 -0
  102. data/vendor/assets/javascripts/fetch.umd.js +531 -0
  103. data/vendor/assets/javascripts/jquery.payment.js +652 -0
  104. data/vendor/assets/javascripts/jsuri.js +458 -0
  105. data/vendor/assets/javascripts/polyfill.min.js +1 -0
  106. metadata +134 -87
  107. data/app/assets/images/homepage/big_category_banner.jpg +0 -0
  108. data/app/assets/images/homepage/big_category_banner_mobile.jpg +0 -0
  109. data/app/assets/images/homepage/big_category_banner_tablet_landscape.jpg +0 -0
  110. data/app/assets/images/homepage/big_category_banner_tablet_portrait.jpg +0 -0
  111. data/app/assets/images/homepage/category_banner_lower.jpg +0 -0
  112. data/app/assets/images/homepage/category_banner_lower_mobile.jpg +0 -0
  113. data/app/assets/images/homepage/category_banner_lower_tablet_landscape.jpg +0 -0
  114. data/app/assets/images/homepage/category_banner_lower_tablet_portrait.jpg +0 -0
  115. data/app/assets/images/homepage/category_banner_upper.jpg +0 -0
  116. data/app/assets/images/homepage/category_banner_upper_mobile.jpg +0 -0
  117. data/app/assets/images/homepage/category_banner_upper_tablet_landscape.jpg +0 -0
  118. data/app/assets/images/homepage/category_banner_upper_tablet_portrait.jpg +0 -0
  119. data/app/assets/images/homepage/main_banner.jpg +0 -0
  120. data/app/assets/images/homepage/main_banner_mobile.jpg +0 -0
  121. data/app/assets/images/homepage/main_banner_tablet_landscape.jpg +0 -0
  122. data/app/assets/images/homepage/main_banner_tablet_portrait.jpg +0 -0
  123. data/app/assets/images/homepage/promo_banner_left.jpg +0 -0
  124. data/app/assets/images/homepage/promo_banner_left_mobile.jpg +0 -0
  125. data/app/assets/images/homepage/promo_banner_left_tablet_landscape.jpg +0 -0
  126. data/app/assets/images/homepage/promo_banner_left_tablet_portrait.jpg +0 -0
  127. data/app/assets/images/homepage/promo_banner_right.jpg +0 -0
  128. data/app/assets/images/homepage/promo_banner_right_mobile.jpg +0 -0
  129. data/app/assets/images/homepage/promo_banner_right_tablet_landscape.jpg +0 -0
  130. data/app/assets/images/homepage/promo_banner_right_tablet_portrait.jpg +0 -0
  131. data/app/assets/images/meganav/promo_banner_left-first-category.jpg +0 -0
  132. data/app/assets/images/meganav/promo_banner_left-second-category.jpg +0 -0
  133. data/app/assets/images/meganav/promo_banner_left-third-category.jpg +0 -0
  134. data/app/assets/images/meganav/promo_banner_right-first-category.jpg +0 -0
  135. data/app/assets/images/meganav/promo_banner_right-second-category.jpg +0 -0
  136. data/app/assets/images/meganav/promo_banner_right-third-category.jpg +0 -0
  137. data/app/assets/images/noimage/big_category_banner.jpg +0 -0
  138. data/app/assets/images/noimage/big_category_banner_mobile.jpg +0 -0
  139. data/app/assets/images/noimage/big_category_banner_tablet_landscape.jpg +0 -0
  140. data/app/assets/images/noimage/big_category_banner_tablet_portrait.jpg +0 -0
  141. data/app/assets/images/noimage/category_banner.jpg +0 -0
  142. data/app/assets/images/noimage/category_banner_mobile.jpg +0 -0
  143. data/app/assets/images/noimage/category_banner_plp.jpg +0 -0
  144. data/app/assets/images/noimage/category_banner_tablet_landscape.jpg +0 -0
  145. data/app/assets/images/noimage/category_banner_tablet_portrait.jpg +0 -0
  146. data/app/assets/images/noimage/main_banner.jpg +0 -0
  147. data/app/assets/images/noimage/main_banner_mobile.jpg +0 -0
  148. data/app/assets/images/noimage/main_banner_tablet_landscape.jpg +0 -0
  149. data/app/assets/images/noimage/main_banner_tablet_portrait.jpg +0 -0
  150. data/app/assets/images/noimage/product_photo.jpg +0 -0
  151. data/app/assets/images/noimage/promo_banner.jpg +0 -0
  152. data/app/assets/images/noimage/promo_banner_megamenu.jpg +0 -0
  153. data/app/assets/images/noimage/promo_banner_mobile.jpg +0 -0
  154. data/app/assets/images/noimage/promo_banner_tablet_landscape.jpg +0 -0
  155. data/app/assets/images/noimage/promo_banner_tablet_portrait.jpg +0 -0
  156. data/app/assets/images/spark-logo@3x.png +0 -0
  157. data/app/assets/javascripts/spree/frontend/locale.js +0 -13
  158. data/app/assets/javascripts/spree/frontend/multi_currency.js +0 -13
  159. data/lib/generators/spree/frontend/install/templates/config/initializers/spree_storefront.rb +0 -1
  160. data/lib/generators/spree/frontend/install/templates/config/spree_storefront.yml +0 -99
@@ -15,6 +15,22 @@
15
15
  <%= Spree.t('plp.default') %>
16
16
  </a>
17
17
  </li>
18
+ <li class="plp-overlay-ul-li <%= 'plp-overlay-ul-li--active' if params[:sort_by] == 'name-a-z' %>">
19
+ <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: 'name-a-z')) %>">
20
+ <div class="plp-empty-dot">
21
+ <div class="filled-dot"></div>
22
+ </div>
23
+ <%= Spree.t('plp.name_a_z') %>
24
+ </a>
25
+ </li>
26
+ <li class="plp-overlay-ul-li <%= 'plp-overlay-ul-li--active' if params[:sort_by] == 'name-z-a' %>">
27
+ <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: 'name-z-a')) %>">
28
+ <div class="plp-empty-dot">
29
+ <div class="filled-dot"></div>
30
+ </div>
31
+ <%= Spree.t('plp.name_z_a') %>
32
+ </a>
33
+ </li>
18
34
  <li class="plp-overlay-ul-li <%= 'plp-overlay-ul-li--active' if params[:sort_by] == 'newest-first' %>">
19
35
  <a class="p-3 d-block" href="<%= url_for(permitted_params.merge(sort_by: 'newest-first')) %>">
20
36
  <div class="plp-empty-dot">
@@ -1,4 +1,4 @@
1
- <% permitted_params = params.permit(*filtering_params) %>
1
+ <% permitted_params = permitted_products_params %>
2
2
  <% products_empty = @products.empty? %>
3
3
 
4
4
  <div data-hook="search_results">
@@ -1,5 +1,5 @@
1
- <% cache [common_product_cache_keys, products&.maximum(:updated_at)&.to_i, id, products&.ids&.join(',')] do %>
2
- <div id="<%= id %>-mobile" class="carousel slide d-md-none homepage-carousel" data-interval="false">
1
+ <% cache [common_product_cache_keys, products&.except(:group, :order)&.maximum(:updated_at)&.to_i, id, products&.ids&.join(',')] do %>
2
+ <div id="<%= id.parameterize %>-mobile" class="carousel slide d-md-none homepage-carousel" data-interval="false">
3
3
  <div class="carousel-inner">
4
4
  <% products.each_slice(2).with_index do |sliced_items, index| %>
5
5
  <div class="carousel-item <%= 'active' if index == 0 %>">
@@ -18,7 +18,7 @@
18
18
  </div>
19
19
  <a
20
20
  class="d-flex position-absolute justify-content-center align-items-center carousel-icon-control carousel-icon-control--previous"
21
- href="#<%= id %>-mobile"
21
+ href="#<%= id.parameterize %>-mobile"
22
22
  role="button"
23
23
  data-slide="prev">
24
24
  <span class="d-flex justify-content-center align-items-center carousel-icon-control-rounded" aria-hidden="true">
@@ -32,7 +32,7 @@
32
32
 
33
33
  <a
34
34
  class="d-flex position-absolute justify-content-center align-items-center carousel-icon-control carousel-icon-control--next"
35
- href="#<%= id %>-mobile"
35
+ href="#<%= id.parameterize %>-mobile"
36
36
  role="button"
37
37
  data-slide="next">
38
38
  <span class="d-flex justify-content-center align-items-center carousel-icon-control-rounded" aria-hidden="true">
@@ -45,14 +45,14 @@
45
45
  </a>
46
46
  </div>
47
47
 
48
- <div id="<%= id %>-desktop" class="carousel slide d-none d-md-block homepage-carousel" data-interval="false">
48
+ <div id="<%= id.parameterize %>-desktop" class="carousel slide d-none d-md-block homepage-carousel" data-interval="false">
49
49
  <div class="carousel-inner carousel-inner-width">
50
50
  <% products.each_slice(4).with_index do |sliced_items, index| %>
51
51
  <div class="carousel-item <%= 'active' if index == 0 %>">
52
52
  <div class="container position-relative">
53
53
  <a
54
54
  class="d-flex position-absolute justify-content-center align-items-center carousel-icon-control carousel-icon-control--previous"
55
- href="#<%= id %>-desktop"
55
+ href="#<%= id.parameterize %>-desktop"
56
56
  role="button"
57
57
  data-slide="prev">
58
58
  <span class="d-flex justify-content-center align-items-center carousel-icon-control-rounded" aria-hidden="true">
@@ -66,7 +66,7 @@
66
66
 
67
67
  <div class="row carousel-items-container">
68
68
  <% sliced_items.each do |item| %>
69
- <div class="col-3">
69
+ <div class="col-3 carouselItem">
70
70
  <%= render 'spree/shared/product', product: item, image_class: 'w-100' %>
71
71
  </div>
72
72
  <% end %>
@@ -74,7 +74,7 @@
74
74
 
75
75
  <a
76
76
  class="d-md-flex position-absolute justify-content-center align-items-center carousel-icon-control carousel-icon-control--next"
77
- href="#<%= id %>-desktop"
77
+ href="#<%= id.parameterize %>-desktop"
78
78
  role="button"
79
79
  data-slide="next">
80
80
  <span class="d-flex justify-content-center align-items-center carousel-icon-control-rounded" aria-hidden="true">
@@ -1,27 +1,28 @@
1
1
  <div id="spree-header">
2
2
  <header id="header" class="d-flex align-items-center header-spree border-bottom">
3
- <div class="container position-relative" role="navigation" aria-label="<%= Spree.t('checkout_page.main_navigation') %>">
4
- <div class="position-absolute checkout-header-link">
5
- <%= link_to spree.cart_path, class: "d-none d-sm-inline text-uppercase", method: :get do %>
6
- <%= icon(name: 'arrow-right',
7
- classes: 'spree-icon-arrow spree-icon-arrow-left',
8
- width: 7,
9
- height: 14) %>
10
- <span class="checkout-header-link-text"><%= Spree.t('checkout_page.back_to_cart') %></span>
11
- <% end %>
3
+ <div class="container" role="navigation" aria-label="<%= Spree.t('checkout_page.main_navigation') %>">
4
+ <div class="row">
5
+
6
+ <div class="col d-flex align-items-center truncate pr-0">
7
+ <%= link_to spree.cart_path, class: "text-uppercase truncate checkout-header-link-text", method: :get do %>
8
+ <%= icon(name: 'arrow-right',
9
+ classes: 'spree-icon-arrow spree-icon-arrow-left',
10
+ width: 14,
11
+ height: 14) %>
12
+ <%= Spree.t('checkout_page.back_to_cart') %>
13
+ <% end %>
14
+ </div>
15
+
16
+ <div class="col-auto d-flex align-items-center justify-content-end justify-content-md-center">
17
+ <figure class="logo header-spree-fluid-logo m-0 p-0">
18
+ <%= logo(nil, {method: :get}) %>
19
+ </figure>
20
+ </div>
21
+
22
+ <div class="col-0 col-md">
23
+ <!-- spacer -->
24
+ </div>
12
25
 
13
- <%= link_to spree.cart_path, class: "d-sm-none text-uppercase", method: :get do %>
14
- <%= icon(name: 'arrow-right',
15
- classes: 'spree-icon-arrow spree-icon-arrow-left',
16
- width: 7,
17
- height: 14) %>
18
- <span class="checkout-header-link-text"><%= Spree.t('back') %></span>
19
- <% end %>
20
- </div>
21
- <div class="d-flex flex-nowrap align-items-center justify-content-center">
22
- <figure class="logo flex-grow-0 flex-xl-grow-0 order-xl-0 header-spree-fluid-logo m-0">
23
- <%= logo(nil, {method: :get}) %>
24
- </figure>
25
26
  </div>
26
27
  </div>
27
28
  </header>
@@ -1,17 +1,8 @@
1
1
  <div class="border-top footer-spree-copyright">
2
2
  <div class="container">
3
3
  <div class="d-flex flex-column flex-lg-row align-items-center justify-content-center py-3 footer-spree-copyright-content">
4
- <div>Designed and developed by</div>
5
- <div class="mb-1 mb-lg-0">
6
- <%= link_to 'https://sparksolutions.co/', target: :blank, 'aria-label': 'Go to Spark Solutions', rel: :follow do %>
7
- <%= image_tag 'spark-logo@3x.png', class: 'footer-spree-copyright-logo-spark mx-2', alt: 'Spree Commerce & Ruby on Rails developers', title: 'Spree Commerce & Ruby on Rails developers' %>
8
- <% end %>
9
- </div>
10
- <div class="d-none d-lg-inline-block mr-2">|</div>
11
4
  <div>
12
- © <%= Time.current.year %>
13
- <%= link_to current_store.name, "https://#{current_store.url}" %>.
14
- <%= Spree.t(:all_rights_reserved) %>.
5
+ Designed and developed by <%= link_to 'Spark Solutions', 'https://sparksolutions.co/', target: :_blank, 'aria-label': 'Go to Spark Solutions', rel: :follow %> | © <%= Time.current.year %> <%= link_to current_store.name, current_store.formatted_url %>. <%= Spree.t(:all_rights_reserved) %>.
15
6
  </div>
16
7
  </div>
17
8
  </div>
@@ -1,5 +1,5 @@
1
- <% cache spree_nav_cache_key('footer') do %>
2
- <footer id="footer" class="pt-2 mx-auto border-top footer-spree" data-turbolinks-permanent>
1
+ <% cache spree_menu_cache_key('footer') do %>
2
+ <footer id="footer" class="pt-2 mx-auto border-top footer-spree">
3
3
  <div class="container">
4
4
  <div class="row d-xl-flex justify-content-xl-around pb-xl-5">
5
5
  <div class="d-flex d-xl-block flex-xl-grow-0 col-xl-4">
@@ -47,23 +47,29 @@
47
47
  </div>
48
48
  </div>
49
49
  </div>
50
- <div class="row d-none d-xl-flex border-top py-5 text-uppercase footer-spree-menu-links">
51
- <% if spree_navigation_data.any? %>
52
- <% spree_navigation_data.first(3).each do |root| %>
53
- <div class="col-3">
50
+ <div class="row d-none d-xl-flex border-top pt-5 text-uppercase footer-spree-menu-links">
51
+
52
+ <% if spree_menu('footer').present? %>
53
+ <% spree_menu('footer').children.each do |parent| %>
54
+ <div class="col-3 mb-5">
54
55
  <div class="footer-spree-label">
55
- <%= link_to root[:title], root[:url] %>
56
- </div>
57
- <% if root[:items].present? %>
58
- <% root[:items].each do |item| %>
59
- <div class="pt-2"><%= link_to item[:title], item[:url] %></div>
56
+ <% if parent.container? %>
57
+ <%= parent.name %>
58
+ <% else %>
59
+ <%= spree_nav_link_tag(parent) %>
60
60
  <% end %>
61
+ </div>
62
+ <% parent.children.each do |child| %>
63
+ <div class="pt-2">
64
+ <%= spree_nav_link_tag(child) %>
65
+ </div>
61
66
  <% end %>
62
67
  </div>
63
68
  <% end %>
64
69
  <% end %>
70
+
65
71
  <% if spree.respond_to?(:account_path) %>
66
- <div class="col-3">
72
+ <div class="col-3 mb-5">
67
73
  <div class="footer-spree-label">
68
74
  <%= Spree.t('nav_bar.my_account') %>
69
75
  </div>
@@ -0,0 +1,32 @@
1
+ <!-- Styles And Script In A View Partial
2
+ If this view partial is removed from the spree_application.html.erb layout file, the storefront
3
+ will instantly snap back to the original look and feel with no hangover CSS or JavaScript related
4
+ to this partial.
5
+
6
+ Please do not transfer styles and JavaScript found here
7
+ into the main stylesheets or JavaScript files.
8
+ -->
9
+ <style>
10
+ #getStartedBar {
11
+ background: #33ba6f;
12
+ color: white;
13
+ z-index: 10;
14
+ }
15
+
16
+ #getStartedBar svg {
17
+ vertical-align: text-top;
18
+ }
19
+ </style>
20
+
21
+ <div id="getStartedBar" class="d-flex justify-content-center align-items-center p-1">
22
+ <div class="row">
23
+ <div class="col-12 text-center">
24
+ <h5 class="m-0">
25
+ <span style="font-weight: 200;">Create your own Spree project</span> <a href="https://spreecommerce.org/contact/" class="btn btn-outline-light btn-sm m-2" style="font-size: 1em; font-weight:800;">Get Started
26
+ <%= icon(name: 'arrow-right-circle-fill',
27
+ width: 22,
28
+ height: 22) %></a>
29
+ </h5>
30
+ </div>
31
+ </div>
32
+ </div>
@@ -4,7 +4,7 @@
4
4
  <%== meta_data_tags %>
5
5
  <%== meta_robots %>
6
6
  <%= canonical_tag(current_store.url) %>
7
- <%= favicon_link_tag 'favicon.ico' %>
7
+ <%= favicon_link_tag(spree_favicon_path) %>
8
8
  <%= stylesheet_link_tag 'spree/frontend/all', media: 'screen', 'data-turbolinks-track': 'reload' %>
9
9
  <%= csrf_meta_tags %>
10
10
  <%= render 'spree/shared/paths' %>
@@ -1,9 +1,9 @@
1
1
  <%# leaving #spree-header div for legacy support %>
2
- <% cache spree_nav_cache_key('header') do %>
3
- <div id="spree-header" data-turbolinks-permanent>
2
+ <% cache spree_menu_cache_key('header') do %>
3
+ <div id="spree-header">
4
4
  <header id="header" class="d-flex align-items-center header-spree border-bottom">
5
5
  <div class="container-fluid h-100 header-spree-fluid">
6
- <div class="d-flex flex-nowrap align-items-center h-100">
6
+ <div class="d-flex flex-nowrap align-items-center h-100 px-2">
7
7
  <div class="d-xl-none flex-grow-1 header-spree-fluid-mobile-menu-toggler">
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',
@@ -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 %>