scrivito_crm_form_widget 1.0.0.beta6 → 1.0.0.beta7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eaa791bd7d9741030327b3fffbd94ab06eb466fd
4
- data.tar.gz: 1bef7a2340ead639693e83b03486fe5a9ae94370
3
+ metadata.gz: 9504c87a0beb8c84182f090ad62a7e20150e0bc4
4
+ data.tar.gz: 0266612469715c4d507f7dcc7a934008a9d96994
5
5
  SHA512:
6
- metadata.gz: 580a7742f9e9b7fc0c66a77f4ef941aa95caf5fef61c410d8886e7ba3b512b8ac1cffa9e3fd1ad46d6ccacd7f1785912bcd4b036bcd72f53d2d424836489bc8d
7
- data.tar.gz: 2eed7ba4cabceddef9d489379e9f01141638e011d78b8b7a12ca40fd949c614c58fca48d9e8594f141430250ebd57c4e3e26287cb8ab1f833828192b9bbb0f4f
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, request)
101
- param_given = !options[:visible_in_form] && request.params[name.sub(/^custom_/,'')].present?
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, request) %>
4
- <%= form.hidden_field(name.to_sym, value: request.params[name.sub(/^custom_/,'')]) %>
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 %>
@@ -1,3 +1,3 @@
1
1
  module ScrivitoCrmFormWidget
2
- VERSION = "1.0.0.beta6"
2
+ VERSION = "1.0.0.beta7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_crm_form_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta6
4
+ version: 1.0.0.beta7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito