spree_mobility 1.1.0 → 1.2.0
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/LICENSE.md +1 -1
- data/app/views/spree/admin/translations/_form_fields.html.erb +2 -2
- data/lib/spree_mobility/version.rb +1 -1
- data/lib/spree_mobility.rb +19 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47c7d870ccec1b09bab4ed9a685bcaee8ba979f0d3fc73aeda5efed47d9793b5
|
|
4
|
+
data.tar.gz: 1846c0f5c3dc91fd624195f4735cc07b1427aa69458e1df7dca21fc77142e0c3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e7e2ae4f8f9144bdb863bdffe892a655159bf911917e519007f85918534c9791466951157127847941e48e141af539a1b902dbbfdbdee1119742f15cdcc58ff
|
|
7
|
+
data.tar.gz: 5386ecc2b8d96cbda9e898f4d7d5732a708782fd8df8eba4ef1a6f6ede0d714155b1b6647fa7954b31ce8628171d8121f12d8fcf0fb7ed95925100e6f85ddccd
|
data/LICENSE.md
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
<div class="panel-body">
|
|
17
17
|
<% field_type = @resource.class.translation_class.columns_hash[attr.to_s].type %>
|
|
18
18
|
<% if @resource.kind_of?(Spree::Product) && attr.to_sym == :description %>
|
|
19
|
-
<%= g.text_area :description, { rows: "30", class: "form-control #{"spree-rte" if
|
|
19
|
+
<%= g.text_area :description, { rows: "30", class: "form-control #{"spree-rte" if SpreeMobility.product_wysiwyg_editor_enabled? }" } %>
|
|
20
20
|
<% elsif @resource.kind_of?(Spree::Taxon) && attr.to_sym == :description %>
|
|
21
|
-
<%= g.text_area :description, { rows: "30", class: "form-control #{"spree-rte" if
|
|
21
|
+
<%= g.text_area :description, { rows: "30", class: "form-control #{"spree-rte" if SpreeMobility.taxon_wysiwyg_editor_enabled? }" } %>
|
|
22
22
|
<% elsif field_type == :text %>
|
|
23
23
|
<%= g.text_area attr, class: 'form-control', rows: 4 %>
|
|
24
24
|
<% else %>
|
data/lib/spree_mobility.rb
CHANGED
|
@@ -9,13 +9,13 @@ module SpreeMobility
|
|
|
9
9
|
def self.prepend_once(to_klass, klass)
|
|
10
10
|
to_klass.prepend(klass) unless to_klass.ancestors.include?(klass)
|
|
11
11
|
end
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
def self.clear_validations_for(klass, *attrs)
|
|
14
14
|
attrs.each do |attr|
|
|
15
15
|
klass.validators_on(attr).each { |val| val.attributes.delete(attr) }
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
def self.translates_for(klass, *attrs)
|
|
20
20
|
klass.translates(*attrs)
|
|
21
21
|
klass.accepts_nested_attributes_for :translations
|
|
@@ -44,4 +44,20 @@ module SpreeMobility
|
|
|
44
44
|
end
|
|
45
45
|
result
|
|
46
46
|
end
|
|
47
|
-
|
|
47
|
+
|
|
48
|
+
def self.product_wysiwyg_editor_enabled?
|
|
49
|
+
spree_backend_config :product_wysiwyg_editor_enabled
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def self.taxon_wysiwyg_editor_enabled?
|
|
53
|
+
spree_backend_config :taxon_wysiwyg_editor_enabled
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def self.spree_backend_config(key)
|
|
57
|
+
if defined?(Spree::Backend::Config) && Spree::Backend::Config.has_preference?(key)
|
|
58
|
+
Spree::Backend::Config[key]
|
|
59
|
+
else
|
|
60
|
+
Spree::Config[key]
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|