spree_frontend 4.1.0 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (314) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +120 -0
  3. data/.codeclimate.yml +36 -0
  4. data/.deepsource.toml +19 -0
  5. data/.editorconfig +22 -0
  6. data/.eslintignore +7 -0
  7. data/.eslintrc +36 -0
  8. data/.gem_release.yml +7 -0
  9. data/.github/CONTRIBUTING.md +1 -0
  10. data/.github/ISSUE_TEMPLATE/bug_report.md +47 -0
  11. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  12. data/.github/ISSUE_TEMPLATE.md +39 -0
  13. data/.github/dependabot.yml +32 -0
  14. data/.gitignore +58 -0
  15. data/.rubocop.yml +197 -0
  16. data/.solargraph.yml +20 -0
  17. data/.stylelintignore +4 -0
  18. data/.stylelintrc +6 -0
  19. data/CODE_OF_CONDUCT.md +22 -0
  20. data/Gemfile +57 -3
  21. data/LICENSE +1 -1
  22. data/README.md +89 -0
  23. data/Rakefile +1 -1
  24. data/SECURITY.md +1 -0
  25. data/app/assets/config/spree_frontend_manifest.js +5 -0
  26. data/app/assets/images/arrow-down.svg +12 -0
  27. data/app/assets/images/arrow-right-circle-fill.svg +3 -0
  28. data/app/assets/images/card-image.svg +4 -0
  29. data/app/assets/images/edit.svg +1 -1
  30. data/app/assets/images/favicon.ico +0 -0
  31. data/app/assets/images/file-image.svg +4 -0
  32. data/app/assets/images/global.svg +1 -0
  33. data/app/assets/images/image.svg +4 -0
  34. data/app/assets/images/info.svg +7 -0
  35. data/app/assets/images/logo/spree_50.png +0 -0
  36. data/app/assets/images/logo-spree.png +0 -0
  37. data/app/assets/images/logo.png +0 -0
  38. data/app/assets/images/logo.svg +10 -1
  39. data/app/assets/images/logo@2x.png +0 -0
  40. data/app/assets/images/logo@3x.png +0 -0
  41. data/app/assets/images/noimage/large.png +0 -0
  42. data/app/assets/images/noimage/mini.png +0 -0
  43. data/app/assets/images/noimage/plp.png +0 -0
  44. data/app/assets/images/noimage/plp.svg +16 -0
  45. data/app/assets/images/noimage/product.png +0 -0
  46. data/app/assets/images/noimage/small.png +0 -0
  47. data/app/assets/images/pagination-arrow-right.svg +3 -10
  48. data/app/assets/images/pagination-double-arrow-right.svg +6 -13
  49. data/app/assets/images/plus.svg +1 -1
  50. data/app/assets/images/search.svg +1 -1
  51. data/app/assets/javascripts/spree/frontend/account.js +1 -1
  52. data/app/assets/javascripts/spree/frontend/api/main.js +36 -0
  53. data/app/assets/javascripts/spree/frontend/api/storefront/cart.js +49 -0
  54. data/app/assets/javascripts/spree/frontend/cart.js +24 -2
  55. data/app/assets/javascripts/spree/frontend/checkout/address.js +78 -52
  56. data/app/assets/javascripts/spree/frontend/checkout/address_book.js +38 -40
  57. data/app/assets/javascripts/spree/frontend/checkout/payment.js +63 -23
  58. data/app/assets/javascripts/spree/frontend/checkout/shipment.js +15 -2
  59. data/app/assets/javascripts/spree/frontend/checkout.js +17 -1
  60. data/app/assets/javascripts/spree/frontend/coupon_manager.js +1 -1
  61. data/app/assets/javascripts/spree/frontend/currency.js +44 -0
  62. data/app/assets/javascripts/spree/frontend/locale.es6 +12 -0
  63. data/app/assets/javascripts/spree/frontend/login.js +5 -0
  64. data/app/assets/javascripts/spree/frontend/main.js +78 -0
  65. data/app/assets/javascripts/spree/frontend/main_nav_bar.js +86 -0
  66. data/app/assets/javascripts/spree/frontend/{turbolinks_scroll_fix.js → turbo_scroll_fix.js} +3 -3
  67. data/app/assets/javascripts/spree/frontend/views/spree/home/product_carousels.js +4 -4
  68. data/app/assets/javascripts/spree/frontend/views/spree/product/related.js +3 -3
  69. data/app/assets/javascripts/spree/frontend/views/spree/products/cart_form.js +67 -18
  70. data/app/assets/javascripts/spree/frontend/views/spree/products/description.js +1 -1
  71. data/app/assets/javascripts/spree/frontend/views/spree/products/index.js +76 -15
  72. data/app/assets/javascripts/spree/frontend/views/spree/products/price_filters.es6 +46 -0
  73. data/app/assets/javascripts/spree/frontend/views/spree/shared/mobile_navigation.js +9 -10
  74. data/app/assets/javascripts/spree/frontend/views/spree/shared/product_added_modal.js +7 -0
  75. data/app/assets/javascripts/spree/frontend/views/spree/shared/variant_select.js +93 -0
  76. data/app/assets/javascripts/spree/frontend.js +68 -11
  77. data/app/assets/stylesheets/spree/frontend/application.scss +5 -2
  78. data/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss +8 -0
  79. data/app/assets/stylesheets/spree/frontend/components-bootstrap/carousel.scss +4 -0
  80. data/app/assets/stylesheets/spree/frontend/components-custom/inputs.scss +80 -1
  81. data/app/assets/stylesheets/spree/frontend/flags/_flag-icon-base.scss +23 -0
  82. data/app/assets/stylesheets/spree/frontend/flags/_flag-icon-list.scss +265 -0
  83. data/app/assets/stylesheets/spree/frontend/flags/_variables.scss +2 -0
  84. data/app/assets/stylesheets/spree/frontend/flags/flag-icon.scss +3 -0
  85. data/app/assets/stylesheets/spree/frontend/functions.scss +1 -0
  86. data/app/assets/stylesheets/spree/frontend/helpers/spree/frontend_helper.scss +48 -0
  87. data/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss +2 -2
  88. data/app/assets/stylesheets/spree/frontend/variables/helper-variables.scss +1 -0
  89. data/app/assets/stylesheets/spree/frontend/variables/variables.scss +54 -0
  90. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +27 -26
  91. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/delivery.scss +6 -0
  92. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +24 -10
  93. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/_index.scss +1 -0
  94. data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/product_buy_bar.scss +20 -0
  95. data/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss +54 -67
  96. data/app/assets/stylesheets/spree/frontend/views/spree/orders/edit.scss +4 -3
  97. data/app/assets/stylesheets/spree/frontend/views/spree/orders/show.scss +3 -0
  98. data/app/assets/stylesheets/spree/frontend/views/spree/products/cart_form.scss +8 -0
  99. data/app/assets/stylesheets/spree/frontend/views/spree/products/gallery_modal.scss +7 -0
  100. data/app/assets/stylesheets/spree/frontend/views/spree/products/index.scss +55 -26
  101. data/app/assets/stylesheets/spree/frontend/views/spree/products/show.scss +7 -0
  102. data/app/assets/stylesheets/spree/frontend/views/spree/shared/_color_select.scss +10 -9
  103. data/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/single.scss +1 -1
  104. data/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/thumbnails.scss +1 -0
  105. data/app/assets/stylesheets/spree/frontend/views/spree/shared/cart.scss +9 -4
  106. data/app/assets/stylesheets/spree/frontend/views/spree/shared/category_nav_bar.scss +3 -3
  107. data/app/assets/stylesheets/spree/frontend/views/spree/shared/change_store.scss +7 -0
  108. data/app/assets/stylesheets/spree/frontend/views/spree/shared/footer.scss +4 -0
  109. data/app/assets/stylesheets/spree/frontend/views/spree/shared/main_nav_bar.scss +42 -26
  110. data/app/assets/stylesheets/spree/frontend/views/spree/shared/mobile_navigation.scss +34 -3
  111. data/app/assets/stylesheets/spree/frontend/views/spree/shared/nav_bar.scss +24 -7
  112. data/app/assets/stylesheets/spree/frontend/views/spree/shared/quantity_select.scss +9 -12
  113. data/app/assets/stylesheets/spree/frontend/views/spree/shared/search_form.scss +12 -0
  114. data/app/assets/stylesheets/spree/frontend/views/spree/users/show.scss +7 -13
  115. data/app/assets/stylesheets/spree/frontend.css +0 -1
  116. data/app/controllers/concerns/spree/checkout/address_book.rb +9 -7
  117. data/app/controllers/concerns/spree/locale_urls.rb +21 -0
  118. data/app/controllers/spree/addresses_controller.rb +16 -33
  119. data/app/controllers/spree/checkout_controller.rb +15 -13
  120. data/app/controllers/spree/cms_pages_controller.rb +29 -0
  121. data/app/controllers/spree/content_controller.rb +0 -2
  122. data/app/controllers/spree/currency_controller.rb +17 -0
  123. data/app/controllers/spree/errors_controller.rb +11 -0
  124. data/app/controllers/spree/home_controller.rb +38 -1
  125. data/app/controllers/spree/locale_controller.rb +35 -6
  126. data/app/controllers/spree/orders_controller.rb +12 -10
  127. data/app/controllers/spree/products_controller.rb +46 -28
  128. data/app/controllers/spree/store_controller.rb +77 -12
  129. data/app/controllers/spree/taxons_controller.rb +16 -8
  130. data/app/helpers/spree/addresses_helper.rb +64 -12
  131. data/app/helpers/spree/cache_helper.rb +7 -0
  132. data/app/helpers/spree/cms_pages_helper.rb +23 -0
  133. data/app/helpers/spree/frontend_helper.rb +170 -18
  134. data/app/helpers/spree/navigation_helper.rb +81 -4
  135. data/app/helpers/spree/products_filters_helper.rb +168 -0
  136. data/app/helpers/spree/store_helper.rb +41 -0
  137. data/app/helpers/spree/structured_data_helper.rb +6 -2
  138. data/app/helpers/spree/taxons_helper.rb +2 -2
  139. data/app/services/spree/build_localized_redirect_url.rb +141 -0
  140. data/app/views/kaminari/twitter-bootstrap-4/_first_page.html.erb +3 -3
  141. data/app/views/kaminari/twitter-bootstrap-4/_gap.html.erb +2 -2
  142. data/app/views/kaminari/twitter-bootstrap-4/_last_page.html.erb +3 -3
  143. data/app/views/kaminari/twitter-bootstrap-4/_next_page.html.erb +3 -3
  144. data/app/views/kaminari/twitter-bootstrap-4/_page.html.erb +2 -2
  145. data/app/views/kaminari/twitter-bootstrap-4/_paginator.html.erb +2 -2
  146. data/app/views/kaminari/twitter-bootstrap-4/_prev_page.html.erb +3 -3
  147. data/app/views/spree/address/_form.html.erb +26 -27
  148. data/app/views/spree/addresses/_form.html.erb +15 -6
  149. data/app/views/spree/addresses/edit.html.erb +13 -8
  150. data/app/views/spree/addresses/new.html.erb +8 -4
  151. data/app/views/spree/checkout/_address.html.erb +19 -23
  152. data/app/views/spree/checkout/_confirm.html.erb +1 -75
  153. data/app/views/spree/checkout/_credit_card.html.erb +3 -2
  154. data/app/views/spree/checkout/_delivery.html.erb +11 -4
  155. data/app/views/spree/checkout/_delivery_informations.html.erb +51 -0
  156. data/app/views/spree/checkout/_payment.html.erb +5 -24
  157. data/app/views/spree/checkout/_payment_sources.html.erb +17 -0
  158. data/app/views/spree/checkout/_summary.html.erb +22 -19
  159. data/app/views/spree/checkout/edit.html.erb +22 -2
  160. data/app/views/spree/checkout/payment/_gateway.html.erb +2 -2
  161. data/app/views/spree/checkout/registration.html.erb +3 -3
  162. data/app/views/spree/cms_pages/show.html.erb +16 -0
  163. data/app/views/spree/errors/not_found.html.erb +2 -2
  164. data/app/views/spree/home/index.html.erb +17 -123
  165. data/app/views/spree/layouts/checkout.html.erb +3 -1
  166. data/app/views/spree/layouts/spree_application.html.erb +3 -2
  167. data/app/views/spree/locale/index.html.erb +1 -0
  168. data/app/views/spree/orders/_coupon_code.html.erb +3 -4
  169. data/app/views/spree/orders/_line_item.html.erb +4 -4
  170. data/app/views/spree/orders/_line_item_data.html.erb +3 -3
  171. data/app/views/spree/orders/edit.html.erb +2 -3
  172. data/app/views/spree/orders/show.html.erb +2 -72
  173. data/app/views/spree/products/_cart_form.html.erb +5 -2
  174. data/app/views/spree/products/_color_option_type.html.erb +14 -14
  175. data/app/views/spree/products/_description.html.erb +19 -14
  176. data/app/views/spree/products/_filters_desktop.html.erb +80 -40
  177. data/app/views/spree/products/_filters_mobile.html.erb +47 -15
  178. data/app/views/spree/products/_gallery.html.erb +4 -6
  179. data/app/views/spree/products/_gallery_modal.html.erb +4 -6
  180. data/app/views/spree/products/_option_type.html.erb +1 -3
  181. data/app/views/spree/products/_product.html.erb +1 -1
  182. data/app/views/spree/products/_properties.html.erb +6 -4
  183. data/app/views/spree/products/_sort_desktop.html.erb +20 -14
  184. data/app/views/spree/products/_sort_mobile.html.erb +24 -8
  185. data/app/views/spree/products/_thumbnails.html.erb +2 -2
  186. data/app/views/spree/products/index.html.erb +7 -4
  187. data/app/views/spree/products/related.html.erb +11 -5
  188. data/app/views/spree/products/show.html.erb +2 -3
  189. data/app/views/spree/shared/_breadcrumbs.html.erb +2 -2
  190. data/app/views/spree/shared/_carousel_4_products.html.erb +14 -20
  191. data/app/views/spree/shared/_cart.html.erb +1 -1
  192. data/app/views/spree/shared/_checkout_header.html.erb +22 -21
  193. data/app/views/spree/shared/_color_select.html.erb +3 -3
  194. data/app/views/spree/shared/_copyright.html.erb +1 -10
  195. data/app/views/spree/shared/_currency_dropdown.html.erb +13 -0
  196. data/app/views/spree/shared/_delete_address_popup.html.erb +1 -2
  197. data/app/views/spree/shared/_error_messages.html.erb +2 -2
  198. data/app/views/spree/shared/_footer.html.erb +31 -21
  199. data/app/views/spree/shared/_get_started.html.erb +32 -0
  200. data/app/views/spree/shared/_head.html.erb +8 -5
  201. data/app/views/spree/shared/_header.html.erb +4 -4
  202. data/app/views/spree/shared/_internationalization_options.html.erb +31 -0
  203. data/app/views/spree/shared/_line_item.html.erb +3 -3
  204. data/app/views/spree/shared/_link_to_account.html.erb +7 -4
  205. data/app/views/spree/shared/_link_to_cart.html.erb +1 -2
  206. data/app/views/spree/shared/_locale_and_currency.html.erb +6 -0
  207. data/app/views/spree/shared/_locale_dropdown.html.erb +13 -0
  208. data/app/views/spree/shared/_login.html.erb +5 -5
  209. data/app/views/spree/shared/_main_nav_bar.html.erb +69 -45
  210. data/app/views/spree/shared/_mobile_internationalization_options.html.erb +37 -0
  211. data/app/views/spree/shared/_mobile_navigation.html.erb +48 -63
  212. data/app/views/spree/shared/_nav_bar.html.erb +9 -19
  213. data/app/views/spree/shared/_no_product_available.html.erb +1 -1
  214. data/app/views/spree/shared/_option_values.html.erb +2 -21
  215. data/app/views/spree/shared/_order_details.html.erb +117 -174
  216. data/app/views/spree/shared/_paths.html.erb +8 -0
  217. data/app/views/spree/shared/_payment.html.erb +2 -2
  218. data/app/views/spree/shared/_payment_sources.html.erb +2 -2
  219. data/app/views/spree/shared/_product_added_modal.html.erb +3 -3
  220. data/app/views/spree/shared/_properties.html.erb +4 -0
  221. data/app/views/spree/shared/_quantity_select.html.erb +2 -2
  222. data/app/views/spree/shared/_search.html.erb +9 -13
  223. data/app/views/spree/shared/_translations.html.erb +8 -7
  224. data/app/views/spree/shared/carousel/_single.html.erb +9 -14
  225. data/app/views/spree/shared/carousel/_thumbnails.html.erb +35 -39
  226. data/app/views/spree/shared/cms/pages/_edit_mode.html.erb +13 -0
  227. data/app/views/spree/shared/cms/sections/_featured_article.html.erb +27 -0
  228. data/app/views/spree/shared/cms/sections/_hero_image.html.erb +60 -0
  229. data/app/views/spree/shared/cms/sections/_image_gallery.html.erb +171 -0
  230. data/app/views/spree/shared/cms/sections/_product_carousel.html.erb +5 -0
  231. data/app/views/spree/shared/cms/sections/_rich_text_content.html.erb +3 -0
  232. data/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb +118 -0
  233. data/app/views/spree/taxons/_header.html.erb +7 -2
  234. data/app/views/spree/users/_address.html.erb +16 -24
  235. data/app/views/spree/users/_address_controls.html.erb +10 -0
  236. data/app/views/spree/users/show.html.erb +21 -16
  237. data/config/initializers/admin_actions.rb +18 -0
  238. data/config/initializers/assets.rb +4 -13
  239. data/config/initializers/canonical_rails.rb +1 -1
  240. data/config/routes.rb +30 -26
  241. data/lib/generators/spree/frontend/copy_storefront/copy_storefront_generator.rb +1 -7
  242. data/lib/generators/spree/frontend/install/install_generator.rb +34 -0
  243. data/lib/generators/spree/frontend/install/templates/app/assets/config/manifest.js +2 -0
  244. data/lib/generators/spree/frontend/install/templates/vendor/assets/javascripts/spree/frontend/all.js +8 -0
  245. data/lib/generators/spree/frontend/install/templates/vendor/assets/stylesheets/spree/frontend/all.css +9 -0
  246. data/lib/spree/frontend/configuration.rb +18 -0
  247. data/lib/spree/frontend/engine.rb +3 -1
  248. data/lib/spree/frontend/version.rb +9 -0
  249. data/lib/spree/frontend.rb +8 -4
  250. data/license.md +13 -0
  251. data/spec/fixtures/files/store_favicon.ico +0 -0
  252. data/spree_frontend.gemspec +26 -14
  253. data/vendor/assets/javascripts/cleave.js +8 -0
  254. data/vendor/assets/javascripts/fetch.umd.js +531 -0
  255. data/vendor/assets/javascripts/jquery.payment.js +652 -0
  256. data/vendor/assets/javascripts/jsuri.js +458 -0
  257. data/vendor/assets/javascripts/polyfill.min.js +1 -0
  258. metadata +224 -86
  259. data/app/assets/images/homepage/big_category_banner.jpg +0 -0
  260. data/app/assets/images/homepage/big_category_banner_mobile.jpg +0 -0
  261. data/app/assets/images/homepage/big_category_banner_tablet_landscape.jpg +0 -0
  262. data/app/assets/images/homepage/big_category_banner_tablet_portrait.jpg +0 -0
  263. data/app/assets/images/homepage/category_banner_lower.jpg +0 -0
  264. data/app/assets/images/homepage/category_banner_lower_mobile.jpg +0 -0
  265. data/app/assets/images/homepage/category_banner_lower_tablet_landscape.jpg +0 -0
  266. data/app/assets/images/homepage/category_banner_lower_tablet_portrait.jpg +0 -0
  267. data/app/assets/images/homepage/category_banner_upper.jpg +0 -0
  268. data/app/assets/images/homepage/category_banner_upper_mobile.jpg +0 -0
  269. data/app/assets/images/homepage/category_banner_upper_tablet_landscape.jpg +0 -0
  270. data/app/assets/images/homepage/category_banner_upper_tablet_portrait.jpg +0 -0
  271. data/app/assets/images/homepage/main_banner.jpg +0 -0
  272. data/app/assets/images/homepage/main_banner_mobile.jpg +0 -0
  273. data/app/assets/images/homepage/main_banner_tablet_landscape.jpg +0 -0
  274. data/app/assets/images/homepage/main_banner_tablet_portrait.jpg +0 -0
  275. data/app/assets/images/homepage/promo_banner_left.jpg +0 -0
  276. data/app/assets/images/homepage/promo_banner_left_mobile.jpg +0 -0
  277. data/app/assets/images/homepage/promo_banner_left_tablet_landscape.jpg +0 -0
  278. data/app/assets/images/homepage/promo_banner_left_tablet_portrait.jpg +0 -0
  279. data/app/assets/images/homepage/promo_banner_right.jpg +0 -0
  280. data/app/assets/images/homepage/promo_banner_right_mobile.jpg +0 -0
  281. data/app/assets/images/homepage/promo_banner_right_tablet_landscape.jpg +0 -0
  282. data/app/assets/images/homepage/promo_banner_right_tablet_portrait.jpg +0 -0
  283. data/app/assets/images/meganav/promo_banner_left-first-category.jpg +0 -0
  284. data/app/assets/images/meganav/promo_banner_left-second-category.jpg +0 -0
  285. data/app/assets/images/meganav/promo_banner_left-third-category.jpg +0 -0
  286. data/app/assets/images/meganav/promo_banner_right-first-category.jpg +0 -0
  287. data/app/assets/images/meganav/promo_banner_right-second-category.jpg +0 -0
  288. data/app/assets/images/meganav/promo_banner_right-third-category.jpg +0 -0
  289. data/app/assets/images/noimage/big_category_banner.jpg +0 -0
  290. data/app/assets/images/noimage/big_category_banner_mobile.jpg +0 -0
  291. data/app/assets/images/noimage/big_category_banner_tablet_landscape.jpg +0 -0
  292. data/app/assets/images/noimage/big_category_banner_tablet_portrait.jpg +0 -0
  293. data/app/assets/images/noimage/category_banner.jpg +0 -0
  294. data/app/assets/images/noimage/category_banner_mobile.jpg +0 -0
  295. data/app/assets/images/noimage/category_banner_plp.jpg +0 -0
  296. data/app/assets/images/noimage/category_banner_tablet_landscape.jpg +0 -0
  297. data/app/assets/images/noimage/category_banner_tablet_portrait.jpg +0 -0
  298. data/app/assets/images/noimage/main_banner.jpg +0 -0
  299. data/app/assets/images/noimage/main_banner_mobile.jpg +0 -0
  300. data/app/assets/images/noimage/main_banner_tablet_landscape.jpg +0 -0
  301. data/app/assets/images/noimage/main_banner_tablet_portrait.jpg +0 -0
  302. data/app/assets/images/noimage/product_photo.jpg +0 -0
  303. data/app/assets/images/noimage/promo_banner.jpg +0 -0
  304. data/app/assets/images/noimage/promo_banner_megamenu.jpg +0 -0
  305. data/app/assets/images/noimage/promo_banner_mobile.jpg +0 -0
  306. data/app/assets/images/noimage/promo_banner_tablet_landscape.jpg +0 -0
  307. data/app/assets/images/noimage/promo_banner_tablet_portrait.jpg +0 -0
  308. data/app/assets/images/spark-logo@3x.png +0 -0
  309. data/app/assets/stylesheets/spree/frontend/_glyphicons_urls_fix.scss +0 -10
  310. data/app/assets/stylesheets/spree/frontend/address_book.scss +0 -8
  311. data/app/models/spree/frontend_configuration.rb +0 -7
  312. data/app/views/spree/shared/_taxonomies.html.erb +0 -16
  313. /data/app/views/spree/{shared → errors}/forbidden.html.erb +0 -0
  314. /data/app/views/spree/{shared → errors}/unauthorized.html.erb +0 -0
@@ -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), spree.product_path(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, spree.product_path(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.presentation}" %>
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.uneditable? %>
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>
@@ -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.respond_to?(:admin_path) ? Spree.admin_path.gsub(/\A(\/)?(.*[^\/])(\/)?\z/, '\\2/') : '/admin'
6
+ }.to_json
7
+ %>
8
+ </script>
@@ -6,7 +6,7 @@
6
6
  <%= Spree.t(:ending_in) %> <%= source.last_digits %>
7
7
  <% end %>
8
8
  </span>
9
- <br />
9
+ <br>
10
10
  <span class="full-name"><%= source.name %></span>
11
11
  <% else %>
12
12
  <%= content_tag(:span, payment.payment_method.name) %>
@@ -14,4 +14,4 @@
14
14
 
15
15
  <span class="payment-amount">(<%= payment.display_amount %>)</span>
16
16
 
17
- <br />
17
+ <br>
@@ -1,8 +1,8 @@
1
1
  <td>
2
2
  <% payment_sources.each do |payment_source| %>
3
3
  <%= payment_source.class.to_s.underscore.split('/').second.humanize.titleize %>
4
- <br/>
4
+ <br>
5
5
  <%= payment_source.last_digits.rjust(16, '*') %>
6
- <br/>
6
+ <br>
7
7
  <% end %>
8
8
  </td>
@@ -1,5 +1,5 @@
1
1
  <div class="modal product-added-modal" tabindex="-1" role="dialog" aria-hidden="true">
2
- <div class="modal-dialog modal-lg" role="document" >
2
+ <div class="modal-dialog modal-lg" role="document">
3
3
  <div class="modal-content">
4
4
  <div class="modal-header pb-0 px-4 pt-4 border-0">
5
5
  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
@@ -34,7 +34,7 @@
34
34
  </div>
35
35
  <div class="row pt-5 justify-content-center align-items-center product-added-modal-product">
36
36
  <div class="col-4 col-sm-2 product-added-modal-product-image-container">
37
- <img class="product-added-modal-product-image-container-image" src="data:," alt="<%= @product.name %>">
37
+ <img class="product-added-modal-product-image-container-image" src="data:," alt="<%= @product&.name %>">
38
38
  </div>
39
39
  <div class="col-8 col-sm-6 col-lg-4 py-1 product-added-modal-product-details">
40
40
  <div class="product-added-modal-product-details-name"></div>
@@ -48,7 +48,7 @@
48
48
  <div class="row pb-4 justify-content-center">
49
49
  <div class="col-12 col-lg-8">
50
50
  <%= link_to spree.checkout_path, class: 'btn btn-primary w-100 font-weight-bold text-uppercase product-added-modal-button', method: :get do %>
51
- <%= Spree.t('pdp.checkout') %>
51
+ <%= Spree.t(:checkout) %>
52
52
  <% end %>
53
53
  </div>
54
54
  </div>
@@ -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 %>
@@ -1,6 +1,6 @@
1
1
  <%# TODO: Use in cart %>
2
- <div class="d-flex quantity-select mx-auto mx-md-0">
2
+ <div class="d-inline-flex quantity-select">
3
3
  <%= button_tag '-', type: 'button', class: "border-right-0 flex-grow-0 flex-shrink-0 py-0 px-3 quantity-select-decrease" %>
4
- <%= number_field_tag input_name, 1, min: 1, class: "p-0 flex-grow-1 flex-shrink-1 text-center form-control border-left-0 border-right-0 quantity-select-value", 'aria-label': Spree.t('pdp.quantity') %>
4
+ <%= number_field_tag input_name, 1, min: 1, max: maximum_quantity, class: "p-0 flex-grow-1 flex-shrink-1 text-center form-control border-left-0 border-right-0 quantity-select-value", 'aria-label': Spree.t('pdp.quantity') %>
5
5
  <%= button_tag '+', type: 'button', class: "border-left-0 flex-grow-0 flex-shrink-0 py-0 px-3 quantity-select-increase" %>
6
6
  </div>
@@ -1,19 +1,15 @@
1
- <%= form_tag spree.products_path, method: :get, class: "py-md-1 d-flex align-items-center" do %>
1
+ <%= form_tag spree.products_path, method: :get, class: "py-md-1 d-flex align-items-center search-form" do %>
2
2
  <%= search_field_tag :keywords,
3
3
  params[:keywords],
4
4
  placeholder: Spree.t(:search),
5
+ title: Spree.t(:search),
5
6
  autofocus: true,
6
- class: " border-0 p-3"
7
- %>
8
- <label class="m-0">
9
- <input type="submit">
7
+ 'aria-label': Spree.t(:search),
8
+ class: " border-0 p-3" %>
9
+ <button type="submit" class="btn border-0 p-0" aria-label="Submit">
10
10
  <%= icon(name: 'search',
11
- classes: 'd-md-none',
12
- width: 20,
13
- height: 20) %>
14
- <%= icon(name: 'search',
15
- classes: 'd-none d-md-inline',
16
- width: 27,
17
- height: 27) %>
18
- </label>
11
+ classes: 'd-inline',
12
+ width: 27,
13
+ height: 27) %>
14
+ </button>
19
15
  <% end %>
@@ -1,11 +1,12 @@
1
1
  <script>
2
- window.addEventListener('turbolinks:load', function() {
2
+ window.addEventListener('turbo:load', function() {
3
3
  Spree.translations = <%==
4
- {
5
- coupon_code_applied: Spree.t(:coupon_code_applied),
6
- coupon_code_removed: Spree.t(:coupon_code_removed),
7
- coupon_code_error_icon: image_path('error.svg')
8
- }.to_json
9
- %>
4
+ {
5
+ coupon_code_applied: Spree.t(:coupon_code_applied),
6
+ coupon_code_removed: Spree.t(:coupon_code_removed),
7
+ coupon_code_error_icon: image_path('error.svg'),
8
+ credit_card_remove_confirmation: Spree.t(:credit_card_remove_confirmation)
9
+ }.to_json
10
+ %>
10
11
  });
11
12
  </script>
@@ -4,15 +4,13 @@
4
4
  data-product-carousel-group-identifier="<%= group_id %>"
5
5
  data-variant-change-trigger-identifier="<%= trigger_id %>"
6
6
  data-interval="false"
7
- data-hook
8
- >
7
+ data-hook>
9
8
  <% if images.length > 1 %>
10
9
  <a
11
10
  class="d-none d-md-flex h-100 justify-content-center align-items-center product-carousel-control position-absolute product-carousel-control--previous"
12
11
  href="#<%= id %>"
13
12
  role="button"
14
- data-slide="prev"
15
- >
13
+ data-slide="prev">
16
14
  <span class="d-flex justify-content-center align-items-center product-carousel-control-rounded" aria-hidden="true">
17
15
  <%= icon(name: 'arrow-right',
18
16
  classes: 'spree-icon-arrow spree-icon-arrow-left',
@@ -26,8 +24,7 @@
26
24
  class="d-none d-md-flex h-100 justify-content-center align-items-center product-carousel-control position-absolute product-carousel-control--next"
27
25
  href="#<%= id %>"
28
26
  role="button"
29
- data-slide="next"
30
- >
27
+ data-slide="next">
31
28
  <span class="d-flex justify-content-center align-items-center product-carousel-control-rounded" aria-hidden="true">
32
29
  <%= icon(name: 'arrow-right',
33
30
  classes: 'spree-icon-arrow spree-icon-arrow-right',
@@ -46,18 +43,17 @@
46
43
  <% images.each_with_index do |image, imageIndex| %>
47
44
  <div
48
45
  class="carousel-item product-carousel-item<%= ' active' if imageIndex == 0 %>"
49
- data-variant-is-master="<%= image.viewable_id == @product.master_id %>"
50
- data-variant-id="<%= image.viewable_id %>"
51
- >
46
+ data-variant-is-master="<%= image.viewable_id == @product.master.id %>"
47
+ data-variant-id="<%= image.viewable_id %>">
52
48
  <div class="product-carousel-item-squared <%= 'product-carousel-item-squared-only' if images.length == 1 %>">
53
49
  <% image_attrs = {
54
- src: main_app.url_for(image.url(zoomed ? :zoomed : :large)),
50
+ src: main_app.cdn_image_url(image.url(zoomed ? :zoomed : :large)),
55
51
  alt: image.alt || @product.name,
56
52
  class: "d-block w-100",
57
53
  width: zoomed ? 650 : 475,
58
54
  height: zoomed ? 870 : 594
59
55
  } %>
60
- <%= imageIndex.zero? ? image_tag(image_attrs.delete(:src), image_attrs) : lazy_image(image_attrs) %>
56
+ <%= imageIndex.zero? ? image_tag(image_attrs.delete(:src), image_attrs) : lazy_image(**image_attrs) %>
61
57
  </div>
62
58
  </div>
63
59
  <% end %>
@@ -68,10 +64,9 @@
68
64
  <li
69
65
  data-target="#<%= id %>"
70
66
  data-slide-to="<%= imageIndex %>"
71
- class="product-carousel-indicators-indicator product-carousel-indicators-indicator--visible<%= ' active' if imageIndex == 0 %>"
72
- >
67
+ class="product-carousel-indicators-indicator product-carousel-indicators-indicator--visible<%= ' active' if imageIndex == 0 %>">
73
68
  <%= lazy_image(
74
- src: main_app.url_for(image.url(:pdp_thumbnail)),
69
+ src: main_app.cdn_image_url(image.url(:pdp_thumbnail)),
75
70
  class: 'd-block w-100',
76
71
  alt: image.alt || @product.name,
77
72
  width: image.style(:pdp_thumbnail)[:width],
@@ -6,29 +6,25 @@
6
6
  data-product-carousel-per-page="<%= per_page %>"
7
7
  data-product-carousel-is-slave="true"
8
8
  data-interval="false"
9
- data-hook
10
- >
9
+ data-hook>
11
10
  <div class="carousel-inner order-1 h-100">
12
11
  <% images.each_with_index do |image, image_index| %>
13
12
  <% if image_index % per_page == 0 %>
14
- <div class="carousel-item product-thumbnails-carousel-item<%= ' active' if image_index == 0 %>">
13
+ <div class="carousel-item product-thumbnails-carousel-item h-100<%= ' active' if image_index == 0 %>">
15
14
  <div class="h-100 d-flex flex-column justify-content-center">
16
- <div class="product-thumbnails-carousel-item-content py-1">
15
+ <div class="product-thumbnails-carousel-item-content py-1 h-100">
17
16
  <% end %>
18
17
  <div
19
18
  class="product-thumbnails-carousel-item-single product-thumbnails-carousel-item-single--visible"
20
19
  data-product-carousel-to-slide="<%= image_index %>"
21
- data-variant-is-master="<%= image.viewable_id == @product.master_id %>"
22
- data-variant-id="<%= image.viewable_id %>"
23
- >
20
+ data-variant-is-master="<%= image.viewable_id == @product.master.id %>"
21
+ data-variant-id="<%= image.viewable_id %>">
24
22
  <%= lazy_image(
25
- src: main_app.url_for(image.url(:pdp_thumbnail)),
23
+ src: main_app.cdn_image_url(image.url(:pdp_thumbnail)),
26
24
  class: 'd-block w-100',
27
25
  alt: image.alt || @product.name,
28
26
  width: 57,
29
- height: 70
30
- )
31
- %>
27
+ height: 70) %>
32
28
  </div>
33
29
  <% if (image_index + 1) % per_page == 0 || (image_index + 1) == images.length %>
34
30
  </div>
@@ -37,32 +33,32 @@
37
33
  <% end %>
38
34
  <% end %>
39
35
  </div>
40
- <a
41
- class="d-none d-sm-flex order-0 justify-content-center w-100 product-thumbnails-carousel-previous"
42
- href="#<%= id %>"
43
- role="button"
44
- data-slide="prev"
45
- >
46
- <span aria-hidden="true">
47
- <%= icon(name: 'arrow-right',
48
- classes: 'spree-icon-arrow spree-icon-arrow-up',
49
- width: 16,
50
- height: 16) %>
51
- </span>
52
- <span class="sr-only"><%= Spree.t(:previous) %></span>
53
- </a>
54
- <a
55
- class="d-none d-sm-flex order-2 justify-content-center w-100 product-thumbnails-carousel-next"
56
- href="#<%= id %>"
57
- role="button"
58
- data-slide="next"
59
- >
60
- <span aria-hidden="true">
61
- <%= icon(name: 'arrow-right',
62
- classes: 'spree-icon-arrow spree-icon-arrow-down',
63
- width: 16,
64
- height: 16) %>
65
- </span>
66
- <span class="sr-only"><%= Spree.t(:next) %></span>
67
- </a>
36
+ <% if images.length > per_page %>
37
+ <a
38
+ class="d-none d-sm-flex order-0 justify-content-center w-100 product-thumbnails-carousel-previous"
39
+ href="#<%= id %>"
40
+ role="button"
41
+ data-slide="prev">
42
+ <span aria-hidden="true">
43
+ <%= icon(name: 'arrow-right',
44
+ classes: 'spree-icon-arrow spree-icon-arrow-up',
45
+ width: 16,
46
+ height: 16) %>
47
+ </span>
48
+ <span class="sr-only"><%= Spree.t(:previous) %></span>
49
+ </a>
50
+ <a
51
+ class="d-none d-sm-flex order-2 justify-content-center w-100 product-thumbnails-carousel-next"
52
+ href="#<%= id %>"
53
+ role="button"
54
+ data-slide="next">
55
+ <span aria-hidden="true">
56
+ <%= icon(name: 'arrow-right',
57
+ classes: 'spree-icon-arrow spree-icon-arrow-down',
58
+ width: 16,
59
+ height: 16) %>
60
+ </span>
61
+ <span class="sr-only"><%= Spree.t(:next) %></span>
62
+ </a>
63
+ <% end %>
68
64
  </div>
@@ -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>