spree_storefront 5.0.4 → 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/products_controller.rb +1 -3
- data/app/controllers/spree/store_controller.rb +16 -9
- data/app/controllers/spree/taxons_controller.rb +1 -3
- data/app/helpers/spree/analytics_helper.rb +6 -2
- 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 +1 -1
- data/app/helpers/spree/page_helper.rb +15 -0
- data/app/helpers/spree/products_helper.rb +13 -1
- data/app/helpers/spree/storefront_helper.rb +12 -0
- 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/product_form_controller.js +21 -18
- data/app/javascript/spree/storefront/controllers/slideover_controller.js +2 -0
- data/app/views/devise/registrations/_form.html.erb +2 -2
- data/app/views/devise/sessions/new.html.erb +16 -0
- data/app/views/spree/account/wished_items/create.turbo_stream.erb +1 -0
- data/app/views/spree/addresses/edit.html.erb +4 -0
- data/app/views/spree/addresses/new.html.erb +3 -0
- data/app/views/spree/checkout/edit.html.erb +5 -3
- data/app/views/spree/line_items/create.turbo_stream.erb +1 -0
- data/app/views/spree/line_items/destroy.turbo_stream.erb +2 -0
- data/app/views/spree/products/show.html.erb +2 -1
- 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/orders/edit.html.erb +2 -0
- data/app/views/themes/default/spree/products/_add_to_cart_button.html.erb +8 -2
- data/app/views/themes/default/spree/products/filters/_taxons.erb +5 -5
- data/app/views/themes/default/spree/shared/_error_messages.html.erb +1 -1
- 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/spree/storefront/engine.rb +7 -1
- metadata +13 -6
@@ -28,20 +28,12 @@ export default class extends Controller {
|
|
28
28
|
}
|
29
29
|
|
30
30
|
connect() {
|
31
|
-
|
32
|
-
|
33
|
-
if (option.checked) {
|
34
|
-
selectedOptions.add(option.dataset.optionId)
|
35
|
-
}
|
36
|
-
})
|
37
|
-
const requiredOptions = new Set(this.requiredOptionsValue)
|
31
|
+
if (this.hasAddToWishlistTarget && this.variantFromOptionsDisabledValue) {
|
32
|
+
const notSelectedOptions = this.getNotSelectedOptions()
|
38
33
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
}
|
43
|
-
if (this.hasAddToWishlistTarget && this.variantFromOptionsDisabledValue && this.notSelectedOptions.length === 0) {
|
44
|
-
this.addToWishlistTarget.disabled = true
|
34
|
+
if (notSelectedOptions.length === 0) {
|
35
|
+
this.addToWishlistTarget.disabled = true
|
36
|
+
}
|
45
37
|
}
|
46
38
|
|
47
39
|
if (this.hasDesktopMediaGalleryTarget && this.hasProductDetailsTarget) {
|
@@ -56,14 +48,14 @@ export default class extends Controller {
|
|
56
48
|
this.submitTargets.forEach((button) => button.addEventListener('turbo-stream-form:submit-end', this.enableForm))
|
57
49
|
}
|
58
50
|
|
59
|
-
disconnect() {
|
60
|
-
this.submitTargets.forEach((button) => button.removeEventListener('click', this.showNotSelectedOptions))
|
61
|
-
}
|
62
|
-
|
63
51
|
showNotSelectedOptions = (e) => {
|
52
|
+
const notSelectedOptions = this.getNotSelectedOptions()
|
53
|
+
|
54
|
+
if (!notSelectedOptions.length) return
|
55
|
+
|
64
56
|
e.preventDefault()
|
65
57
|
|
66
|
-
|
58
|
+
notSelectedOptions.forEach((option, index) => {
|
67
59
|
const fieldSetElement = this.element.querySelector(`[data-option-id="${option}"]`)
|
68
60
|
if (index === 0) {
|
69
61
|
const toggleElement = fieldSetElement.querySelector('[data-controller="dropdown"]')
|
@@ -133,4 +125,15 @@ export default class extends Controller {
|
|
133
125
|
enableForm = () => {
|
134
126
|
this.disabledValue = false
|
135
127
|
}
|
128
|
+
|
129
|
+
getNotSelectedOptions() {
|
130
|
+
const selectedOptions = new Set()
|
131
|
+
this.optionTargets.forEach((option) => {
|
132
|
+
if (option.checked) {
|
133
|
+
selectedOptions.add(option.dataset.optionId)
|
134
|
+
}
|
135
|
+
})
|
136
|
+
const requiredOptions = new Set(this.requiredOptionsValue)
|
137
|
+
return [...requiredOptions].filter((x) => !selectedOptions.has(x))
|
138
|
+
}
|
136
139
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="card-dialog mx-auto lg:w-1/3">
|
2
2
|
<% unless params[:checkout] %>
|
3
|
-
<h3 class="mb-5 font-semibold"><%= Spree.t(:
|
3
|
+
<h3 class="mb-5 font-semibold"><%= Spree.t(:create_a_new_account) %></h3>
|
4
4
|
<% end %>
|
5
5
|
<%= render partial: 'spree/shared/error_messages', locals: { target: @user } %>
|
6
6
|
<%= form_for resource, as: :spree_user, url: spree.registration_path(checkout: params[:checkout]), data: { turbo: false } do |f| %>
|
@@ -16,6 +16,6 @@
|
|
16
16
|
</div>
|
17
17
|
</div>
|
18
18
|
</div>
|
19
|
-
<%= f.submit Spree.t(:
|
19
|
+
<%= f.submit Spree.t(:create_a_new_account), class: 'btn-primary block w-full lg:w-48 text-center mx-auto' %>
|
20
20
|
<% end %>
|
21
21
|
</div>
|
@@ -21,5 +21,21 @@
|
|
21
21
|
</div>
|
22
22
|
<% end %>
|
23
23
|
<%= render "devise/shared/links" %>
|
24
|
+
|
25
|
+
<% if current_order.present? &&
|
26
|
+
current_store&.prefers_guest_checkout? &&
|
27
|
+
stored_location&.include?(spree.checkout_path(current_order.token))
|
28
|
+
%>
|
29
|
+
<div class="relative my-5 flex items-center">
|
30
|
+
<div class="flex-grow border-t border-gray-200"></div>
|
31
|
+
<span class="mx-4 text-sm text-gray-500 uppercase"><%= Spree.t(:or) %></span>
|
32
|
+
<div class="flex-grow border-t border-gray-200"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="flex flex-col items-center gap-4">
|
36
|
+
<p class="text-sm text-gray-600"><%= Spree.t(:continue_without_logging_in) %></p>
|
37
|
+
<%= link_to Spree.t(:continue_as_guest), spree.checkout_path(current_order.token, guest: true), class: 'btn btn-secondary w-full max-w-sm', data: { turbo: false } %>
|
38
|
+
</div>
|
39
|
+
<% end %>
|
24
40
|
</div>
|
25
41
|
<% end %>
|
@@ -15,6 +15,10 @@
|
|
15
15
|
</div>
|
16
16
|
<% end %>
|
17
17
|
<% end %>
|
18
|
+
<% elsif turbo_frame_request? %>
|
19
|
+
<%= turbo_frame_tag "edit_address_modal_#{@address.id}" do %>
|
20
|
+
<%= render partial: 'spree/account/addresses/edit_address_modal', locals: { address: @address } %>
|
21
|
+
<% end %>
|
18
22
|
<% else %>
|
19
23
|
<div class="page-container grid grid-cols-1 lg:grid-cols-12 lg:gap-6 lg:mt-6">
|
20
24
|
<div class="lg:col-span-2">
|
@@ -15,6 +15,9 @@
|
|
15
15
|
<% end %>
|
16
16
|
</div>
|
17
17
|
<% end %>
|
18
|
+
<%= turbo_frame_tag :new_address_modal do %>
|
19
|
+
<%= render partial: 'spree/account/addresses/new_address_modal', locals: { address: @address } %>
|
20
|
+
<% end %>
|
18
21
|
<% else %>
|
19
22
|
<% if params[:checkout].present? %>
|
20
23
|
<div class="card-dialog mx-auto lg:w-1/3">
|
@@ -39,7 +39,7 @@
|
|
39
39
|
<%= Spree.t(:ship_address) %>
|
40
40
|
</div>
|
41
41
|
<div class="px-5 word-break">
|
42
|
-
<%= @order.ship_address.to_s.gsub('<br/>', ', ')
|
42
|
+
<%= sanitize(@order.ship_address.to_s.gsub('<br/>', ', ')) %>
|
43
43
|
</div>
|
44
44
|
</div>
|
45
45
|
<div class="text-xs">
|
@@ -82,11 +82,13 @@
|
|
82
82
|
<%= render partial: 'spree/checkout/payment', locals: { order: @order } %>
|
83
83
|
<% elsif @order.delivery? %>
|
84
84
|
<%= render partial: 'spree/checkout/delivery', locals: { order: @order } %>
|
85
|
-
<%
|
85
|
+
<% elsif step = @order.checkout_steps.find { |s| s == @order.state } %>
|
86
86
|
<%= form_for @order, url: spree.update_checkout_path(@order.token, @order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
|
87
87
|
<div>
|
88
88
|
<%= form.hidden_field :state_lock_version unless @order.errors.any? %>
|
89
|
-
|
89
|
+
<% if step.in?(%w[address delivery payment confirm]) %>
|
90
|
+
<%= render partial: "spree/checkout/#{step}", locals: { form: form } %>
|
91
|
+
<% end %>
|
90
92
|
</div>
|
91
93
|
<div>
|
92
94
|
<%= button_tag Spree.t(:save_and_continue),
|
@@ -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) %>
|
@@ -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 %>
|
@@ -16,7 +16,10 @@ 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 %>
|
@@ -38,7 +41,10 @@ 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 %>
|
@@ -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,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if target && target.errors.any? %>
|
2
|
-
<div id="errorExplanation" class="alert-error text-center mb-4 p-2">
|
2
|
+
<div id="errorExplanation" class="<%= local_assigns[:class] || 'alert-error text-center mb-4 p-2' %>">
|
3
3
|
<ul>
|
4
4
|
<% target.errors.full_messages.each do |msg| %>
|
5
5
|
<li><%= msg %></li>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Spree
|
4
|
+
module Storefront
|
5
|
+
module Generators
|
6
|
+
class DeviseGenerator < Rails::Generators::Base
|
7
|
+
desc 'Installs Spree Storefront Devise controllers'
|
8
|
+
|
9
|
+
def self.source_paths
|
10
|
+
[
|
11
|
+
File.expand_path('templates', __dir__),
|
12
|
+
File.expand_path('../templates', "../#{__FILE__}"),
|
13
|
+
File.expand_path('../templates', "../../#{__FILE__}")
|
14
|
+
]
|
15
|
+
end
|
16
|
+
|
17
|
+
def install
|
18
|
+
template 'user_sessions_controller.rb', 'app/controllers/spree/user_sessions_controller.rb'
|
19
|
+
template 'user_registrations_controller.rb', 'app/controllers/spree/user_registrations_controller.rb'
|
20
|
+
template 'user_passwords_controller.rb', 'app/controllers/spree/user_passwords_controller.rb'
|
21
|
+
|
22
|
+
# add devise routes
|
23
|
+
insert_into_file 'config/routes.rb', after: "Rails.application.routes.draw do\n" do
|
24
|
+
<<-ROUTES.strip_heredoc.indent!(2)
|
25
|
+
Spree::Core::Engine.add_routes do
|
26
|
+
# Storefront routes
|
27
|
+
scope '(:locale)', locale: /\#{Spree.available_locales.join('|')\}/, defaults: { locale: nil } do
|
28
|
+
devise_for(
|
29
|
+
Spree.user_class.model_name.singular_route_key,
|
30
|
+
class_name: Spree.user_class.to_s,
|
31
|
+
path: :user,
|
32
|
+
controllers: {
|
33
|
+
sessions: 'spree/user_sessions',
|
34
|
+
passwords: 'spree/user_passwords',
|
35
|
+
registrations: 'spree/user_registrations'
|
36
|
+
},
|
37
|
+
router_name: :spree
|
38
|
+
)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
ROUTES
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Spree
|
2
|
+
class UserPasswordsController < ::Devise::PasswordsController
|
3
|
+
include Spree::Storefront::DeviseConcern
|
4
|
+
|
5
|
+
protected
|
6
|
+
|
7
|
+
def translation_scope
|
8
|
+
'devise.user_passwords'
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def title
|
14
|
+
Spree.t(:forgot_password)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Spree
|
2
|
+
class UserRegistrationsController < ::Devise::RegistrationsController
|
3
|
+
include Spree::Storefront::DeviseConcern
|
4
|
+
|
5
|
+
protected
|
6
|
+
|
7
|
+
def translation_scope
|
8
|
+
'devise.user_registrations'
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def title
|
14
|
+
Spree.t(:sign_up)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Spree
|
2
|
+
class UserSessionsController < ::Devise::SessionsController
|
3
|
+
include Spree::Storefront::DeviseConcern
|
4
|
+
|
5
|
+
protected
|
6
|
+
|
7
|
+
def translation_scope
|
8
|
+
'devise.user_sessions'
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def title
|
14
|
+
Spree.t(:login)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -7,11 +7,14 @@ module Spree
|
|
7
7
|
:head_partials,
|
8
8
|
:body_start_partials,
|
9
9
|
:body_end_partials,
|
10
|
+
:cart_partials,
|
10
11
|
:add_to_cart_partials,
|
11
12
|
:remove_from_cart_partials,
|
12
13
|
:checkout_partials,
|
13
14
|
:checkout_complete_partials,
|
14
|
-
:quick_checkout_partials
|
15
|
+
:quick_checkout_partials,
|
16
|
+
:product_partials,
|
17
|
+
:add_to_wishlist_partials
|
15
18
|
)
|
16
19
|
|
17
20
|
# accessible via Rails.application.config.spree_storefront
|
@@ -44,11 +47,14 @@ module Spree
|
|
44
47
|
Rails.application.config.spree_storefront.head_partials = []
|
45
48
|
Rails.application.config.spree_storefront.body_start_partials = []
|
46
49
|
Rails.application.config.spree_storefront.body_end_partials = []
|
50
|
+
Rails.application.config.spree_storefront.cart_partials = []
|
47
51
|
Rails.application.config.spree_storefront.add_to_cart_partials = []
|
48
52
|
Rails.application.config.spree_storefront.remove_from_cart_partials = []
|
49
53
|
Rails.application.config.spree_storefront.checkout_partials = []
|
50
54
|
Rails.application.config.spree_storefront.checkout_complete_partials = []
|
51
55
|
Rails.application.config.spree_storefront.quick_checkout_partials = []
|
56
|
+
Rails.application.config.spree_storefront.product_partials = []
|
57
|
+
Rails.application.config.spree_storefront.add_to_wishlist_partials = []
|
52
58
|
end
|
53
59
|
end
|
54
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_storefront
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.1.0.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vendo Connect Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.0.
|
19
|
+
version: 5.1.0.beta
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.0.
|
26
|
+
version: 5.1.0.beta
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: active_link_to
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,6 +205,7 @@ files:
|
|
205
205
|
- app/controllers/concerns/spree/cart_methods.rb
|
206
206
|
- app/controllers/concerns/spree/locale_urls.rb
|
207
207
|
- app/controllers/concerns/spree/password_protected.rb
|
208
|
+
- app/controllers/concerns/spree/storefront/devise_concern.rb
|
208
209
|
- app/controllers/concerns/spree/theme_concern.rb
|
209
210
|
- app/controllers/spree/account/addresses_controller.rb
|
210
211
|
- app/controllers/spree/account/base_controller.rb
|
@@ -371,6 +372,8 @@ files:
|
|
371
372
|
- app/views/themes/default/spree/account/_order.html.erb
|
372
373
|
- app/views/themes/default/spree/account/_orders.html.erb
|
373
374
|
- app/views/themes/default/spree/account/addresses/_address.html.erb
|
375
|
+
- app/views/themes/default/spree/account/addresses/_edit_address_modal.html.erb
|
376
|
+
- app/views/themes/default/spree/account/addresses/_new_address_modal.html.erb
|
374
377
|
- app/views/themes/default/spree/account/addresses/index.html.erb
|
375
378
|
- app/views/themes/default/spree/account/newsletter/_newsletter_settings.html.erb
|
376
379
|
- app/views/themes/default/spree/account/newsletter/edit.html.erb
|
@@ -514,6 +517,10 @@ files:
|
|
514
517
|
- config/initializers/heroicon.rb
|
515
518
|
- config/locales/en.yml
|
516
519
|
- config/routes.rb
|
520
|
+
- lib/generators/spree/storefront/devise/devise_generator.rb
|
521
|
+
- lib/generators/spree/storefront/devise/templates/user_passwords_controller.rb
|
522
|
+
- lib/generators/spree/storefront/devise/templates/user_registrations_controller.rb
|
523
|
+
- lib/generators/spree/storefront/devise/templates/user_sessions_controller.rb
|
517
524
|
- lib/generators/spree/storefront/install/install_generator.rb
|
518
525
|
- lib/generators/spree/storefront/install/templates/application.tailwind.css
|
519
526
|
- lib/generators/spree/storefront/install/templates/dev
|
@@ -542,9 +549,9 @@ licenses:
|
|
542
549
|
- AGPL-3.0-or-later
|
543
550
|
metadata:
|
544
551
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
545
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.
|
552
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta
|
546
553
|
documentation_uri: https://docs.spreecommerce.org/
|
547
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.0.
|
554
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta
|
548
555
|
post_install_message:
|
549
556
|
rdoc_options: []
|
550
557
|
require_paths:
|