alchemy-solidus 3.3.0 → 4.0.0.pre.b1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/alchemy/solidus/admin/taxon_select.js +1 -1
- data/app/models/alchemy/essence_spree_product.rb +5 -3
- data/app/models/alchemy/essence_spree_taxon.rb +5 -3
- data/app/models/alchemy/essence_spree_variant.rb +4 -2
- data/app/models/alchemy/ingredients/spree_product.rb +9 -0
- data/app/models/alchemy/ingredients/spree_taxon.rb +9 -0
- data/app/models/alchemy/ingredients/spree_variant.rb +9 -0
- data/app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/_spree_product_editor.html.erb +25 -0
- data/app/views/alchemy/ingredients/_spree_product_view.html.erb +1 -0
- data/app/views/alchemy/ingredients/_spree_taxon_editor.html.erb +25 -0
- data/app/views/alchemy/ingredients/_spree_taxon_view.html.erb +1 -0
- data/app/views/alchemy/ingredients/_spree_variant_editor.html.erb +25 -0
- data/app/views/alchemy/ingredients/_spree_variant_view.html.erb +1 -0
- data/config/initializers/alchemy.rb +3 -1
- data/lib/alchemy/solidus/version.rb +1 -1
- metadata +25 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2797433a6a97d7d6afe3a5e651ae43db159b2f8609770b9e8ea2d856dd4cc820
|
4
|
+
data.tar.gz: 4760ab7f6075ed49fdb8187a4071c05e80aa1b617b47e6c8bf80af2e01c844be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 780ba8c209dca6820184f50b064ddb31613da1897c8f3365626926638cceabf6686ca675fb5c2a68335f49133e2a2ed1e9dc28e93f7b7bc4cd499a2580e3f23b
|
7
|
+
data.tar.gz: d63f7d35521a3567b4c56aa725623bc04041ebee06e63658cbb13db76fc31beaeac817001d840bc475c6432f9fcab543ab61cf31ae865be683b4a9edb892bfa0
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![
|
1
|
+
[![CI](https://github.com/AlchemyCMS/alchemy-solidus/workflows/CI/badge.svg?branch=main)](https://github.com/AlchemyCMS/alchemy-solidus/actions?query=workflow%3ACI+branch%3Amain)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/alchemy-solidus.svg)](https://badge.fury.io/rb/alchemy-solidus)
|
3
3
|
|
4
4
|
# Alchemy-Solidus
|
@@ -4,14 +4,16 @@ module Alchemy
|
|
4
4
|
class EssenceSpreeProduct < ActiveRecord::Base
|
5
5
|
PRODUCT_ID = /\A\d+\z/
|
6
6
|
|
7
|
-
belongs_to :product,
|
8
|
-
|
7
|
+
belongs_to :product,
|
8
|
+
class_name: "Spree::Product",
|
9
|
+
optional: true,
|
10
|
+
foreign_key: "spree_product_id"
|
9
11
|
|
10
12
|
acts_as_essence(ingredient_column: :product)
|
11
13
|
|
12
14
|
def ingredient=(product_or_id)
|
13
15
|
case product_or_id
|
14
|
-
when PRODUCT_ID
|
16
|
+
when PRODUCT_ID, ""
|
15
17
|
self.spree_product_id = product_or_id
|
16
18
|
when Spree::Product
|
17
19
|
self.product = product_or_id
|
@@ -4,14 +4,16 @@ module Alchemy
|
|
4
4
|
class EssenceSpreeTaxon < ActiveRecord::Base
|
5
5
|
TAXON_ID = /\A\d+\z/
|
6
6
|
|
7
|
-
belongs_to :taxon,
|
8
|
-
|
7
|
+
belongs_to :taxon,
|
8
|
+
class_name: "Spree::Taxon",
|
9
|
+
optional: true,
|
10
|
+
foreign_key: "taxon_id"
|
9
11
|
|
10
12
|
acts_as_essence(ingredient_column: :taxon)
|
11
13
|
|
12
14
|
def ingredient=(taxon_or_id)
|
13
15
|
case taxon_or_id
|
14
|
-
when TAXON_ID
|
16
|
+
when TAXON_ID, ""
|
15
17
|
self.taxon_id = taxon_or_id
|
16
18
|
when Spree::Taxon
|
17
19
|
self.taxon = taxon_or_id
|
@@ -4,13 +4,15 @@ module Alchemy
|
|
4
4
|
class EssenceSpreeVariant < ActiveRecord::Base
|
5
5
|
VARIANT_ID = /\A\d+\z/
|
6
6
|
|
7
|
-
belongs_to :variant,
|
7
|
+
belongs_to :variant,
|
8
|
+
class_name: "Spree::Variant",
|
9
|
+
optional: true
|
8
10
|
|
9
11
|
acts_as_essence(ingredient_column: :variant)
|
10
12
|
|
11
13
|
def ingredient=(variant_or_id)
|
12
14
|
case variant_or_id
|
13
|
-
when VARIANT_ID
|
15
|
+
when VARIANT_ID, ""
|
14
16
|
self.variant_id = variant_or_id
|
15
17
|
when Spree::Variant
|
16
18
|
self.variant = variant_or_id
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= content_tag :div,
|
2
|
+
class: spree_product_editor.css_classes,
|
3
|
+
data: spree_product_editor.data_attributes do %>
|
4
|
+
<%= element_form.fields_for(:ingredients, spree_product_editor.ingredient) do |f| %>
|
5
|
+
<%= ingredient_label(spree_product_editor, :product_id) %>
|
6
|
+
<%= f.text_field :product_id,
|
7
|
+
value: spree_product_editor.product&.id,
|
8
|
+
class: 'alchemy_selectbox full_width' %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<script>
|
13
|
+
$('#<%= spree_product_editor.form_field_id(:product_id) %>').alchemyProductSelect({
|
14
|
+
placeholder: "<%= Alchemy.t(:search_product, scope: 'solidus') %>",
|
15
|
+
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
16
|
+
baseUrl: "<%= spree.api_products_path %>",
|
17
|
+
query_params: <%== spree_product_editor.settings[:query_params].to_json %>,
|
18
|
+
<% if spree_product_editor.product %>
|
19
|
+
initialSelection: {
|
20
|
+
id: <%= spree_product_editor.product.id %>,
|
21
|
+
text: "<%= spree_product_editor.product.name %>"
|
22
|
+
}
|
23
|
+
<% end %>
|
24
|
+
})
|
25
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= spree_product_view.product&.name %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= content_tag :div,
|
2
|
+
class: spree_taxon_editor.css_classes,
|
3
|
+
data: spree_taxon_editor.data_attributes do %>
|
4
|
+
<%= element_form.fields_for(:ingredients, spree_taxon_editor.ingredient) do |f| %>
|
5
|
+
<%= ingredient_label(spree_taxon_editor, :taxon_id) %>
|
6
|
+
<%= f.text_field :taxon_id,
|
7
|
+
value: spree_taxon_editor.taxon&.id,
|
8
|
+
class: 'alchemy_selectbox full_width' %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<script>
|
13
|
+
$('#<%= spree_taxon_editor.form_field_id(:taxon_id) %>').alchemyTaxonSelect({
|
14
|
+
placeholder: "<%= Alchemy.t(:search_taxon, scope: 'solidus') %>",
|
15
|
+
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
16
|
+
baseUrl: "<%= spree.api_taxons_path %>",
|
17
|
+
query_params: <%== spree_taxon_editor.settings[:query_params].to_json %>,
|
18
|
+
<% if spree_taxon_editor.taxon %>
|
19
|
+
initialSelection: {
|
20
|
+
id: <%= spree_taxon_editor.taxon.id %>,
|
21
|
+
text: "<%= spree_taxon_editor.taxon.pretty_name %>"
|
22
|
+
}
|
23
|
+
<% end %>
|
24
|
+
})
|
25
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= spree_taxon_view.taxon&.name %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= content_tag :div,
|
2
|
+
class: spree_variant_editor.css_classes,
|
3
|
+
data: spree_variant_editor.data_attributes do %>
|
4
|
+
<%= element_form.fields_for(:ingredients, spree_variant_editor.ingredient) do |f| %>
|
5
|
+
<%= ingredient_label(spree_variant_editor, :variant_id) %>
|
6
|
+
<%= f.text_field :variant_id,
|
7
|
+
value: spree_variant_editor.variant&.id,
|
8
|
+
class: 'alchemy_selectbox full_width' %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<script>
|
13
|
+
$('#<%= spree_variant_editor.form_field_id(:variant_id) %>').alchemyVariantSelect({
|
14
|
+
placeholder: "<%= Alchemy.t(:search_variant, scope: 'solidus') %>",
|
15
|
+
apiToken: "<%= current_alchemy_user.spree_api_key %>",
|
16
|
+
baseUrl: "<%= spree.api_variants_path %>",
|
17
|
+
query_params: <%== spree_variant_editor.settings[:query_params].to_json %>,
|
18
|
+
<% if spree_variant_editor.variant %>
|
19
|
+
initialSelection: {
|
20
|
+
id: <%= spree_variant_editor.variant.id %>,
|
21
|
+
text: "<%= spree_variant_editor.variant.name %>"
|
22
|
+
}
|
23
|
+
<% end %>
|
24
|
+
})
|
25
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= spree_variant_view.variant&.name %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-solidus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.pre.b1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|
@@ -16,27 +16,27 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.0.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '6.
|
22
|
+
version: '6.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 5.0.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '6.
|
32
|
+
version: '6.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: solidus_core
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 2.
|
39
|
+
version: 2.10.0
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '3.0'
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 2.
|
49
|
+
version: 2.10.0
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '3.0'
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 2.
|
59
|
+
version: 2.10.0
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '3.0'
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 2.
|
69
|
+
version: 2.10.0
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '3.0'
|
@@ -214,12 +214,21 @@ files:
|
|
214
214
|
- app/models/alchemy/essence_spree_product.rb
|
215
215
|
- app/models/alchemy/essence_spree_taxon.rb
|
216
216
|
- app/models/alchemy/essence_spree_variant.rb
|
217
|
+
- app/models/alchemy/ingredients/spree_product.rb
|
218
|
+
- app/models/alchemy/ingredients/spree_taxon.rb
|
219
|
+
- app/models/alchemy/ingredients/spree_variant.rb
|
217
220
|
- app/views/alchemy/essences/_essence_spree_product_editor.html.erb
|
218
221
|
- app/views/alchemy/essences/_essence_spree_product_view.html.erb
|
219
222
|
- app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb
|
220
223
|
- app/views/alchemy/essences/_essence_spree_taxon_view.html.erb
|
221
224
|
- app/views/alchemy/essences/_essence_spree_variant_editor.html.erb
|
222
225
|
- app/views/alchemy/essences/_essence_spree_variant_view.html.erb
|
226
|
+
- app/views/alchemy/ingredients/_spree_product_editor.html.erb
|
227
|
+
- app/views/alchemy/ingredients/_spree_product_view.html.erb
|
228
|
+
- app/views/alchemy/ingredients/_spree_taxon_editor.html.erb
|
229
|
+
- app/views/alchemy/ingredients/_spree_taxon_view.html.erb
|
230
|
+
- app/views/alchemy/ingredients/_spree_variant_editor.html.erb
|
231
|
+
- app/views/alchemy/ingredients/_spree_variant_view.html.erb
|
223
232
|
- app/views/spree/admin/shared/_alchemy_sub_menu.html.erb
|
224
233
|
- config/initializers/alchemy.rb
|
225
234
|
- config/initializers/solidus.rb
|
@@ -246,7 +255,7 @@ homepage: https://github.com/AlchemyCMS/alchemy-solidus
|
|
246
255
|
licenses:
|
247
256
|
- BSD New
|
248
257
|
metadata: {}
|
249
|
-
post_install_message:
|
258
|
+
post_install_message:
|
250
259
|
rdoc_options: []
|
251
260
|
require_paths:
|
252
261
|
- lib
|
@@ -257,12 +266,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
257
266
|
version: '0'
|
258
267
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
259
268
|
requirements:
|
260
|
-
- - "
|
269
|
+
- - ">"
|
261
270
|
- !ruby/object:Gem::Version
|
262
|
-
version:
|
271
|
+
version: 1.3.1
|
263
272
|
requirements: []
|
264
|
-
rubygems_version: 3.
|
265
|
-
signing_key:
|
273
|
+
rubygems_version: 3.1.4
|
274
|
+
signing_key:
|
266
275
|
specification_version: 4
|
267
276
|
summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
|
268
277
|
Content Management System!
|