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,54 +1,54 @@
1
1
  <% address_id = address_type.chars.first %>
2
2
 
3
- <div class="inner" data-hook=<%="#{address_type}_inner" %>>
4
- <p class="form-group" id=<%="#{address_id}firstname" %>>
3
+ <div class="inner" data-hook='<%= "#{address_type}_inner" %>'>
4
+ <div class="form-group" id='<%= "#{address_id}firstname" %>'>
5
5
  <%= form.label :firstname do %>
6
6
  <%= Spree.t(:first_name) %><abbr class="required" title="required">*</abbr>
7
7
  <% end %>
8
8
  <%= form.text_field :firstname, class: 'form-control', required: true %>
9
- </p>
10
- <p class="form-group" id=<%="#{address_id}lastname" %>>
9
+ </div>
10
+ <div class="form-group" id='<%= "#{address_id}lastname" %>'>
11
11
  <%= form.label :lastname do %>
12
12
  <%= Spree.t(:last_name) %><abbr class="required" title="required">*</abbr>
13
13
  <% end %>
14
14
  <%= form.text_field :lastname, class: 'form-control', required: true %>
15
- </p>
15
+ </div>
16
16
  <% if Spree::Config[:company] %>
17
- <p class="form-group" id=<%="#{address_id}company" %>>
17
+ <div class="form-group" id='<%= "#{address_id}company" %>'>
18
18
  <%= form.label :company, Spree.t(:company) %>
19
19
  <%= form.text_field :company, class: 'form-control' %>
20
- </p>
20
+ </div>
21
21
  <% end %>
22
- <p class="form-group" id=<%="#{address_id}address1" %>>
22
+ <div class="form-group" id='<%= "#{address_id}address1" %>'>
23
23
  <%= form.label :address1 do %>
24
24
  <%= Spree.t(:street_address) %><abbr class="required" title="required">*</abbr>
25
25
  <% end %>
26
26
  <%= form.text_field :address1, class: 'form-control required' %>
27
- </p>
28
- <p class="form-group" id=<%="#{address_id}address2" %>>
27
+ </div>
28
+ <div class="form-group" id='<%= "#{address_id}address2" %>'>
29
29
  <%= form.label :address2, Spree.t(:street_address_2) %>
30
30
  <%= form.text_field :address2, class: 'form-control' %>
31
- </p>
32
- <p class="form-group" id=<%="#{address_id}city" %>>
31
+ </div>
32
+ <div class="form-group" id='<%= "#{address_id}city" %>'>
33
33
  <%= form.label :city do %>
34
34
  <%= Spree.t(:city) %><abbr class="required" title="required">*</abbr>
35
35
  <% end %>
36
36
  <%= form.text_field :city, class: 'form-control', required: true %>
37
- </p>
38
- <p class="form-group" id=<%="#{address_id}country" %>>
37
+ </div>
38
+ <div class="form-group" id='<%= "#{address_id}country" %>'>
39
39
  <%= form.label :country_id do %>
40
40
  <%= Spree.t(:country) %><abbr class="required" title="required">*</abbr>
41
41
  <% end %>
42
- <span id=<%="#{address_id}country-selection" %>>
42
+ <span id='<%= "#{address_id}country-selection" %>'>
43
43
  <%= form.collection_select :country_id, available_countries, :id, :name, {}, { class: 'form-control', required: true } %>
44
44
  </span>
45
- </p>
45
+ </div>
46
46
 
47
47
  <% if Spree::Config[:address_requires_state] %>
48
- <p class="form-group" id=<%="#{address_id}state" %>>
48
+ <div class="form-group" id='<%= "#{address_id}state" %>'>
49
49
  <% have_states = !address.country.states.empty? %>
50
50
  <%= form.label :state do %>
51
- <%= Spree.t(:state) %><abbr class='required' title="required" id=<%="#{address_id}state-required"%>>*</abbr>
51
+ <%= Spree.t(:state) %><abbr class='required' title="required" id='<%= "#{address_id}state-required" %>'>*</abbr>
52
52
  <% end %>
53
53
 
54
54
  <%== state_elements = [
@@ -62,30 +62,29 @@
62
62
  class: !have_states ? 'form-control' : 'form-control hidden',
63
63
  required: !have_states,
64
64
  disabled: have_states)
65
- ].join.gsub('"', "'").gsub("\n", "")
66
- %>
67
- </p>
65
+ ].join.gsub('"', "'").gsub("\n", "") %>
66
+ </div>
68
67
  <noscript>
69
68
  <%= form.text_field :state_name, class: 'form-control', required: true %>
70
69
  </noscript>
71
70
  <% end %>
72
71
 
73
- <p class="form-group" id=<%="#{address_id}zipcode" %>>
72
+ <div class="form-group" id='<%= "#{address_id}zipcode" %>'>
74
73
  <%= form.label :zipcode do %>
75
74
  <%= Spree.t(:zip) %><% if address.require_zipcode? %><abbr class="required" title="required">*</abbr><% end %>
76
75
  <% end %>
77
76
  <%= form.text_field :zipcode, class: 'form-control', required: address.require_zipcode? %>
78
- </p>
79
- <p class="form-group" id=<%="#{address_id}phone" %>>
77
+ </div>
78
+ <div class="form-group" id='<%= "#{address_id}phone" %>'>
80
79
  <%= form.label :phone do %>
81
80
  <%= Spree.t(:phone) %><% if address.require_phone? %><abbr class="required" title="required">*</abbr><% end %>
82
81
  <% end %>
83
82
  <%= form.phone_field :phone, class: 'form-control', required: address.require_phone? %>
84
- </p>
83
+ </div>
85
84
  <% if Spree::Config[:alternative_shipping_phone] %>
86
- <p class="form-group" id=<%="#{address_id}altphone" %>>
85
+ <div class="form-group" id='<%= "#{address_id}altphone" %>'>
87
86
  <%= form.label :alternative_phone, Spree.t(:alternative_phone) %>
88
87
  <%= form.phone_field :alternative_phone, class: 'form-control' %>
89
- </p>
88
+ </div>
90
89
  <% end %>
91
90
  </div>
@@ -2,22 +2,31 @@
2
2
 
3
3
  <% Spree::Address::ADDRESS_FIELDS.each do |field| %>
4
4
  <% if field == "country" %>
5
- <p class="form-group checkout-content-inner-field" id="<%= "#{address_id}country" %>">
6
- <span id="<%= "#{address_id}country-selection" %>" class="d-block position-relative">
5
+ <div class="form-group checkout-content-inner-field" id="<%= "#{address_id}country" %>">
6
+ <div id="<%= "#{address_id}country-selection" %>" class="d-block position-relative has-float-label">
7
7
  <%= address_form.collection_select :country_id, available_countries, :id, :name,
8
8
  { prompt: Spree.t(:country).upcase },
9
- { class: 'required form-control spree-flat-select'} %>
9
+ { class: 'form-control spree-flat-select',
10
+ aria: { label: Spree.t(:country) } } %>
10
11
  <%= image_tag 'arrow.svg', class: 'position-absolute spree-flat-select-arrow' %>
11
- </span>
12
- </p>
12
+ <%= address_form.label(Spree.t(:country), Spree.t(:country).upcase, class:'text-uppercase') %>
13
+ </div>
14
+ </div>
13
15
  <% elsif field == "state" %>
14
16
  <div class="form-group mb-4">
15
17
  <%= address_field(address_form, :state, address_id) { address_state(address_form, address.country, address_id) } if Spree::Config[:address_requires_state] %>
16
18
  </div>
19
+ <% elsif field == "zipcode" %>
20
+ <div class="form-group mb-4">
21
+ <%= address_field(address_form, :zipcode, address_id) { address_zipcode(address_form, address.country, address_id) } %>
22
+ </div>
17
23
  <% else %>
18
24
  <% next if field == "company" && !Spree::Config[:company] %>
19
25
  <% next if field == "alternative_#{address_id}_phone" && !Spree::Config["alternative_#{address_id}_phone"] %>
20
26
  <div class="form-group mb-4">
21
27
  <%= address_field(address_form, field.to_sym, address_id) %>
22
- </div> <% end %>
28
+ </div>
29
+ <% end %>
23
30
  <% end %>
31
+
32
+ <p class="text-right text-uppercase mb-5 checkout-content-inner-field"><span id="required_marker"><%= Spree.t(:required) %></span> <%= Spree.t(:required_fields) %></p>
@@ -1,13 +1,18 @@
1
1
  <%= render 'spree/shared/error_messages', target: @address %>
2
2
  <div class="col-lg-6 offset-lg-3">
3
- <h3 class="spree-header spree-mb-large spree-mt-large"><%= t(:edit_shipping_address, scope: :address_book) %></h3>
3
+ <h3 class="spree-header spree-mb-large spree-mt-large"><%= Spree.t(:edit_address, scope: :address_book) %></h3>
4
4
  <%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
5
- <%= render 'spree/addresses/form',
6
- address_name: 'address',
7
- address_form: f,
8
- address_type: 'shipping',
9
- address: @address
10
- %>
11
- <%= f.submit Spree.t(:update), class: 'btn btn-primary btn-block spree-btn mb-5' %>
5
+ <div class="form-group checkout-content-inner-field mb-5 has-float-label">
6
+ <%= f.text_field :label, class: 'spree-flat-input', placeholder: Spree.t(:address_name_placeholder, scope: :address_book) %>
7
+ <%= f.label :address_name, Spree.t(:label, scope: :address_book) %>
8
+ </div>
9
+
10
+ <%= render 'spree/addresses/form',
11
+ address_name: 'address',
12
+ address_form: f,
13
+ address_type: 'shipping',
14
+ address: @address %>
15
+
16
+ <%= f.submit Spree.t(:update), class: 'btn btn-primary btn-block spree-btn mb-5' %>
12
17
  <% end %>
13
18
  </div>
@@ -1,13 +1,17 @@
1
1
  <%= render 'spree/shared/error_messages', target: @address %>
2
2
  <div class="col-lg-6 offset-lg-3">
3
- <h3 class="spree-header spree-mb-large spree-mt-large"><%= t(:new_shipping_address, scope: :address_book) %></h3>
4
- <%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
3
+ <h3 class="spree-header spree-mb-large spree-mt-large"><%= Spree.t(:new_address, scope: :address_book) %></h3>
4
+ <%= form_for @address, url: spree.addresses_path, html: { id: 'checkout_form_address' } do |f| %>
5
+ <div class="form-group checkout-content-inner-field mb-5 has-float-label">
6
+ <%= f.text_field :label, class: 'spree-flat-input', placeholder: Spree.t(:address_name_placeholder, scope: :address_book) %>
7
+ <%= f.label :address_name, Spree.t(:label, scope: :address_book) %>
8
+ </div>
5
9
  <%= render 'spree/addresses/form',
6
10
  address_name: 'address',
7
11
  address_form: f,
8
12
  address_type: 'shipping',
9
- address: @address
10
- %>
13
+ address: @address %>
14
+
11
15
  <%= f.submit t(:save, scope: :address_book), class: 'btn btn-primary btn-block spree-btn mb-5' %>
12
16
  <% end %>
13
17
  </div>
@@ -1,14 +1,10 @@
1
- <% @addresses = try_spree_current_user ? try_spree_current_user.addresses : [] %>
2
-
3
1
  <% if !try_spree_current_user || try_spree_current_user.email.blank? %>
4
2
  <div class="row">
5
3
  <div class="col-12 mb-4">
6
- <p class="form-group checkout-content-inner-field">
4
+ <div class="form-group checkout-content-inner-field has-float-label">
5
+ <%= form.email_field :email, class: 'required spree-flat-input', required: true, placeholder: Spree.t(:email) %>
7
6
  <%= form.label :email, class: 'text-uppercase' %>
8
- <span class="required">*</span>
9
- <br />
10
- <%= form.email_field :email, class: 'required spree-flat-input', required: true %>
11
- </p>
7
+ </div>
12
8
  </div>
13
9
  </div>
14
10
  <% end %>
@@ -30,37 +26,37 @@
30
26
  <%= label_tag :order_use_billing, Spree.t(:use_billing_address), class: 'spree-checkbox-label' %>
31
27
  </div>
32
28
  <% end %>
33
- <% if @addresses.present? %>
34
- <div class="select_address">
35
- <div class="form-group">
36
- <% @addresses.each_with_index do |address, idx| %>
37
- <span class="d-block mb-2" id="<%= [address_type, dom_id(address)].join('_') %>">
38
- <label class="form-check-label spree-radio-label">
29
+ <% if user_available_addresses.present? %>
30
+ <div class="select_address mb-5">
31
+ <div class="form-group col">
32
+ <% user_available_addresses.each_with_index do |address, idx| %>
33
+ <div class="row mb-3" id="<%= [address_type, dom_id(address)].join('_') %>">
34
+ <label class="form-check-label spree-radio-label col-8">
39
35
  <%= form.radio_button "#{address_name}_id", address.id, checked: (address.id == try_spree_current_user["#{address_name}_id"] || idx == 0) %>
40
36
  <span class="spree-radio-label-custom-input"></span>
41
- <span class="d-inline-block align-top">
42
37
  <%= render "spree/users/address", address: address %>
43
- </span>
44
38
  </label>
45
- </span>
39
+ <%= render "spree/users/address_controls", address: address %>
40
+ </div>
46
41
  <% end %>
47
- <label class="form-check-label spree-radio-label">
48
- <%= form.radio_button "#{address_name}_id", 0, class: 'form-check-input' %> <%= Spree.t('address_book.other_address') %>
49
- <span class="spree-radio-label-custom-input"></span>
50
- </label>
42
+ <div class="row mb-3">
43
+ <label class="form-check-label spree-radio-label col">
44
+ <%= form.radio_button "#{address_name}_id", 0, class: 'form-check-input' %> <h4><%= Spree.t('address_book.other_address') %></h4>
45
+ <span class="spree-radio-label-custom-input"></span>
46
+ </label>
47
+ </div>
51
48
  </div>
52
49
  </div>
53
50
  <% end %>
54
51
  <%= form.fields_for address_name do |address_form| %>
55
- <div class="inner checkout-content-inner" data-hook=<%="#{address_type}_inner" %>>
52
+ <div class="inner checkout-content-inner" data-hook='<%= "#{address_type}_inner" %>'>
56
53
  <%= render partial: 'spree/addresses/form', locals: {
57
54
  address_name: address_name,
58
55
  address_form: address_form,
59
56
  address_type: address_type,
60
- address: Spree::Address.default,
57
+ address: Spree::Address.new(country: current_store.default_country),
61
58
  form: form
62
59
  } %>
63
- <p class="text-right text-uppercase checkout-content-inner-field">*<%= Spree.t(:required_fields) %></p>
64
60
  </div>
65
61
  <% end %>
66
62
  </div>
@@ -2,79 +2,5 @@
2
2
  <p class="checkout-content-header">
3
3
  <%= Spree.t(:summary).upcase %>
4
4
  </p>
5
- <div class='checkout-confirm-order-details d-flex flex-column flex-lg-wrap' id="order_summary" data-hook>
6
- <div class="checkout-confirm-order-details-line-items d-flex flex-column align-items-center w-100 order-0 order-lg-1">
7
- <div class="checkout-confirm-order-details-line-items-header d-none d-sm-block d-lg-none align-self-start mb-3">
8
- <%= Spree.t(:products) %>
9
- </div>
10
- <div class="d-table w-100">
11
- <div class="d-none d-lg-table-row text-secondary text-uppercase">
12
- <p class="d-table-cell pb-1">
13
- <%= Spree.t(:product) %>
14
- </p>
15
- <p class="d-table-cell pb-1">
16
- <%= Spree.t(:price) %>
17
- </p>
18
- <p class="d-table-cell pb-1">
19
- <%= Spree.t(:quantity) %>
20
- </p>
21
- <p class="d-table-cell pb-1">
22
- <%= Spree.t(:total) %>
23
- </p>
24
- </div>
25
- <%= render partial: 'spree/shared/line_item', collection: @order.line_items, cached: true %>
26
- </div>
27
- </div>
28
- <div class="checkout-confirm-delivery-informations text-left mt-3 order-1 order-lg-0">
29
- <div class="d-lg-none checkout-confirm-delivery-informations-header">
30
- <%= Spree.t(:delivery_information) %>
31
- </div>
32
- <dl>
33
- <div>
34
- <dt class="text-uppercase">
35
- <%= Spree.t(:shipping_address) %>
36
- <%= checkout_edit_link %>
37
- </dt>
38
- <dd><%= sanitize @order.ship_address.to_s, tags: %w[br] %></dd>
39
- </div>
40
- <div>
41
- <dt class="text-uppercase">
42
- <%= Spree.t(:billing_address) %>
43
- <%= checkout_edit_link %>
44
- </dt>
45
- <dd><%= sanitize @order.bill_address.to_s, tags: %w[br] %></dd>
46
- </div>
47
- <div>
48
- <dt class="text-uppercase">
49
- <%= Spree.t(:shipping) %>
50
- <%= checkout_edit_link('delivery') %>
51
- </dt>
52
- <% @order.shipments.pending.each do |shipment| %>
53
- <dd><%= shipment.shipping_method&.name %> </dd>
54
- <% end %>
55
- </div>
56
- <div>
57
- <dt class="text-uppercase">
58
- <%= Spree.t(:payment) %>
59
- <%= checkout_edit_link('payment') %>
60
- </dt>
61
- <dd>
62
- <%= render collection: @order.payments.valid, partial: 'spree/shared/payment' %>
63
- </dd>
64
- <dd>
65
- <% if @order.using_store_credit? %>
66
- <%= button_tag Spree.t('store_credit.remove'), name: 'remove_store_credit', class: 'continue btn' %>
67
- <% end %>
68
- </dd>
69
- </div>
70
- </dl>
71
- </div>
72
- <div id="checkout-summary" class="w-100 order-2" data-hook="checkout_summary_box">
73
- <%= render partial: 'spree/checkout/summary', locals: { order: @order } %>
74
- <div data-hook="buttons">
75
- <% submit_label_key = @order.confirm? ? :place_order : :save_and_continue %>
76
- <%= submit_tag Spree.t(submit_label_key), class: 'btn btn-primary text-uppercase font-weight-bold w-100 checkout-content-save-continue-button' %>
77
- </div>
78
- </div>
79
- </div>
5
+ <%= render partial: 'spree/shared/order_details', locals: { order: @order } %>
80
6
  </div>
@@ -1,9 +1,10 @@
1
- <div id="<%= dom_id(card,'spree')%>" class="payment-sources-list-item">
1
+ <div id="<%= dom_id(card,'spree') %>" class="payment-sources-list-item">
2
2
  <label class="form-check-label spree-radio-label">
3
- <%= radio_button_tag "order[existing_card]", card.id, (card == @payment_sources.first), { class: "existing-cc-radio" } %>
3
+ <%= radio_button_tag "order[existing_card]", card.id, (card == @payment_sources.first), { class: "existing-cc-radio" } %>
4
4
  <span class="spree-radio-label-custom-input"></span>
5
5
  <%= credit_card_icon(card.cc_type) %>
6
6
  <span>****<%= card.last_digits %>,&nbsp</span>
7
7
  <span><%= card.name %></span>
8
+ <%= button_tag Spree.t(:remove), type: 'button', class: 'btn text-left d-block p-0 js-remove-credit-card', data: { id: card.id } %>
8
9
  </label>
9
10
  </div>
@@ -3,9 +3,15 @@
3
3
  <div id="methods">
4
4
  <%= form.fields_for :shipments do |ship_form| %>
5
5
  <div class="shipment">
6
- <h4 class="text-uppercase checkout-content-header checkout-content-shipping-methods-header">
6
+ <h4 class="text-uppercase checkout-content-header checkout-content-shipping-methods-header mb-1">
7
7
  <%= Spree.t('checkout_page.delivery_method') %>
8
8
  </h4>
9
+ <div id="shipToLocation" class="mb-4 text-uppercase">
10
+ <%= Spree.t(:ship_to) %>
11
+ <span class="text-muted"><%= @order.shipping_address.address1 %></span> -
12
+ <% if @order.shipping_address.zipcode.present? %> <span class="text-muted"><%= @order.shipping_address.zipcode %></span> - <% end %>
13
+ <span class="text-muted"><%= @order.shipping_address.country_iso %></span>
14
+ </div>
9
15
 
10
16
  <ul class="checkout-content-shipping-methods-list">
11
17
  <% ship_form.object.shipping_rates.each do |rate| %>
@@ -28,13 +34,14 @@
28
34
  </div>
29
35
  <% end %>
30
36
  </div>
31
- <% if Spree::Config[:shipping_instructions] %>
32
- <p id="minstrs" data-hook>
37
+
38
+ <% if Spree::Frontend::Config[:shipping_instructions] %>
39
+ <div id="minstrs" data-hook>
33
40
  <h4 class="h5">
34
41
  <%= Spree.t(:shipping_instructions) %>
35
42
  </h4>
36
43
  <%= form.text_area :special_instructions, cols: 40, rows: 4, class: "form-control" %>
37
- </p>
44
+ </div>
38
45
  <% end %>
39
46
  </div>
40
47
  </div>
@@ -0,0 +1,51 @@
1
+ <div class="checkout-confirm-delivery-informations text-left mt-3 <%= class_name %>">
2
+ <div class="d-lg-none checkout-confirm-delivery-informations-header">
3
+ <%= Spree.t(:delivery_information) %>
4
+ </div>
5
+ <dl>
6
+ <% if order.has_step?("address") %>
7
+ <div data-hook="order-ship-address">
8
+ <dt class="text-uppercase">
9
+ <%= Spree.t(:shipping_address) %>
10
+ <%= checkout_edit_link %>
11
+ </dt>
12
+ <%= render 'spree/shared/address', address: order.ship_address %>
13
+ </div>
14
+ <div data-hook="order-bill-address">
15
+ <dt class="text-uppercase">
16
+ <%= Spree.t(:billing_address) %>
17
+ <%= checkout_edit_link %>
18
+ </dt>
19
+ <%= render 'spree/shared/address', address: order.bill_address %>
20
+ </div>
21
+ <% end %>
22
+ <% if order.has_step?("delivery") %>
23
+ <div data-hook="order-shipment">
24
+ <dt class="text-uppercase">
25
+ <%= Spree.t(:shipping) %>
26
+ <%= checkout_edit_link('delivery') %>
27
+ </dt>
28
+ <% @order.shipments.valid.each do |shipment| %>
29
+ <dd><%= shipment.shipping_method&.name %> </dd>
30
+ <% end %>
31
+ <%= render 'spree/shared/shipment_tracking', order: order if order.shipped? %>
32
+ </div>
33
+ <% end %>
34
+ <% if order.has_step?("payment") %>
35
+ <div data-hook="order-payment">
36
+ <dt class="text-uppercase">
37
+ <%= Spree.t(:payment) %>
38
+ <%= checkout_edit_link('payment') %>
39
+ </dt>
40
+ <dd>
41
+ <%= render collection: @order.payments.valid, partial: 'spree/shared/payment' %>
42
+ </dd>
43
+ <dd>
44
+ <% if @order.using_store_credit? %>
45
+ <%= button_tag Spree.t('store_credit.remove'), name: 'remove_store_credit', class: 'continue btn' %>
46
+ <% end %>
47
+ </dd>
48
+ </div>
49
+ <% end %>
50
+ </dl>
51
+ </div>
@@ -4,16 +4,15 @@
4
4
  </p>
5
5
 
6
6
  <div data-hook="checkout_payment_step">
7
-
8
7
  <%= render partial: 'spree/checkout/payment/storecredit' %>
9
8
 
10
9
  <ul id="payment-method-fields" class="list-unstyled position-relative" data-hook>
11
- <% @order.available_payment_methods.each do |method| %>
10
+ <% checkout_available_payment_methods.each do |method| %>
12
11
  <li class="radio">
13
12
  <%= label_tag '', class: "form-check-label spree-radio-label payment-option", data: { type: method.id == @payment_sources&.first&.payment_method_id ? 'card' : nil } do %>
14
13
  <%= radio_button_tag "order[payments_attributes][][payment_method_id]",
15
14
  method.id,
16
- method.id == @order.payments.checkout.last&.payment_method_id || method == @order.available_payment_methods.first %>
15
+ method.id == @order.payments.checkout.last&.payment_method_id || method == checkout_available_payment_methods.first %>
17
16
  <span class="spree-radio-label-custom-input"></span>
18
17
  <%= Spree.t(method.name, scope: :payment_methods, default: method.name) %>
19
18
  <% end %>
@@ -22,29 +21,11 @@
22
21
  </ul>
23
22
 
24
23
  <div class="payment-sources">
25
- <% if @payment_sources.present? %>
26
- <div id="existing_cards" class="payment-sources-existing-cards">
27
- <%= radio_button_tag 'use_existing_card', 'yes', true, class: 'd-none' %>
28
- <div class="form-group" data-hook="existing_cards">
29
- <div class="d-flex flex-column payment-sources-list">
30
- <% @payment_sources.each do |card| %>
31
- <%= render partial: 'credit_card', locals: { card: card } %>
32
- <% end %>
33
- <div>
34
- <label class="form-check-label spree-radio-label col-6 mb-2">
35
- <%= radio_button_tag 'use_existing_card', 'no' %>
36
- <span class="spree-radio-label-custom-input"></span>
37
- <span><%= Spree.t(:add_new_credit_card) %></span>
38
- </label>
39
- </div>
40
- </div>
41
- </div>
42
- </div>
43
- <% end %>
24
+ <%= render partial: 'payment_sources' if @payment_sources.present? %>
44
25
 
45
26
  <ul id="payment-methods" class="list-unstyled position-relative mb-0 payment-sources-add-form" data-hook>
46
- <% @order.available_payment_methods.each do |method| %>
47
- <li id="payment_method_<%= method.id %>" class="<%= 'last' if method == @order.available_payment_methods.last %>" data-hook>
27
+ <% checkout_available_payment_methods.each do |method| %>
28
+ <li id="payment_method_<%= method.id %>" class="<%= 'last' if method == checkout_available_payment_methods.last %>" data-hook>
48
29
  <fieldset>
49
30
  <%= render partial: "spree/checkout/payment/#{method.method_type}", locals: { payment_method: method } %>
50
31
  </fieldset>
@@ -0,0 +1,17 @@
1
+ <div id="existing_cards" class="payment-sources-existing-cards" style="display:none;">
2
+ <%= radio_button_tag 'use_existing_card', 'yes', true, class: 'd-none' %>
3
+ <div class="form-group" data-hook="existing_cards">
4
+ <div class="d-flex flex-column payment-sources-list">
5
+ <% @payment_sources.each do |card| %>
6
+ <%= render partial: 'credit_card', locals: { card: card } %>
7
+ <% end %>
8
+ <div>
9
+ <label class="form-check-label spree-radio-label col-6 mb-2">
10
+ <%= radio_button_tag 'use_existing_card', 'no' %>
11
+ <span class="spree-radio-label-custom-input"></span>
12
+ <span><%= Spree.t(:add_new_credit_card) %></span>
13
+ </label>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </div>
@@ -20,31 +20,34 @@
20
20
  data-non-shipment-tax='<%= adjustments.reject{ |adj| adj.adjustable_type== 'Spree::Shipment'}.sum(&:amount) %>'
21
21
  thousands-separator='<%= tax_total.thousands_separator %>'
22
22
  decimal-mark='<%= tax_total.decimal_mark %>'
23
- precision='<%= Money::Currency.find(order.currency).exponent %>'
24
- >
23
+ precision='<%= Money::Currency.find(order.currency).exponent %>'>
25
24
  <%= tax_total.to_html %>
26
25
  </div>
27
26
  <% end %>
28
27
 
29
28
  <% if order.passed_checkout_step?("address") && order.shipments.any? %>
30
- <div class="d-table-cell"><%= Spree.t(:shipping) %>:</div>
31
- <% shipping_total = Spree::Money.new(order.shipments.to_a.sum(&:cost), currency: order.currency) %>
32
- <div class="d-table-cell text-right"
33
- data-hook='shipping-total'
34
- data-currency='<%= Money::Currency.find(order.currency).symbol %>'
35
- thousands-separator='<%= shipping_total.thousands_separator %>'
36
- decimal-mark='<%= shipping_total.decimal_mark %>'
37
- precision='<%= Money::Currency.find(order.currency).exponent %>'
38
- >
39
- <%= shipping_total.to_html %>
40
- </div>
29
+ <% if order.has_free_shipping? %>
30
+ <div class="d-table-cell"><%= Spree.t(:shipping) %>:</div>
31
+ <div class="d-table-cell text-right" data-hook="is-free-shipping"><%= Spree.t(:free) %></div>
32
+ <% else %>
33
+ <div class="d-table-cell"><%= Spree.t(:shipping) %>:</div>
34
+ <% shipping_total = Spree::Money.new(order.shipments.to_a.sum(&:cost), currency: order.currency) %>
35
+ <div class="d-table-cell text-right"
36
+ data-hook='shipping-total'
37
+ data-currency='<%= Money::Currency.find(order.currency).symbol %>'
38
+ thousands-separator='<%= shipping_total.thousands_separator %>'
39
+ decimal-mark='<%= shipping_total.decimal_mark %>'
40
+ precision='<%= Money::Currency.find(order.currency).exponent %>'>
41
+ <%= shipping_total.to_html %>
42
+ </div>
41
43
 
42
- <% if order.shipment_adjustments.nonzero.exists? %>
43
- <% order.shipment_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
44
- <div class="d-table-cell"><%= label %>:</div>
45
- <div class="d-table-cell text-right">
46
- <%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
47
- </div>
44
+ <% if order.shipment_adjustments.nonzero.exists? %>
45
+ <% order.shipment_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
46
+ <div class="d-table-cell"><%= label %>:</div>
47
+ <div class="d-table-cell text-right">
48
+ <%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
49
+ </div>
50
+ <% end %>
48
51
  <% end %>
49
52
  <% end %>
50
53
  <% end %>
@@ -1,5 +1,25 @@
1
1
  <% @body_id = 'checkout-page' %>
2
2
 
3
+ <%
4
+ content_for :head do
5
+ agent = request.env['HTTP_USER_AGENT']
6
+ if agent =~ /Safari/ && !(agent =~ /Chrome/)
7
+ %>
8
+ <script>
9
+ if (!!window.performance && window.performance.navigation.type === 2) {
10
+ window.location.reload();
11
+ }
12
+ window.onpageshow = function(event) {
13
+ if (event.persisted) {
14
+ window.location.reload()
15
+ }
16
+ }
17
+ </script>
18
+ <%
19
+ end
20
+ end
21
+ %>
22
+
3
23
  <div id="checkout" class="container checkout" data-hook>
4
24
  <%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
5
25
 
@@ -7,13 +27,13 @@
7
27
  <div class="text-uppercase checkout-header-title">
8
28
  <h1 data-hook="checkout_title"><%= Spree.t('checkout_page.header') %></h1>
9
29
  </div>
10
- <div class="checkout-progress" data-hook="checkout_progress">
30
+ <div class="checkout-progress" data-hook="checkout_progress" role="navigation" aria-label="<%= Spree.t('checkout_page.checkout_navigation') %>">
11
31
  <%= checkout_progress %>
12
32
  </div>
13
33
  </div>
14
34
 
15
35
  <div class="row checkout-content" data-hook="checkout_content">
16
- <%= form_for @order, url: spree.update_checkout_path(@order.state), html: { id: "checkout_form_#{@order.state}", class: "w-100 d-lg-flex align-items-lg-baseline flex-wrap position-relative" } do |form| %>
36
+ <%= form_for @order, url: spree.update_checkout_path(@order.state), html: { id: "checkout_form_#{@order.state}", class: "w-100 d-lg-flex align-items-lg-baseline flex-wrap position-relative", data: { turbo: false } } do |form| %>
17
37
  <div class="<%= if @order.state != 'confirm' then 'col-lg-6' else 'col-md-12' end %>" data-hook="checkout_form_wrapper">
18
38
  <%= form.hidden_field :state_lock_version %>
19
39
  <%= render @order.state, form: form %>