spree_frontend 4.2.4 → 4.3.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/app/assets/config/spree_frontend_manifest.js +4 -0
- data/app/assets/images/arrow-right-circle-fill.svg +3 -0
- data/app/assets/images/card-image.svg +4 -0
- data/app/assets/images/file-image.svg +4 -0
- data/app/assets/images/image.svg +4 -0
- data/app/assets/images/noimage/large.png +0 -0
- data/app/assets/images/noimage/mini.png +0 -0
- data/app/assets/images/noimage/plp.svg +23 -0
- data/app/assets/images/noimage/product.png +0 -0
- data/app/assets/images/noimage/small.png +0 -0
- data/app/assets/javascripts/spree/api/main.js +36 -0
- data/app/assets/javascripts/spree/api/storefront/cart.js +49 -0
- data/app/assets/javascripts/spree/frontend/checkout/payment.js +18 -5
- data/app/assets/javascripts/spree/frontend/checkout.js +16 -0
- data/app/assets/javascripts/spree/frontend/currency.js +11 -9
- data/app/assets/javascripts/spree/frontend/locale.es6 +13 -0
- data/app/assets/javascripts/spree/frontend/views/spree/home/product_carousels.js +3 -3
- data/app/assets/javascripts/spree/frontend/views/spree/products/index.js +0 -9
- data/app/assets/javascripts/spree/frontend/views/spree/products/price_filters.es6 +46 -0
- data/app/assets/javascripts/spree/frontend.js +3 -0
- data/app/assets/javascripts/spree.js +78 -0
- data/app/assets/stylesheets/spree/frontend/application.scss +1 -0
- data/app/assets/stylesheets/spree/frontend/components-bootstrap/button.scss +8 -0
- data/app/assets/stylesheets/spree/frontend/helpers/spree/frontend_helper.scss +41 -0
- data/app/assets/stylesheets/spree/frontend/variables/variables.scss +2 -2
- data/app/assets/stylesheets/spree/frontend/views/spree/checkout/edit.scss +17 -5
- data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/_index.scss +1 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/cms_sections/product_buy_bar.scss +20 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss +54 -67
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/category_nav_bar.scss +3 -3
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/footer.scss +4 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/shared/main_nav_bar.scss +12 -1
- data/app/controllers/spree/addresses_controller.rb +14 -19
- data/app/controllers/spree/checkout_controller.rb +5 -3
- data/app/controllers/spree/cms_pages_controller.rb +29 -0
- data/app/controllers/spree/content_controller.rb +0 -2
- data/app/controllers/spree/errors_controller.rb +11 -0
- data/app/controllers/spree/home_controller.rb +34 -1
- data/app/controllers/spree/locale_controller.rb +7 -1
- data/app/controllers/spree/orders_controller.rb +9 -7
- data/app/controllers/spree/products_controller.rb +14 -13
- data/app/controllers/spree/store_controller.rb +25 -1
- data/app/controllers/spree/taxons_controller.rb +12 -5
- data/app/helpers/spree/addresses_helper.rb +9 -4
- data/app/helpers/spree/cms_pages_helper.rb +23 -0
- data/app/helpers/spree/frontend_helper.rb +109 -10
- data/app/helpers/spree/navigation_helper.rb +73 -4
- data/app/helpers/spree/products_filters_helper.rb +168 -0
- data/app/helpers/spree/store_helper.rb +3 -1
- data/app/views/spree/checkout/_address.html.erb +1 -1
- data/app/views/spree/checkout/_credit_card.html.erb +1 -0
- data/app/views/spree/cms_pages/show.html.erb +16 -0
- data/app/views/spree/errors/forbidden.html.erb +0 -0
- data/app/views/spree/errors/unauthorized.html.erb +0 -0
- data/app/views/spree/home/index.html.erb +19 -118
- data/app/views/spree/layouts/spree_application.html.erb +3 -2
- data/app/views/spree/products/_description.html.erb +16 -19
- data/app/views/spree/products/_filters_desktop.html.erb +50 -15
- data/app/views/spree/products/_filters_mobile.html.erb +38 -10
- data/app/views/spree/products/_sort_desktop.html.erb +17 -11
- data/app/views/spree/products/_sort_mobile.html.erb +16 -0
- data/app/views/spree/products/index.html.erb +1 -1
- data/app/views/spree/shared/_carousel_4_products.html.erb +8 -8
- data/app/views/spree/shared/_checkout_header.html.erb +22 -21
- data/app/views/spree/shared/_copyright.html.erb +1 -10
- data/app/views/spree/shared/_footer.html.erb +18 -12
- data/app/views/spree/shared/_get_started.html.erb +32 -0
- data/app/views/spree/shared/_head.html.erb +1 -1
- data/app/views/spree/shared/_header.html.erb +3 -3
- data/app/views/spree/shared/_main_nav_bar.html.erb +61 -43
- data/app/views/spree/shared/_mobile_navigation.html.erb +30 -19
- data/app/views/spree/shared/_nav_bar.html.erb +1 -1
- data/app/views/spree/shared/_option_values.html.erb +2 -21
- data/app/views/spree/shared/_order_details.html.erb +1 -1
- data/app/views/spree/shared/_paths.html.erb +8 -0
- data/app/views/spree/shared/_properties.html.erb +4 -0
- data/app/views/spree/shared/_translations.html.erb +2 -1
- data/app/views/spree/shared/carousel/_single.html.erb +1 -1
- data/app/views/spree/shared/carousel/_thumbnails.html.erb +1 -1
- data/app/views/spree/shared/cms/pages/_edit_mode.html.erb +13 -0
- data/app/views/spree/shared/cms/sections/_featured_article.html.erb +27 -0
- data/app/views/spree/shared/cms/sections/_hero_image.html.erb +60 -0
- data/app/views/spree/shared/cms/sections/_image_gallery.html.erb +171 -0
- data/app/views/spree/shared/cms/sections/_product_carousel.html.erb +5 -0
- data/app/views/spree/shared/cms/sections/_rich_text_content.html.erb +3 -0
- data/app/views/spree/shared/cms/sections/_side_by_side_images.html.erb +118 -0
- data/app/views/spree/taxons/_header.html.erb +6 -1
- data/app/views/spree/users/show.html.erb +4 -1
- data/config/initializers/assets.rb +4 -13
- data/config/routes.rb +9 -3
- data/lib/generators/spree/frontend/install/install_generator.rb +5 -5
- data/lib/generators/spree/frontend/install/templates/app/assets/config/manifest.js +2 -0
- data/lib/generators/spree/frontend/install/templates/vendor/assets/javascripts/spree/frontend/all.js +8 -0
- data/lib/generators/spree/frontend/install/templates/vendor/assets/stylesheets/spree/frontend/all.css +9 -0
- data/lib/spree/frontend/engine.rb +6 -0
- data/lib/spree/frontend.rb +6 -3
- data/spec/fixtures/files/store_favicon.ico +0 -0
- data/spree_frontend.gemspec +13 -9
- data/vendor/assets/javascripts/cleave.js +8 -0
- data/vendor/assets/javascripts/fetch.umd.js +531 -0
- data/vendor/assets/javascripts/jquery.payment.js +652 -0
- data/vendor/assets/javascripts/jsuri.js +458 -0
- data/vendor/assets/javascripts/polyfill.min.js +1 -0
- metadata +134 -87
- data/app/assets/images/homepage/big_category_banner.jpg +0 -0
- data/app/assets/images/homepage/big_category_banner_mobile.jpg +0 -0
- data/app/assets/images/homepage/big_category_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/big_category_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/category_banner_lower.jpg +0 -0
- data/app/assets/images/homepage/category_banner_lower_mobile.jpg +0 -0
- data/app/assets/images/homepage/category_banner_lower_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/category_banner_lower_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/category_banner_upper.jpg +0 -0
- data/app/assets/images/homepage/category_banner_upper_mobile.jpg +0 -0
- data/app/assets/images/homepage/category_banner_upper_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/category_banner_upper_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/main_banner.jpg +0 -0
- data/app/assets/images/homepage/main_banner_mobile.jpg +0 -0
- data/app/assets/images/homepage/main_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/main_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_left.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_left_mobile.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_left_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_left_tablet_portrait.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_right.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_right_mobile.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_right_tablet_landscape.jpg +0 -0
- data/app/assets/images/homepage/promo_banner_right_tablet_portrait.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_left-first-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_left-second-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_left-third-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_right-first-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_right-second-category.jpg +0 -0
- data/app/assets/images/meganav/promo_banner_right-third-category.jpg +0 -0
- data/app/assets/images/noimage/big_category_banner.jpg +0 -0
- data/app/assets/images/noimage/big_category_banner_mobile.jpg +0 -0
- data/app/assets/images/noimage/big_category_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/noimage/big_category_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/noimage/category_banner.jpg +0 -0
- data/app/assets/images/noimage/category_banner_mobile.jpg +0 -0
- data/app/assets/images/noimage/category_banner_plp.jpg +0 -0
- data/app/assets/images/noimage/category_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/noimage/category_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/noimage/main_banner.jpg +0 -0
- data/app/assets/images/noimage/main_banner_mobile.jpg +0 -0
- data/app/assets/images/noimage/main_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/noimage/main_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/noimage/product_photo.jpg +0 -0
- data/app/assets/images/noimage/promo_banner.jpg +0 -0
- data/app/assets/images/noimage/promo_banner_megamenu.jpg +0 -0
- data/app/assets/images/noimage/promo_banner_mobile.jpg +0 -0
- data/app/assets/images/noimage/promo_banner_tablet_landscape.jpg +0 -0
- data/app/assets/images/noimage/promo_banner_tablet_portrait.jpg +0 -0
- data/app/assets/images/spark-logo@3x.png +0 -0
- data/app/assets/javascripts/spree/frontend/locale.js +0 -13
- data/app/assets/javascripts/spree/frontend/multi_currency.js +0 -13
- data/lib/generators/spree/frontend/install/templates/config/initializers/spree_storefront.rb +0 -1
- data/lib/generators/spree/frontend/install/templates/config/spree_storefront.yml +0 -99
@@ -1,5 +1,7 @@
|
|
1
1
|
module Spree
|
2
2
|
module StoreHelper
|
3
|
+
include LocaleHelper
|
4
|
+
|
3
5
|
def store_country_iso(store = nil)
|
4
6
|
store ||= current_store if defined?(current_store)
|
5
7
|
|
@@ -22,7 +24,7 @@ module Spree
|
|
22
24
|
return unless store
|
23
25
|
return store.name if store.default_locale.blank?
|
24
26
|
|
25
|
-
|
27
|
+
locale_full_name(store.default_locale)
|
26
28
|
end
|
27
29
|
|
28
30
|
def should_render_store_chooser?
|
@@ -5,5 +5,6 @@
|
|
5
5
|
<%= credit_card_icon(card.cc_type) %>
|
6
6
|
<span>****<%= card.last_digits %>, </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>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% if @cms_page %>
|
2
|
+
<% if simple_page?(@cms_page) %>
|
3
|
+
<div class="container">
|
4
|
+
<div class="row my-5">
|
5
|
+
<div class="col-12">
|
6
|
+
<%= @cms_page.content.html_safe %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<% else %>
|
11
|
+
<% @cms_page.cms_sections.each do |section| %>
|
12
|
+
<%= build_section(section) %>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
<%= render "spree/shared/cms/pages/edit_mode", edit_mode: @edit_mode %>
|
File without changes
|
File without changes
|
@@ -1,121 +1,22 @@
|
|
1
|
-
<% @
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
<% if @homepage %>
|
2
|
+
<% @homepage.cms_sections.each do |section| %>
|
3
|
+
<%= build_section(section) %>
|
4
|
+
<% end %>
|
5
|
+
<% else %>
|
6
|
+
<div id="missingHomepage" class="container my-5">
|
7
|
+
<div class="row my-5">
|
8
|
+
<div class="col-12">
|
9
|
+
<figure class="logo mx-auto missing-homepage-logo-container">
|
10
|
+
<%= logo %>
|
11
|
+
</figure>
|
12
|
+
</div>
|
13
|
+
<div class="col-12 mb-5 text-center">
|
14
|
+
<h1 class="mb-3"><%= Spree.t('we_will_be_back') %></h1>
|
15
|
+
<h4 class="text-dark"><%= Spree.t('we_are_busy_updating', store_name: current_store.name) %></h4>
|
16
|
+
<h4 class="text-dark"><%= Spree.t('please_check_back_soon') %></h4>
|
17
|
+
</div>
|
15
18
|
</div>
|
16
19
|
</div>
|
17
|
-
|
18
|
-
|
19
|
-
<div class="container">
|
20
|
-
<div class="row">
|
21
|
-
<div class="col-6">
|
22
|
-
|
23
|
-
<%= link_to spree.nested_taxons_path('men'), class: "homepage-taxon-box mb-3" do %>
|
24
|
-
<img class="w-100 lazyload"
|
25
|
-
data-src="<%= asset_path('homepage/category_banner_upper.jpg') %>"
|
26
|
-
data-srcset="<%= image_source_set('homepage/category_banner_upper') %>"
|
27
|
-
alt="Men">
|
28
|
-
|
29
|
-
<div class="homepage-taxon-box-text">
|
30
|
-
<h3>Men</h3>
|
31
|
-
</div>
|
32
|
-
<% end %>
|
33
|
-
|
34
|
-
<%= link_to spree.nested_taxons_path('sportswear'), class: "homepage-taxon-box" do %>
|
35
|
-
<img class="w-100 lazyload"
|
36
|
-
data-src="<%= asset_path('homepage/category_banner_lower.jpg') %>"
|
37
|
-
data-srcset="<%= image_source_set('homepage/category_banner_lower') %>"
|
38
|
-
alt="Sportswear">
|
20
|
+
<% end %>
|
39
21
|
|
40
|
-
|
41
|
-
<h3>Sportswear</h3>
|
42
|
-
</div>
|
43
|
-
<% end %>
|
44
|
-
|
45
|
-
</div>
|
46
|
-
|
47
|
-
<div class="col-6 d-flex flex-column">
|
48
|
-
|
49
|
-
<%= link_to spree.nested_taxons_path('women'), class: "homepage-taxon-box flex-grow-1" do %>
|
50
|
-
<img class="w-100 lazyload"
|
51
|
-
data-src="<%= asset_path('homepage/big_category_banner.jpg') %>"
|
52
|
-
data-srcset="<%= image_source_set('homepage/big_category_banner') %>"
|
53
|
-
alt="Women">
|
54
|
-
|
55
|
-
<div class="homepage-taxon-box-text">
|
56
|
-
<h3>Women</h3>
|
57
|
-
</div>
|
58
|
-
<% end %>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<div data-product-carousel data-product-carousel-taxon-id='bestsellers' class="my-3"></div>
|
65
|
-
|
66
|
-
<div class="homepage-fashion-trends-box mb-3">
|
67
|
-
<div class="text-center">
|
68
|
-
<div class="homepage-fashion-trends-box-summer-text mb-1">Summer 2021</div>
|
69
|
-
<div class="homepage-fashion-trends-box-fashion-trends-text mb-2">FASHION TRENDS</div>
|
70
|
-
<div class="homepage-fashion-trends-box-description-text text-center mb-3">
|
71
|
-
Want to rock this season’s hottest trend in style? These are the top fashion from Summer 2020 Fashion Weeks that are coming our way this season.
|
72
|
-
</div>
|
73
|
-
<%= link_to 'READ MORE', spree.nested_taxons_path('trending'), class: 'btn px-5 spree-btn btn-outline-primary' %>
|
74
|
-
</div>
|
75
|
-
</div>
|
76
|
-
|
77
|
-
<div data-product-carousel data-product-carousel-taxon-id='trending' class="mb-3"></div>
|
78
|
-
|
79
|
-
<div class="container">
|
80
|
-
<div class="row">
|
81
|
-
<div class="col-12 col-lg-6">
|
82
|
-
<%= link_to spree.nested_taxons_path('streetstyle') do %>
|
83
|
-
<div class="homepage-bottom-box text-center mb-3">
|
84
|
-
<img class="w-100 lazyload"
|
85
|
-
data-src="<%= asset_path('homepage/promo_banner_left.jpg') %>"
|
86
|
-
data-srcset="<%= image_source_set('homepage/promo_banner_left') %>"
|
87
|
-
alt="NEW COLLECTION">
|
88
|
-
|
89
|
-
<div class="homepage-bottom-box-inner" role="img" aria-label="New Collection">
|
90
|
-
<div class="homepage-bottom-box-inner-small-text">
|
91
|
-
New Collection
|
92
|
-
</div>
|
93
|
-
<div class="homepage-bottom-box-inner-big-text">
|
94
|
-
Streetstyle
|
95
|
-
</div>
|
96
|
-
</div>
|
97
|
-
</div>
|
98
|
-
<% end %>
|
99
|
-
</div>
|
100
|
-
|
101
|
-
<div class="col-12 col-lg-6">
|
102
|
-
<%= link_to spree.nested_taxons_path('summer-sale') do %>
|
103
|
-
<div class="homepage-bottom-box text-center mb-3">
|
104
|
-
<img class="w-100 lazyload"
|
105
|
-
data-src="<%= asset_path('homepage/promo_banner_right.jpg') %>"
|
106
|
-
data-srcset="<%= image_source_set('homepage/promo_banner_right') %>"
|
107
|
-
alt="Summer Sale">
|
108
|
-
|
109
|
-
<div class="homepage-bottom-box-inner">
|
110
|
-
<div class="homepage-bottom-box-inner-small-text">
|
111
|
-
Summer Sale
|
112
|
-
</div>
|
113
|
-
<div class="homepage-bottom-box-inner-big-text">
|
114
|
-
Up To 60%
|
115
|
-
</div>
|
116
|
-
</div>
|
117
|
-
</div>
|
118
|
-
<% end %>
|
119
|
-
</div>
|
120
|
-
</div>
|
121
|
-
</div>
|
22
|
+
<%= render "spree/shared/cms/pages/edit_mode", edit_mode: @edit_mode %>
|
@@ -8,12 +8,13 @@
|
|
8
8
|
<%= render partial: 'spree/shared/head' %>
|
9
9
|
</head>
|
10
10
|
<body class="<%= body_class %>" id="<%= @body_id || 'default' %>" data-hook="body">
|
11
|
+
<%= render partial: 'spree/shared/get_started' %>
|
11
12
|
<%= render partial: 'spree/shared/header' %>
|
12
13
|
<div id="overlay" class="overlay hide-on-esc"></div>
|
13
14
|
|
14
15
|
<div data-hook>
|
15
|
-
|
16
|
-
|
16
|
+
<%= flash_messages %>
|
17
|
+
<main class="col-12" id="content" data-hook>
|
17
18
|
<%= yield %>
|
18
19
|
</main>
|
19
20
|
|
@@ -1,25 +1,22 @@
|
|
1
1
|
<h3 class="pt-4 font-weight-bold text-uppercase product-details-subtitle"><%= Spree.t(:description) %></h3>
|
2
|
-
<div id="product-description-short" class="m-0 text-break product-description" data-hook="description">
|
3
|
-
<% if Spree::Config[:show_raw_product_description] %>
|
4
|
-
<%= raw product_description(@product).truncate(450) %>
|
5
|
-
<% else %>
|
6
|
-
<%= sanitize product_description(@product).truncate(450) %>
|
7
|
-
<% end %>
|
8
|
-
</div>
|
9
2
|
|
10
|
-
|
11
|
-
|
3
|
+
<% if Spree::Config[:show_raw_product_description] || product_wysiwyg_editor_enabled? %>
|
4
|
+
<div id="product-description-long" class="m-0 text-break product-description" data-hook="description">
|
12
5
|
<%= raw product_description(@product) %>
|
13
|
-
|
6
|
+
</div>
|
7
|
+
<% else %>
|
8
|
+
<div id="product-description-short" class="m-0 text-break product-description" data-hook="short-description">
|
9
|
+
<%= sanitize product_description(@product).truncate(450) %>
|
10
|
+
</div>
|
11
|
+
<div id="product-description-long" class="m-0 text-break product-description d-none" data-hook="description">
|
14
12
|
<%= sanitize product_description(@product) %>
|
13
|
+
</div>
|
14
|
+
<% if product_description(@product).length > 450 %>
|
15
|
+
<span id="product-description-arrow" class="d-flex justify-content-center align-items-center mt-3 mx-auto product-description-arrow" aria-hidden="true">
|
16
|
+
<%= icon(name: 'arrow-right',
|
17
|
+
classes: 'spree-icon-arrow spree-icon-arrow-down',
|
18
|
+
width: 20,
|
19
|
+
height: 20) %>
|
20
|
+
</span>
|
15
21
|
<% end %>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<% if product_description(@product).length > 450 %>
|
19
|
-
<span id="product-description-arrow" class="d-flex justify-content-center align-items-center mt-3 mx-auto product-description-arrow" aria-hidden="true">
|
20
|
-
<%= icon(name: 'arrow-right',
|
21
|
-
classes: 'spree-icon-arrow spree-icon-arrow-down',
|
22
|
-
width: 20,
|
23
|
-
height: 20) %>
|
24
|
-
</span>
|
25
22
|
<% end %>
|
@@ -1,11 +1,13 @@
|
|
1
|
-
<% cache
|
1
|
+
<% cache filters_cache_key('desktop') do %>
|
2
2
|
<div id="plp-filters-accordion" class="d-none d-lg-block col-lg-3 pr-5 position-sticky h-100 plp-filters" data-hook="taxon_sidebar_navigation">
|
3
|
+
<%= clear_all_filters_link(permitted_params) if product_filters_present?(permitted_params) %>
|
4
|
+
|
3
5
|
<div class="plp-filters-scroller">
|
4
|
-
<%
|
6
|
+
<% available_option_types.each do |option_type| %>
|
5
7
|
<div class="w-100 card plp-filters-card">
|
6
|
-
<%
|
7
|
-
<% option_type_name =
|
8
|
-
<% collapsed = params[
|
8
|
+
<% ot_filter_param = option_type.filter_param %>
|
9
|
+
<% option_type_name = ot_filter_param.titleize %>
|
10
|
+
<% collapsed = params[ot_filter_param].blank? %>
|
9
11
|
|
10
12
|
<button class="card-header <%= 'collapsed' if collapsed %> px-1 plp-filters-card-header" id="filters<%= option_type_name %>" data-toggle="collapse" data-target="#collapseFilter<%= option_type_name %>" aria-expanded="<%= !collapsed %>" aria-controls="collapseFilter<%= option_type_name %>" role="heading" aria-level="2">
|
11
13
|
<%= option_type.presentation %>
|
@@ -21,14 +23,43 @@
|
|
21
23
|
<div id="collapseFilter<%= option_type_name %>" class="collapse <%= 'show' unless collapsed %>" aria-labelledby="filters<%= option_type_name %>">
|
22
24
|
<div class="card-body px-0 pt-1">
|
23
25
|
<%= render 'spree/shared/option_values',
|
24
|
-
params_ot_downcase_name: params[ot_downcase_name],
|
25
26
|
option_type: option_type,
|
26
|
-
permitted_params: permitted_params
|
27
|
-
ot_downcase_name: ot_downcase_name %>
|
27
|
+
permitted_params: permitted_params %>
|
28
28
|
</div>
|
29
29
|
</div>
|
30
30
|
</div>
|
31
31
|
<% end %>
|
32
|
+
|
33
|
+
<% available_properties.each do |property| %>
|
34
|
+
<% if property.uniq_values.present? %>
|
35
|
+
<div class="w-100 card plp-filters-card">
|
36
|
+
<% property_name = property.name %>
|
37
|
+
<% collapsed = params.dig(:properties, property.filter_param).blank? %>
|
38
|
+
<button class="card-header <%= 'collapsed' if collapsed %> px-1 plp-filters-card-header" id="filters<%= property_name %>" data-toggle="collapse" data-target="#collapseFilter<%= property_name %>" aria-expanded="<%= !collapsed %>" aria-controls="collapseFilter<%= property_name %>" role="heading" aria-level="2">
|
39
|
+
<%= property.presentation.titleize %>
|
40
|
+
<%= icon(name: 'plus',
|
41
|
+
classes: 'mt-1 float-right arrow plp-filters-card-header-arrow--plus',
|
42
|
+
width: 16,
|
43
|
+
height: 16) %>
|
44
|
+
<%= icon(name: 'minus',
|
45
|
+
classes: 'mt-1 float-right arrow plp-filters-card-header-arrow--minus',
|
46
|
+
width: 16,
|
47
|
+
height: 16) %>
|
48
|
+
</button>
|
49
|
+
<div id="collapseFilter<%= property_name %>" class="collapse <%= 'show' unless collapsed %>" aria-labelledby="filters<%= property_name %>">
|
50
|
+
<div class="card-body px-0 pt-1">
|
51
|
+
<%= render 'spree/shared/properties',
|
52
|
+
params_property_name: params[property_name],
|
53
|
+
property: property,
|
54
|
+
permitted_params: permitted_params,
|
55
|
+
property_name: property_name
|
56
|
+
%>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
<% end %>
|
61
|
+
<% end %>
|
62
|
+
|
32
63
|
<% price_collapsed = params[:price].blank? %>
|
33
64
|
<div class="w-100 card plp-filters-card">
|
34
65
|
<button class="card-header text-capitalize <%= 'collapsed' if price_collapsed %> px-1 plp-filters-card-header" id="filtersPrice" data-toggle="collapse" data-target="#collapseFilterPrice" aria-expanded="<% !price_collapsed %>" aria-controls="collapseFilterPrice" role="heading" aria-level="2">
|
@@ -44,14 +75,18 @@
|
|
44
75
|
</button>
|
45
76
|
<div id="collapseFilterPrice" class="collapse <%= 'show' unless price_collapsed %>" aria-labelledby="filtersPrice">
|
46
77
|
<div class="card-body px-0 pt-1">
|
47
|
-
<%
|
48
|
-
|
49
|
-
<%= link_to permitted_params.merge({ price: price_param }), class: "d-block" do %>
|
50
|
-
<div class="d-inline-block py-1 px-2 m-1 text-uppercase plp-filters-card-item <%= 'plp-filters-card-item--selected' if params[:price] == name %>">
|
51
|
-
<%= name %>
|
52
|
-
</div>
|
53
|
-
<% end %>
|
78
|
+
<% price_filters.each do |price_range| %>
|
79
|
+
<%= price_filter_link(price_range, permitted_params) %>
|
54
80
|
<% end %>
|
81
|
+
|
82
|
+
<div id="filterPriceRangeDesktop" class="m-1">
|
83
|
+
<div class="d-inline-flex mb-2">
|
84
|
+
<%= min_price_filter_input class: 'w-50 p-2 mr-1' %>
|
85
|
+
<%= max_price_filter_input class: 'w-50 p-2' %>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<%= link_to Spree.t('plp.done'), permitted_params, class: 'btn btn-primary spree-btn w-100', data: { params: permitted_params } %>
|
89
|
+
</div>
|
55
90
|
</div>
|
56
91
|
</div>
|
57
92
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% is_visible = params[:menu_open] ? 'block' : 'none' %>
|
2
2
|
|
3
3
|
<div id="filter-by-overlay" class="d-lg-none plp-overlay" style="display: <%= is_visible %>;">
|
4
|
-
<% cache
|
4
|
+
<% cache filters_cache_key('mobile') do %>
|
5
5
|
<div class="plp-scroll">
|
6
6
|
<div class="container">
|
7
7
|
<div class="plp-overlay-header">
|
@@ -30,6 +30,32 @@
|
|
30
30
|
</div>
|
31
31
|
<% end %>
|
32
32
|
|
33
|
+
<% available_properties.each do |property| %>
|
34
|
+
<% if property.uniq_values.present? %>
|
35
|
+
<% property_name = property.name %>
|
36
|
+
<% collapsed = params.dig(:properties, property.filter_param).blank? %>
|
37
|
+
<div class="card plp-overlay-card">
|
38
|
+
<div class="card-header text-uppercase <%= 'collapsed' if collapsed %> plp-overlay-card-header" data-toggle="collapse" id="filtersMobile<%= property_name %>" data-target="#collapseFilterMobile<%= property_name %>" aria-expanded="true" aria-controls="collapseFilterMobile<%= property_name %>" role="heading" aria-level="3">
|
39
|
+
<%= property_name %>
|
40
|
+
<%= icon(name: 'arrow-right',
|
41
|
+
classes: 'spree-icon-arrow spree-icon-arrow-right mt-1 float-right arrow plp-overlay-card-header-arrow',
|
42
|
+
width: 16,
|
43
|
+
height: 16) %>
|
44
|
+
</div>
|
45
|
+
<div id="collapseFilterMobile<%= property_name %>" class="collapse <%= 'show' unless collapsed %>" aria-labelledby="filtersMobile<%= property_name %>" data-parent="#filters-accordion">
|
46
|
+
<div class="card-body pt-1">
|
47
|
+
<%= render 'spree/shared/properties',
|
48
|
+
params_property_name: params[property_name],
|
49
|
+
property: property,
|
50
|
+
permitted_params: permitted_params,
|
51
|
+
property_name: property_name
|
52
|
+
%>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
<% end %>
|
57
|
+
<% end %>
|
58
|
+
|
33
59
|
<div class="card plp-overlay-card">
|
34
60
|
<div class="card-header text-uppercase <%= 'collapsed' if params[:price].blank? %> plp-overlay-card-header" id="headingFour" data-toggle="collapse" data-target="#collapseFour" aria-expanded="true" aria-controls="collapseFour" role="heading" aria-level="3">
|
35
61
|
<%= Spree.t('plp.price') %>
|
@@ -40,14 +66,16 @@
|
|
40
66
|
</div>
|
41
67
|
<div id="collapseFour" class="collapse <%= 'show' unless params[:price].blank? %>" aria-labelledby="headingFour" data-parent="#filters-accordion">
|
42
68
|
<div class="card-body pt-1">
|
43
|
-
<%
|
44
|
-
|
45
|
-
<%= link_to permitted_params.merge(price: price_param, menu_open: 1), data: { params: permitted_params.merge(price: price_param, menu_open: 1), filter_name: 'price' } do %>
|
46
|
-
<div class="d-inline-block py-1 px-2 m-1 text-uppercase plp-overlay-card-item <%= 'plp-overlay-card-item--selected' if params[:price] == name %>">
|
47
|
-
<%= name %>
|
48
|
-
</div>
|
49
|
-
<% end %>
|
69
|
+
<% price_filters.each do |price_range| %>
|
70
|
+
<%= price_filter_link(price_range, permitted_params) %>
|
50
71
|
<% end %>
|
72
|
+
|
73
|
+
<div id="filterPriceRangeMobile" class="m-1">
|
74
|
+
<div class="d-inline-flex">
|
75
|
+
<%= min_price_filter_input class: 'w-50 p-2 mr-1' %>
|
76
|
+
<%= max_price_filter_input class: 'w-50 p-2' %>
|
77
|
+
</div>
|
78
|
+
</div>
|
51
79
|
</div>
|
52
80
|
</div>
|
53
81
|
</div>
|
@@ -60,7 +88,7 @@
|
|
60
88
|
<% end %>
|
61
89
|
|
62
90
|
<div class="container position-absolute text-center plp-overlay-buttons pt-3">
|
63
|
-
<%=
|
64
|
-
<%= link_to Spree.t('plp.done'), permitted_params, class: 'btn btn-primary spree-btn w-100 done-btn', data: { params: permitted_params } %>
|
91
|
+
<%= clear_all_filters_link(permitted_params) %>
|
92
|
+
<%= link_to Spree.t('plp.done'), permitted_params, id: 'filterProductsButtonMobile', class: 'btn btn-primary spree-btn w-100 done-btn', data: { params: permitted_params } %>
|
65
93
|
</div>
|
66
94
|
</div>
|
@@ -10,21 +10,27 @@
|
|
10
10
|
width: 18,
|
11
11
|
height: 18) %>
|
12
12
|
</a>
|
13
|
-
|
14
13
|
<div class="dropdown-menu text-right plp-sort-dropdown">
|
15
14
|
<ul class="pt-1 plp-sort-dropdown-ul">
|
16
15
|
<li class="p-3 plp-sort-dropdown-ul-li<%= '--active' if params[:sort_by].blank? %>">
|
17
16
|
<%= link_to Spree.t('plp.default'), url_for(permitted_params.merge(sort_by: nil)), class: 'dropdown-item' %>
|
18
17
|
</li>
|
19
|
-
<li class="p-3 plp-sort-dropdown-ul-li<%= '--active' if params[:sort_by] == '
|
20
|
-
<%= link_to Spree.t('plp.
|
18
|
+
<li class="p-3 plp-sort-dropdown-ul-li<%= '--active' if params[:sort_by] == 'name-a-z' %>">
|
19
|
+
<%= link_to Spree.t('plp.name_a_z'), url_for(permitted_params.merge(sort_by: 'name-a-z')), class: 'dropdown-item' %>
|
21
20
|
</li>
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
</
|
29
|
-
|
21
|
+
</li>
|
22
|
+
<li class="p-3 plp-sort-dropdown-ul-li<%= '--active' if params[:sort_by] == 'name-z-a' %>">
|
23
|
+
<%= link_to Spree.t('plp.name_z_a'), url_for(permitted_params.merge(sort_by: 'name-z-a')), class: 'dropdown-item' %>
|
24
|
+
</li>
|
25
|
+
<li class="p-3 plp-sort-dropdown-ul-li<%= '--active' if params[:sort_by] == 'newest-first' %>">
|
26
|
+
<%= link_to Spree.t('plp.newest_first'), url_for(permitted_params.merge(sort_by: 'newest-first')), class: 'dropdown-item' %>
|
27
|
+
</li>
|
28
|
+
<li class="p-3 plp-sort-dropdown-ul-li<%= '--active' if params[:sort_by] == 'price-high-to-low' %>">
|
29
|
+
<%= link_to Spree.t('plp.price_high_to_low'), url_for(permitted_params.merge(sort_by: 'price-high-to-low')), class: 'dropdown-item' %>
|
30
|
+
</li>
|
31
|
+
<li class="p-3 plp-sort-dropdown-ul-li<%= '--active' if params[:sort_by] == 'price-low-to-high' %>">
|
32
|
+
<%= link_to Spree.t('plp.price_low_to_high'), url_for(permitted_params.merge(sort_by: 'price-low-to-high')), class: 'dropdown-item' %>
|
33
|
+
</li>
|
34
|
+
</ul>
|
35
|
+
</div>
|
30
36
|
</div>
|