scrivito_crm_form_widget 1.0.0.beta6 → 1.0.0.beta7
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9504c87a0beb8c84182f090ad62a7e20150e0bc4
|
4
|
+
data.tar.gz: 0266612469715c4d507f7dcc7a934008a9d96994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72622bebe9dae5ac90e9bceb189fe2a3891f786eb6c1905c7f4158a96f3f4a89b1df7ebe5a44bc05ceb161475ba23e5f9eeea92599fe2a3e404874afc7f36c0f
|
7
|
+
data.tar.gz: 771ed56c7d7ab1e6f17ff12abf3292276756aa4e688080f5e8e7f5ead4ccfa6c16e4a9a21301ba93c5785abfbda0f85d3f496a7581172c64579b4b7735231849
|
@@ -97,8 +97,7 @@ class CrmFormWidget < Widget
|
|
97
97
|
I18n.exists?(local) ? I18n.t(local) : nil
|
98
98
|
end
|
99
99
|
|
100
|
-
def hidden?(name, options
|
101
|
-
|
102
|
-
param_given || ScrivitoCrmFormWidget.configuration.hidden_attributes.include?(name.sub(/^custom_/,''))
|
100
|
+
def hidden?(name, options)
|
101
|
+
!options[:visible_in_form] || ScrivitoCrmFormWidget.configuration.hidden_attributes.include?(name.sub(/^custom_/,''))
|
103
102
|
end
|
104
103
|
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<% attributes.each do |name, options| %>
|
2
2
|
<% CrmFormPresenter.send(:attr_accessor, name.to_sym) %>
|
3
|
-
<% if widget.hidden?(name, options
|
4
|
-
|
3
|
+
<% if widget.hidden?(name, options) %>
|
4
|
+
<% if request.params[name.sub(/^custom_/,'')].present? %>
|
5
|
+
<%= form.hidden_field(name.to_sym, value: request.params[name.sub(/^custom_/,'')]) %>
|
6
|
+
<% end %>
|
5
7
|
<% elsif options && options[:visible_in_form] %>
|
6
8
|
<%= render "crm_form_widget/crm_#{options["attribute_type"]}", form: form, name: name, options: options, label: nil, widget: widget %>
|
7
9
|
<% end %>
|