spree_storefront 5.0.5 → 5.1.0.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/concerns/spree/locale_urls.rb +13 -1
- data/app/controllers/concerns/spree/storefront/devise_concern.rb +42 -0
- data/app/controllers/spree/addresses_controller.rb +5 -1
- data/app/controllers/spree/checkout_controller.rb +27 -9
- data/app/controllers/spree/contacts_controller.rb +1 -1
- data/app/controllers/spree/line_items_controller.rb +7 -14
- data/app/controllers/spree/products_controller.rb +2 -4
- data/app/controllers/spree/search_controller.rb +1 -1
- data/app/controllers/spree/store_controller.rb +31 -26
- data/app/controllers/spree/taxons_controller.rb +1 -3
- data/app/helpers/spree/analytics_helper.rb +6 -2
- data/app/helpers/spree/cart_helper.rb +1 -1
- data/app/helpers/spree/checkout_analytics_helper.rb +1 -1
- data/app/helpers/spree/checkout_helper.rb +1 -1
- data/app/helpers/spree/filters_helper.rb +2 -6
- data/app/helpers/spree/page_helper.rb +15 -0
- data/app/helpers/spree/products_helper.rb +14 -6
- data/app/helpers/spree/storefront_helper.rb +12 -1
- data/app/helpers/spree/storefront_locale_helper.rb +3 -0
- data/app/helpers/spree/theme_helper.rb +76 -0
- data/app/helpers/spree/wishlist_helper.rb +3 -0
- data/app/javascript/spree/storefront/controllers/card_validation_controller.js +0 -2
- data/app/javascript/spree/storefront/controllers/cart_controller.js +0 -5
- data/app/javascript/spree/storefront/controllers/product_form_controller.js +21 -18
- data/app/javascript/spree/storefront/controllers/slideover_controller.js +2 -0
- data/app/views/devise/passwords/edit.html.erb +1 -1
- data/app/views/devise/registrations/_form.html.erb +2 -2
- data/app/views/devise/registrations/new.html.erb +1 -1
- data/app/views/devise/sessions/new.html.erb +16 -0
- data/app/views/devise/shared/_links.html.erb +3 -3
- data/app/views/spree/account/wished_items/create.turbo_stream.erb +1 -0
- data/app/views/spree/addresses/edit.html.erb +6 -2
- data/app/views/spree/addresses/new.html.erb +3 -0
- data/app/views/spree/checkout/_address.html.erb +4 -3
- data/app/views/spree/checkout/_coupon_code.html.erb +1 -1
- data/app/views/spree/checkout/_delivery.html.erb +2 -1
- data/app/views/spree/checkout/_missing_all_line_items.html.erb +2 -2
- data/app/views/spree/checkout/_payment_methods.html.erb +1 -1
- data/app/views/spree/checkout/_summary.html.erb +44 -45
- data/app/views/spree/checkout/edit.html.erb +5 -3
- data/app/views/spree/checkout/payment/_gateway.html.erb +12 -12
- data/app/views/spree/line_items/create.turbo_stream.erb +1 -0
- data/app/views/spree/line_items/destroy.turbo_stream.erb +10 -14
- data/app/views/spree/products/show.html.erb +2 -1
- data/app/views/spree/seo/sitemap.xml.erb +2 -2
- data/app/views/themes/default/spree/account/_order.html.erb +5 -5
- data/app/views/themes/default/spree/account/addresses/_address.html.erb +14 -4
- data/app/views/themes/default/spree/account/addresses/_edit_address_modal.html.erb +38 -0
- data/app/views/themes/default/spree/account/addresses/_new_address_modal.html.erb +38 -0
- data/app/views/themes/default/spree/account/addresses/index.html.erb +22 -2
- data/app/views/themes/default/spree/checkout/complete.html.erb +1 -1
- data/app/views/themes/default/spree/orders/_line_item.html.erb +3 -3
- data/app/views/themes/default/spree/orders/edit.html.erb +2 -0
- data/app/views/themes/default/spree/page_sections/_featured_product.html.erb +1 -1
- data/app/views/themes/default/spree/page_sections/_featured_taxon.html.erb +2 -2
- data/app/views/themes/default/spree/page_sections/_featured_taxons.html.erb +5 -4
- data/app/views/themes/default/spree/policies/show.html.erb +7 -11
- data/app/views/themes/default/spree/posts/_post.html.erb +11 -20
- data/app/views/themes/default/spree/products/_add_to_cart_button.html.erb +12 -6
- data/app/views/themes/default/spree/products/_details.html.erb +1 -1
- data/app/views/themes/default/spree/products/_json_ld.html.erb +1 -1
- data/app/views/themes/default/spree/products/_json_ld_variant.html.erb +1 -1
- data/app/views/themes/default/spree/products/_media_gallery.html.erb +2 -1
- data/app/views/themes/default/spree/products/filters/_availability.html.erb +1 -1
- data/app/views/themes/default/spree/products/filters/_price.html.erb +4 -4
- data/app/views/themes/default/spree/products/filters/_taxons.erb +5 -5
- data/app/views/themes/default/spree/shared/_cart_icon.html.erb +2 -4
- data/app/views/themes/default/spree/shared/_cart_pane.html.erb +2 -5
- data/app/views/themes/default/spree/shared/_error_messages.html.erb +1 -1
- data/app/views/themes/default/spree/shared/_meta_tags.html.erb +2 -2
- data/config/locales/en.yml +0 -8
- data/lib/generators/spree/storefront/devise/devise_generator.rb +47 -0
- data/lib/generators/spree/storefront/devise/templates/user_passwords_controller.rb +17 -0
- data/lib/generators/spree/storefront/devise/templates/user_registrations_controller.rb +17 -0
- data/lib/generators/spree/storefront/devise/templates/user_sessions_controller.rb +17 -0
- data/lib/generators/spree/storefront/theme/templates/model.rb.tt +4 -91
- data/lib/spree/storefront/engine.rb +7 -1
- metadata +13 -7
- data/app/views/themes/default/spree/page_sections/_featured_posts.html.erb +0 -56
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="form-group mb-3 relative">
|
12
12
|
<% options_hash = Rails.env.production? ? {autocomplete: 'off'} : {} %>
|
13
13
|
<label for="card_number" class="block text-xs text-neutral-600 mb-1"><%= Spree.t(:card_number) %></label>
|
14
|
-
<%= text_field_tag "#{param_prefix}[number]", '',
|
14
|
+
<%= text_field_tag "#{param_prefix}[number]", '',
|
15
15
|
options_hash.merge(
|
16
16
|
id: 'card_number',
|
17
17
|
data: { card_validation_target: "number" },
|
@@ -23,7 +23,7 @@
|
|
23
23
|
required: true
|
24
24
|
)
|
25
25
|
%>
|
26
|
-
<div class="absolute right-2 top-7"
|
26
|
+
<div class="absolute right-2 top-7"
|
27
27
|
data-card-validation-target="typeContainer"
|
28
28
|
id="credit-card-type-container">
|
29
29
|
</div>
|
@@ -32,37 +32,37 @@
|
|
32
32
|
<div class="flex gap-3">
|
33
33
|
<div class="form-group">
|
34
34
|
<label for="card_expiry" class="block text-xs text-neutral-600 mb-1"><%= Spree.t(:expiration_date) %></label>
|
35
|
-
<%= text_field_tag "#{param_prefix}[expiry]", '',
|
36
|
-
id: 'card_expiry',
|
35
|
+
<%= text_field_tag "#{param_prefix}[expiry]", '',
|
36
|
+
id: 'card_expiry',
|
37
37
|
class: 'text-input',
|
38
38
|
data: {
|
39
39
|
card_validation_target: "expiry"
|
40
40
|
},
|
41
|
-
placeholder:
|
41
|
+
placeholder: "MM/YYYY",
|
42
42
|
required: true
|
43
43
|
%>
|
44
44
|
</div>
|
45
45
|
<div class="form-group">
|
46
46
|
<label for="card_code" class="block text-xs text-neutral-600 mb-1"><%= Spree.t(:cvv) %></label>
|
47
|
-
<%= text_field_tag "#{param_prefix}[verification_value]", '',
|
47
|
+
<%= text_field_tag "#{param_prefix}[verification_value]", '',
|
48
48
|
options_hash.merge(
|
49
|
-
id: 'card_code',
|
50
|
-
class: 'text-input',
|
49
|
+
id: 'card_code',
|
50
|
+
class: 'text-input',
|
51
51
|
data: { card_validation_target: "cvv" },
|
52
52
|
size: 4,
|
53
53
|
maxlength: 4,
|
54
54
|
pattern: '[0-9]*',
|
55
55
|
inputmode: 'numeric',
|
56
|
-
placeholder: Spree.t(:cvv),
|
56
|
+
placeholder: Spree.t(:cvv),
|
57
57
|
required: true
|
58
|
-
)
|
58
|
+
)
|
59
59
|
%>
|
60
60
|
</div>
|
61
61
|
</div>
|
62
62
|
|
63
|
-
<%= hidden_field_tag "#{param_prefix}[cc_type]", '',
|
63
|
+
<%= hidden_field_tag "#{param_prefix}[cc_type]", '',
|
64
64
|
id: "cc_type",
|
65
|
-
data: { card_validation_target: "ccType" }
|
65
|
+
data: { card_validation_target: "ccType" }
|
66
66
|
%>
|
67
67
|
|
68
68
|
<% PaymentIcon.credit_cards.each do |card| %>
|
@@ -1,17 +1,13 @@
|
|
1
|
-
|
2
|
-
<%=
|
3
|
-
<%
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<%= render 'spree/orders/empty' %>
|
8
|
-
<% else %>
|
9
|
-
<%= render 'spree/orders/cart' %>
|
10
|
-
<% end %>
|
11
|
-
|
12
|
-
<%= render_storefront_partials(:remove_from_cart_partials) %>
|
1
|
+
<%= turbo_stream.replace_all '.cart-contents' do %>
|
2
|
+
<%= turbo_frame_tag cart_id(@order), class: 'cart-contents' do %>
|
3
|
+
<% if @order.line_items.empty? %>
|
4
|
+
<%= render 'spree/orders/empty' %>
|
5
|
+
<% else %>
|
6
|
+
<%= render 'spree/orders/cart' %>
|
13
7
|
<% end %>
|
14
|
-
<% end %>
|
15
8
|
|
16
|
-
|
9
|
+
<%= render_storefront_partials(:remove_from_cart_partials) %>
|
10
|
+
<% end %>
|
17
11
|
<% end %>
|
12
|
+
|
13
|
+
<%= spree_turbo_update_cart(@order) %>
|
@@ -1 +1,2 @@
|
|
1
|
-
<%= render_page(current_page_or_preview, product: @product) %>
|
1
|
+
<%= render_page(current_page_or_preview, product: @product) %>
|
2
|
+
<%= render_storefront_partials(:product_partials) %>
|
@@ -12,8 +12,8 @@
|
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
14
14
|
|
15
|
-
<% cache [
|
16
|
-
<%
|
15
|
+
<% cache [current_store.products, current_currency] do %>
|
16
|
+
<% current_store.products.active(current_currency).find_each do |product| %>
|
17
17
|
<url>
|
18
18
|
<loc><%= spree_storefront_resource_url(product) %></loc>
|
19
19
|
<lastmod><%= product.updated_at.strftime('%Y-%m-%d') %></lastmod>
|
@@ -8,16 +8,16 @@
|
|
8
8
|
<% if order.payment_state == 'void' %>
|
9
9
|
<% if order.order_refunded? %>
|
10
10
|
<span class="badge-refunded">
|
11
|
-
<%= Spree.t("payment_states.refunded") %>
|
11
|
+
<%= Spree.t("payment_states.refunded").titleize %>
|
12
12
|
</span>
|
13
13
|
<% else %>
|
14
14
|
<span class="badge-void">
|
15
|
-
<%= Spree.t("payment_states.#{order.payment_state}") %>
|
15
|
+
<%= Spree.t("payment_states.#{order.payment_state}").titleize %>
|
16
16
|
</span>
|
17
17
|
<% end %>
|
18
18
|
<% else %>
|
19
19
|
<span class="badge-success">
|
20
|
-
<%= Spree.t("payment_states.#{order.payment_state}") %>
|
20
|
+
<%= Spree.t("payment_states.#{order.payment_state}").titleize %>
|
21
21
|
</span>
|
22
22
|
<% end %>
|
23
23
|
<% end %>
|
@@ -26,11 +26,11 @@
|
|
26
26
|
<% if order.shipment_state %>
|
27
27
|
<% if order.shipment_state == 'shipped' %>
|
28
28
|
<span class="badge-success">
|
29
|
-
<%= Spree.t("shipment_states.#{order.shipment_state}") %>
|
29
|
+
<%= Spree.t("shipment_states.#{order.shipment_state}").titleize %>
|
30
30
|
</span>
|
31
31
|
<% else %>
|
32
32
|
<span class="badge-<%= order.shipment_state %>">
|
33
|
-
<%= Spree.t("shipment_states.#{order.shipment_state}") %>
|
33
|
+
<%= Spree.t("shipment_states.#{order.shipment_state}").titleize %>
|
34
34
|
</span>
|
35
35
|
<% end %>
|
36
36
|
<% end %>
|
@@ -1,10 +1,20 @@
|
|
1
1
|
<li class="p-4 my-4 border border-accent lg:flex justify-between relative" id="<%= dom_id(address) %>">
|
2
2
|
<%= render 'spree/shared/address', address: address %>
|
3
3
|
<div class="flex gap-6 h-6 lg:h-10 mt-6 lg:mt-0">
|
4
|
-
|
5
|
-
<%=
|
6
|
-
|
7
|
-
|
4
|
+
<div data-controller="modal" data-modal-allow-background-close="true">
|
5
|
+
<%= button_tag type: "button", class: 'flex gap-2 lg:p-2', data: { action: "click->modal#open" } do %>
|
6
|
+
<%= render 'spree/shared/icons/edit' %>
|
7
|
+
<span class="uppercase text-sm font-semibold tracking-widest"><%= Spree.t(:edit) %></span>
|
8
|
+
<% end %>
|
9
|
+
<%= turbo_frame_tag "edit_address_modal_#{address.id}",
|
10
|
+
src: spree.edit_address_path(address),
|
11
|
+
loading: :lazy,
|
12
|
+
data: {
|
13
|
+
modal_target: "container",
|
14
|
+
action: "click->modal#closeBackground keyup@window->modal#closeWithKeyboard"
|
15
|
+
},
|
16
|
+
class: "hidden animated fadeIn fixed inset-0 overflow-y-auto flex items-center justify-center z-[9999]" %>
|
17
|
+
</div>
|
8
18
|
<div
|
9
19
|
data-controller="modal"
|
10
20
|
data-modal-allow-background-close="true"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div class="bg-white h-[90vh] lg:h-[70vh] w-full lg:w-1/3 flex flex-col overflow-hidden">
|
2
|
+
<%= form_for @address, method: :put, html: { class: "flex flex-col h-full", data: { turbo_frame: "_top" } } do |f| %>
|
3
|
+
<div class="px-8 py-6 border-b shrink-0">
|
4
|
+
<div class="flex justify-between items-center">
|
5
|
+
<h3 class="text-xl lg:text-2xl font-medium lg:font-semibold capitalize">
|
6
|
+
<%= Spree.t(:edit_address) %>
|
7
|
+
</h3>
|
8
|
+
<button data-action="click->modal#close" class="ml-4">
|
9
|
+
<%= render 'spree/shared/icons/close' %>
|
10
|
+
<span class="sr-only"><%= Spree.t(:close) %></span>
|
11
|
+
</button>
|
12
|
+
</div>
|
13
|
+
<%= render 'spree/shared/error_messages', target: @address, class: 'alert-error text-center mt-4 p-2' %>
|
14
|
+
</div>
|
15
|
+
<div class="overflow-y-auto px-8 py-2 grow">
|
16
|
+
<div class="py-4 text-left">
|
17
|
+
<%= render 'spree/addresses/form',
|
18
|
+
address_name: 'address',
|
19
|
+
address_form: f,
|
20
|
+
address_type: 'shipping',
|
21
|
+
address: @address %>
|
22
|
+
</div>
|
23
|
+
<%= label_tag "default_shipping", class: "flex items-center gap-2 text-sm mb-4" do %>
|
24
|
+
<%= check_box_tag "default_shipping", "true", @address.user_default_shipping?, class: 'input-checkbox input-address-default', disabled: @address.user_default_shipping? %>
|
25
|
+
<%= Spree.t('address_book.set_as_default_delivery_address') %>
|
26
|
+
<% end %>
|
27
|
+
<%= label_tag "default_billing", class: "flex items-center gap-2 text-sm mb-4" do %>
|
28
|
+
<%= check_box_tag "default_billing", "true", @address.user_default_billing?, class: 'input-checkbox input-address-default', disabled: @address.user_default_billing? %>
|
29
|
+
<%= Spree.t('address_book.set_as_default_billing_address') %>
|
30
|
+
<% end %>
|
31
|
+
</div>
|
32
|
+
<div class="border-t border-default px-8 py-4 flex justify-end gap-8 shrink-0">
|
33
|
+
<%= button_tag Spree.t(:cancel), class: 'uppercase text-sm font-semibold', data: { action: 'click->modal#close' } %>
|
34
|
+
<%= hidden_field_tag :from_modal, "true" %>
|
35
|
+
<%= f.submit Spree.t(:update), class: 'btn-primary w-48' %>
|
36
|
+
</div>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div class="bg-white h-[90vh] lg:h-[70vh] w-full lg:w-1/3 flex flex-col overflow-hidden">
|
2
|
+
<%= form_for @address, html: { class: "flex flex-col h-full", data: { turbo_frame: "_top" } } do |f| %>
|
3
|
+
<div class="px-8 py-6 border-b shrink-0">
|
4
|
+
<div class="flex justify-between items-center">
|
5
|
+
<h3 class="text-xl lg:text-2xl font-medium lg:font-semibold capitalize">
|
6
|
+
<%= Spree.t(:add_address) %>
|
7
|
+
</h3>
|
8
|
+
<button data-action="click->modal#close" class="ml-4">
|
9
|
+
<%= render 'spree/shared/icons/close' %>
|
10
|
+
<span class="sr-only"><%= Spree.t(:close) %></span>
|
11
|
+
</button>
|
12
|
+
</div>
|
13
|
+
<%= render 'spree/shared/error_messages', target: @address, class: 'alert-error text-center mt-4 p-2' %>
|
14
|
+
</div>
|
15
|
+
<div class="overflow-y-auto px-8 py-2 grow">
|
16
|
+
<div class="py-4 text-left">
|
17
|
+
<%= render 'spree/addresses/form',
|
18
|
+
address_name: 'address',
|
19
|
+
address_form: f,
|
20
|
+
address_type: 'shipping',
|
21
|
+
address: @address %>
|
22
|
+
</div>
|
23
|
+
<%= label_tag "default_shipping", class: "flex items-center gap-2 text-sm mb-4" do %>
|
24
|
+
<%= check_box_tag "default_shipping", "true", true, class: 'input-checkbox' %>
|
25
|
+
<%= Spree.t('address_book.set_as_default_delivery_address') %>
|
26
|
+
<% end %>
|
27
|
+
<%= label_tag "default_billing", class: "flex items-center gap-2 text-sm mb-4" do %>
|
28
|
+
<%= check_box_tag "default_billing", "true", true, class: 'input-checkbox' %>
|
29
|
+
<%= Spree.t('address_book.set_as_default_billing_address') %>
|
30
|
+
<% end %>
|
31
|
+
</div>
|
32
|
+
<div class="border-t border-default px-8 py-4 flex justify-end gap-8 shrink-0">
|
33
|
+
<%= button_tag Spree.t(:cancel), class: 'uppercase text-sm font-semibold', data: { action: 'click->modal#close' } %>
|
34
|
+
<%= hidden_field_tag :from_modal, "true" %>
|
35
|
+
<%= f.submit Spree.t(:add), class: 'btn-primary w-48', data: { test_id: 'add-address-button' } %>
|
36
|
+
</div>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
@@ -12,14 +12,34 @@
|
|
12
12
|
<%= render partial: 'spree/account/addresses/address', collection: @addresses, cached: ->a {[*spree_base_cache_scope.call(a), try_spree_current_user.ship_address_id, try_spree_current_user.bill_address_id]}, as: :address %>
|
13
13
|
</ul>
|
14
14
|
<div class="flex">
|
15
|
-
|
15
|
+
<div data-controller="modal" data-modal-allow-background-close="true">
|
16
|
+
<%= button_tag Spree.t(:add), type: "button", class: "btn-primary block w-full lg:w-auto", data: { action: "click->modal#open" } %>
|
17
|
+
<%= turbo_frame_tag :new_address_modal,
|
18
|
+
src: spree.new_address_path,
|
19
|
+
loading: :lazy,
|
20
|
+
data: {
|
21
|
+
modal_target: "container",
|
22
|
+
action: "click->modal#closeBackground keyup@window->modal#closeWithKeyboard"
|
23
|
+
},
|
24
|
+
class: "hidden animated fadeIn fixed inset-0 overflow-y-auto flex items-center justify-center z-[9999]" %>
|
25
|
+
</div>
|
16
26
|
</div>
|
17
27
|
<% else %>
|
18
28
|
<div class="text-center py-6">
|
19
29
|
<p class="mb-2 font-medium uppercase"><%= Spree.t('storefront.account.no_addresses_title') %></p>
|
20
30
|
<p><%= Spree.t('storefront.account.no_addresses_description') %></p>
|
21
31
|
<div class="flex mt-8 justify-center">
|
22
|
-
|
32
|
+
<div data-controller="modal" data-modal-allow-background-close="true">
|
33
|
+
<%= button_tag Spree.t(:add), type: "button", class: "btn-primary block", data: { action: "click->modal#open" } %>
|
34
|
+
<%= turbo_frame_tag :new_address_modal,
|
35
|
+
src: spree.new_address_path,
|
36
|
+
loading: :lazy,
|
37
|
+
data: {
|
38
|
+
modal_target: "container",
|
39
|
+
action: "click->modal#closeBackground keyup@window->modal#closeWithKeyboard"
|
40
|
+
},
|
41
|
+
class: "hidden animated fadeIn fixed inset-0 overflow-y-auto flex items-center justify-center z-[9999]" %>
|
42
|
+
</div>
|
23
43
|
</div>
|
24
44
|
</div>
|
25
45
|
<% end %>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<div class="mt-3 border-t pt-3">
|
25
25
|
<span class="text-sm"><%= Spree.t(:status) %></span>
|
26
26
|
<% if @order.payment_state.present? %>
|
27
|
-
<span class="badge-<%= @order.payment_state %>"><%= Spree.t("payment_states.#{@order.payment_state}") %></span>
|
27
|
+
<span class="badge-<%= @order.payment_state %>"><%= Spree.t("payment_states.#{@order.payment_state}").titleize %></span>
|
28
28
|
<% else %>
|
29
29
|
<span class="badge-pending"><%= Spree.t(:pending) %></span>
|
30
30
|
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<%= turbo_frame_tag dom_id(line_item) do %>
|
2
|
-
<li class="cart-line-item flex items-top py-6 px-4 w-full">
|
1
|
+
<%= turbo_frame_tag dom_id(line_item), data: { controller: 'reveal' } do %>
|
2
|
+
<li class="cart-line-item flex items-top py-6 px-4 w-full" data-reveal-target="item">
|
3
3
|
<div class="line-item-overlay"></div>
|
4
4
|
<div class="cart-product-image flex-shrink-0" id="<%= dom_id(line_item) %>-image" data-turbo-permanent>
|
5
5
|
<% image = line_item.variant.default_image %>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<%= link_to line_item.name, spree_storefront_resource_url(line_item.product), class: 'font-semibold text-text', data: { 'turbo-frame': '_top' } %>
|
15
15
|
|
16
16
|
<%= form_for line_item, url: spree.line_item_url(line_item, order_token: line_item.order.token), method: :delete, data: { controller: 'turbo-stream-form' } do |item_form| %>
|
17
|
-
<%= button_tag type: :submit, class: 'remove-line-item-button h-100', data: { action: "click->
|
17
|
+
<%= button_tag type: :submit, class: 'remove-line-item-button h-100', data: { action: "click->reveal#hide click->cart#disableCart" } do %>
|
18
18
|
<%= render 'spree/shared/icons/cross', size: 16 %>
|
19
19
|
<% end %>
|
20
20
|
<% end %>
|
@@ -89,7 +89,7 @@
|
|
89
89
|
<% if presenter.product %>
|
90
90
|
<div class="absolute flex" data-controller="copy-input">
|
91
91
|
<div class="has-float-label flex flex-col max-w-[200px]">
|
92
|
-
<%= text_field_tag "product-#{presenter.product.id}-share-link", spree.product_url(presenter.product, host: current_store.
|
92
|
+
<%= text_field_tag "product-#{presenter.product.id}-share-link", spree.product_url(presenter.product, host: current_store.url), class: 'text-ellipsis text-input border-r-0 !rounded-r-none !rounded-l-md', readonly: true, type: 'text', onclick: 'this.select()', data: { copy_input_target: 'input' } %>
|
93
93
|
<%= label_tag "product-#{presenter.product.id}-share-link", Spree.t(:link) %>
|
94
94
|
</div>
|
95
95
|
<button
|
@@ -5,7 +5,7 @@
|
|
5
5
|
when 'medium' then 'text-lg lg:text-xl font-medium'
|
6
6
|
when 'large' then 'text-xl lg:text-2xl font-medium'
|
7
7
|
end %>
|
8
|
-
<% if section.taxon&.
|
8
|
+
<% if section.taxon&.image&.attached? && section.preferred_show_taxon_image %>
|
9
9
|
<% desktop_slides_amount = 2.5 %>
|
10
10
|
<% section_with_image = true %>
|
11
11
|
<% arrows_on_top = false %>
|
@@ -47,7 +47,7 @@
|
|
47
47
|
<% if section_with_image %>
|
48
48
|
<div class='lg:col-span-5'>
|
49
49
|
<%= link_to spree.nested_taxons_path(section.taxon), data: { turbo_frame: "_top" } do %>
|
50
|
-
<%= spree_image_tag(section.taxon.
|
50
|
+
<%= spree_image_tag(section.taxon.image, height: 500, width: 500, class: 'h-full w-full object-cover object-center', loading: :lazy) %>
|
51
51
|
<% end %>
|
52
52
|
</div>
|
53
53
|
<% end %>
|
@@ -12,9 +12,9 @@
|
|
12
12
|
<div class="gap-6 grid-cols-2 sm:grid-cols-4 lg:grid-cols-6 xl:gap-x-8 mb-7 hidden md:grid">
|
13
13
|
<% section.links.each do |link| %>
|
14
14
|
<%= page_builder_link_to link, title: link.label, class: 'group block overflow-hidden', target: link.open_in_new_tab.presence && '_blank' do %>
|
15
|
-
<% if link.linkable.
|
15
|
+
<% if link.linkable.image&.attached? && link.linkable.image&.variable? %>
|
16
16
|
<div class="flex space-y-2 flex-col">
|
17
|
-
<%= spree_image_tag(link.linkable.
|
17
|
+
<%= spree_image_tag(link.linkable.image, height: 300, width: 300, class: 'h-full w-full object-cover object-center group-hover:opacity-75 rounded-md bg-gray-200', loading: :lazy, alt: link.label) %>
|
18
18
|
<span><%= link.label %></span>
|
19
19
|
</div>
|
20
20
|
<% else %>
|
@@ -47,9 +47,10 @@
|
|
47
47
|
<% section.links.each do |link| %>
|
48
48
|
<div class='swiper-slide w-[200px]'>
|
49
49
|
<%= page_builder_link_to link, title: link.label, class: 'group block overflow-hidden', target: link.open_in_new_tab.presence && '_blank' do %>
|
50
|
-
<% if link.linkable.
|
50
|
+
<% if link.linkable.image&.attached? && link.linkable.image&.variable? %>
|
51
51
|
<div class="flex space-y-2 flex-col">
|
52
|
-
<%= spree_image_tag(link.linkable.
|
52
|
+
<%= spree_image_tag(link.linkable.image, height: 200, width: 200, class: 'h-full w-full object-cover object-center group-hover:opacity-75 rounded-md bg-gray-200', loading: :lazy, alt: link.label) %>
|
53
|
+
<span><%= link.label %></span>
|
53
54
|
</div>
|
54
55
|
<% else %>
|
55
56
|
<div class="aspect-1 w-full group-hover:bg-gray-100 bg-gray-200 flex items-center justify-center relative">
|
@@ -1,15 +1,11 @@
|
|
1
1
|
<div class="page-container py-12">
|
2
2
|
<h1 class="text-2xl tracking-tight text-center lg:text-left mb-3 uppercase">
|
3
|
-
<%=
|
3
|
+
<%= params[:id].titleize %>
|
4
4
|
</h1>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<div class="mb-5">
|
12
|
-
<%= @policy&.to_s %>
|
13
|
-
</div>
|
14
|
-
<% end %>
|
5
|
+
<p class="mb-8 text-center lg:text-left">
|
6
|
+
Last update: <%= @policy&.updated_at&.strftime('%d/%m/%Y') %>
|
7
|
+
</p>
|
8
|
+
<div class="mb-5">
|
9
|
+
<%= @policy&.to_s %>
|
10
|
+
</div>
|
15
11
|
</div>
|
@@ -1,22 +1,13 @@
|
|
1
|
-
<div
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
width: 400,
|
9
|
-
height: 200,
|
10
|
-
class: "h-full w-full object-cover object-center",
|
11
|
-
loading: :lazy,
|
12
|
-
alt: post.title,
|
13
|
-
) %>
|
14
|
-
<% end %>
|
15
|
-
</div>
|
1
|
+
<div id="<%= dom_id(post) %>">
|
2
|
+
<%= link_to spree.post_path(post), class: 'block hover:opacity-70 transition-opacity' do %>
|
3
|
+
<div class="h-[200px] w-full bg-gray-100">
|
4
|
+
<% if post.image.attached? && post.image.variable? %>
|
5
|
+
<%= spree_image_tag(post.image, width: 400, height: 200, class: 'h-full w-full object-cover object-center', loading: :lazy, alt: post.title) %>
|
6
|
+
<% end %>
|
7
|
+
</div>
|
16
8
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
</div>
|
9
|
+
<h1 class="uppercase text-lg font-medium mt-4"><%= post.title %></h1>
|
10
|
+
<div class="mt-2 text-sm"><%= local_time(post.published_at, '%B %e, %Y') %></div>
|
11
|
+
<div class="mt-4"><%= post.shortened_description %></div>
|
12
|
+
<% end %>
|
22
13
|
</div>
|
@@ -16,14 +16,17 @@ variant_not_available = selected_variant.nil? ||
|
|
16
16
|
<%= button_tag type: (variant_not_available || not_all_options_selected ? 'button' : 'submit'),
|
17
17
|
class: 'btn-primary btn-icon w-full h-12 add-to-cart-button',
|
18
18
|
data: {
|
19
|
-
action:
|
19
|
+
action: [
|
20
|
+
'click->product-form#showNotSelectedOptions',
|
21
|
+
('click->modal#open' if variant_not_available)
|
22
|
+
].compact.join(' '),
|
20
23
|
product_form_target: 'submit'
|
21
24
|
},
|
22
25
|
disabled: product.price_in(current_currency).zero? do %>
|
23
26
|
<% if not_selected_options.size == 1 %>
|
24
|
-
<span><%= Spree.t(
|
27
|
+
<span><%= Spree.t(:please_select, option: not_selected_options[0].presentation) %></span>
|
25
28
|
<% elsif not_all_options_selected %>
|
26
|
-
<span><%= Spree.t(
|
29
|
+
<span><%= Spree.t(:please_select_all_options) %></span>
|
27
30
|
<% elsif variant_not_available %>
|
28
31
|
<span><%= Spree.t(:notify_me_when_available) %></span>
|
29
32
|
<%= render 'spree/shared/icons/bell' %>
|
@@ -38,14 +41,17 @@ variant_not_available = selected_variant.nil? ||
|
|
38
41
|
<%= button_tag type: (variant_not_available || not_all_options_selected ? 'button' : 'submit'),
|
39
42
|
class: 'btn-primary btn-icon w-full h-12 add-to-cart-button',
|
40
43
|
data: {
|
41
|
-
action:
|
44
|
+
action: [
|
45
|
+
'click->product-form#showNotSelectedOptions',
|
46
|
+
('click->modal#open' if variant_not_available)
|
47
|
+
].compact.join(' '),
|
42
48
|
product_form_target: 'submit'
|
43
49
|
},
|
44
50
|
disabled: product.price_in(current_currency).zero? do %>
|
45
51
|
<% if not_selected_options.size == 1 %>
|
46
|
-
<span><%= Spree.t(
|
52
|
+
<span><%= Spree.t(:please_select, option: not_selected_options[0].presentation) %></span>
|
47
53
|
<% elsif not_all_options_selected %>
|
48
|
-
<span><%= Spree.t(
|
54
|
+
<span><%= Spree.t(:please_select_all_options) %></span>
|
49
55
|
<% elsif variant_not_available %>
|
50
56
|
<span><%= Spree.t(:notify_me_when_available) %></span>
|
51
57
|
<%= render 'spree/shared/icons/bell' %>
|
@@ -39,7 +39,7 @@
|
|
39
39
|
</div>
|
40
40
|
<% end %>
|
41
41
|
|
42
|
-
<% product_properties(
|
42
|
+
<% product.product_properties.joins(:property).merge(Spree::Property.available_on_front_end).sort_by_property_position.each do |product_property| %>
|
43
43
|
<div class="product-property py-4 border-b border-default">
|
44
44
|
|
45
45
|
<%= link_to "#property_#{product_property.id}", class: 'text-sm uppercase tracking-widest inline-flex w-full justify-between !border-b-transparent', data: { action: 'accordion#toggle' } do %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
"@context": "https://schema.org/",
|
5
5
|
"@type": "Product",
|
6
6
|
"name": <%= product.name.to_json.html_safe %>,
|
7
|
-
"url": <%= spree.product_url(product
|
7
|
+
"url": <%= spree.product_url(product).to_json.html_safe %>,
|
8
8
|
<% if product.featured_image %>
|
9
9
|
"image": [
|
10
10
|
<%= spree_image_url(product.featured_image, width: 630, height: 630).to_json.html_safe %>
|
@@ -6,5 +6,5 @@
|
|
6
6
|
"availability": "http://schema.org/<%= variant.available? ? 'InStock' : 'OutOfStock' %>",
|
7
7
|
"price": <%= variant.amount_in(current_currency).to_json.html_safe %>,
|
8
8
|
"priceCurrency": <%= current_currency.to_json.html_safe %>,
|
9
|
-
"url": <%= spree.product_url(product, variant_id: variant.id
|
9
|
+
"url": <%= spree.product_url(product, variant_id: variant.id).to_json.html_safe %>
|
10
10
|
}
|
@@ -85,7 +85,8 @@
|
|
85
85
|
<div id='pinch-to-zoom' class='fixed top-0 left-0 p-4 bg-background z-50 flex justify-center items-center flex-col'>
|
86
86
|
<div class='w-14 h-14'><%= render 'spree/shared/icons/pinch' %></div>
|
87
87
|
<div class='text-sm uppercase pt-4 px-5 text-center !leading-tight'>
|
88
|
-
|
88
|
+
Pinch to <br>
|
89
|
+
zoom
|
89
90
|
</div>
|
90
91
|
</div>
|
91
92
|
<% end %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
data-accordion-close-others-value="false">
|
5
5
|
<% availability_filter_opened = permitted_products_params.dig(:filter, :purchasable).present? || permitted_products_params.dig(:filter, :out_of_stock).present? %>
|
6
6
|
<%= link_to "#availability_filter", class: "cursor-pointer uppercase flex items-center justify-between h-10 px-4 lg:px-10 text-sm tracking-widest focus:outline-none transition duration-150 ease-in-out #{'st-accordion__icon--opened' if availability_filter_opened}", data: { action: 'accordion#toggle:prevent' } do %>
|
7
|
-
<%= Spree.t(:availability)
|
7
|
+
<%= Spree.t(:availability) %>
|
8
8
|
<%= render 'spree/shared/icons/chevron_down' %>
|
9
9
|
<% end %>
|
10
10
|
<div class='st-accordion__content' data-accordion-id='availability_filter'>
|
@@ -16,15 +16,15 @@
|
|
16
16
|
data-no-ui-slider-range-value="[<%= filter_price_range[:min].floor %>,<%= filter_price_range[:max].ceil %>]">
|
17
17
|
<div class="flex justify-between gap-6 px-4 lg:px-10 lg:text-sm">
|
18
18
|
<div class="relative w-1/2">
|
19
|
-
<%= f.number_field filter_price_range[:min].floor, class: "pl-16
|
19
|
+
<%= f.number_field filter_price_range[:min].floor, class: "pl-16 without-arrows w-full peer focus:border-primary focus:ring-primary", inputmode: "numeric", name: "filter[min_price]", data: { no_ui_slider_target: "minInput" }, id: "price_from", value: params.dig(:filter, :min_price).present? ? min_price_value.to_i : nil, placeholder: filter_price_range[:min].floor %>
|
20
20
|
<label class="absolute left-0 top-0 flex pl-3 items-center h-full text-input-text peer-placeholder-shown:opacity-50" for="price_from">
|
21
|
-
|
21
|
+
from <%= currency_symbol(current_currency) %>
|
22
22
|
</label>
|
23
23
|
</div>
|
24
24
|
<div class="relative w-1/2">
|
25
|
-
<%= f.number_field filter_price_range[:max].ceil, class: "pl-[2.75rem]
|
25
|
+
<%= f.number_field filter_price_range[:max].ceil, class: "pl-[2.75rem] without-arrows w-full peer focus:border-primary focus:ring-primary", placeholder: filter_price_range[:max].ceil, inputmode: "numeric", name: "filter[max_price]", data: { no_ui_slider_target: "maxInput" }, id: "price_to", value: params.dig(:filter, :max_price).present? ? max_price_value.to_i : nil %>
|
26
26
|
<label class="absolute left-0 top-0 flex pl-3 items-center h-full text-input-text peer-placeholder-shown:opacity-50" for="price_to">
|
27
|
-
|
27
|
+
to <%= currency_symbol(current_currency) %>
|
28
28
|
</label>
|
29
29
|
</div>
|
30
30
|
</div>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
class="st-accordion"
|
6
6
|
data-controller='accordion'
|
7
7
|
data-accordion-close-others-value="false">
|
8
|
-
<%= link_to "#taxonomy_filter_#{taxonomy.id}", class: "cursor-pointer uppercase flex items-center justify-between h-10 px-4 lg:px-10 text-sm tracking-widest focus:outline-none transition duration-150 ease-in-out #{'st-accordion__icon--opened' if params[:filter].nil? || current_taxon.present? || permitted_products_params.dig(:filter, :taxon_ids)
|
8
|
+
<%= link_to "#taxonomy_filter_#{taxonomy.id}", class: "cursor-pointer uppercase flex items-center justify-between h-10 px-4 lg:px-10 text-sm tracking-widest focus:outline-none transition duration-150 ease-in-out #{'st-accordion__icon--opened' if params[:filter].nil? || current_taxon.present? || permitted_products_params.dig(:filter, :taxonomy_ids, taxonomy.id.to_s, :taxon_ids).present?}", data: { action: 'accordion#toggle:prevent' } do %>
|
9
9
|
<%= taxonomy.name.singularize %>
|
10
10
|
<%= render 'spree/shared/icons/chevron_down' %>
|
11
11
|
<% end %>
|
@@ -27,10 +27,10 @@
|
|
27
27
|
<% first_taxons.each do |taxon| %>
|
28
28
|
<li>
|
29
29
|
<%= f.label "filter_taxon_#{taxon.id}", class: "flex items-center gap-2 cursor-pointer group text-sm h-10", data: { searchable_list_target: "item", text: taxon.name } do %>
|
30
|
-
<%= f.check_box "filter[taxon_ids][]",
|
30
|
+
<%= f.check_box "filter[taxonomy_ids][#{taxonomy.id}][taxon_ids][]",
|
31
31
|
{
|
32
32
|
id: "filter_taxon_#{taxon.id}",
|
33
|
-
checked: permitted_products_params.dig(:filter, :taxon_ids)&.include?(taxon.id.to_s),
|
33
|
+
checked: permitted_products_params.dig(:filter, :taxonomy_ids, taxonomy.id.to_s, :taxon_ids)&.include?(taxon.id.to_s),
|
34
34
|
class: "input-checkbox group-focus-within:outline"
|
35
35
|
},
|
36
36
|
taxon.id,
|
@@ -49,10 +49,10 @@
|
|
49
49
|
<% rest_of_the_taxons.each do |taxon| %>
|
50
50
|
<li class="px-4 lg:px-10">
|
51
51
|
<%= f.label "filter_taxon_#{taxon.id}", class: "flex items-center gap-2 cursor-pointer group text-sm h-10", data: { searchable_list_target: "item", text: taxon.name } do %>
|
52
|
-
<%= f.check_box "filter[taxon_ids][]",
|
52
|
+
<%= f.check_box "filter[taxonomy_ids][#{taxonomy.id}][taxon_ids][]",
|
53
53
|
{
|
54
54
|
id: "filter_taxon_#{taxon.id}",
|
55
|
-
checked: permitted_products_params.dig(:filter, :taxon_ids)&.include?(taxon.id.to_s),
|
55
|
+
checked: permitted_products_params.dig(:filter, :taxonomy_ids, taxonomy.id.to_s, :taxon_ids)&.include?(taxon.id.to_s),
|
56
56
|
class: "input-checkbox group-focus-within:outline"
|
57
57
|
},
|
58
58
|
taxon.id,
|