scrivito_crm_form_widget 1.0.0.beta5 → 1.0.0.beta6
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: eaa791bd7d9741030327b3fffbd94ab06eb466fd
|
4
|
+
data.tar.gz: 1bef7a2340ead639693e83b03486fe5a9ae94370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 580a7742f9e9b7fc0c66a77f4ef941aa95caf5fef61c410d8886e7ba3b512b8ac1cffa9e3fd1ad46d6ccacd7f1785912bcd4b036bcd72f53d2d424836489bc8d
|
7
|
+
data.tar.gz: 2eed7ba4cabceddef9d489379e9f01141638e011d78b8b7a12ca40fd949c614c58fca48d9e8594f141430250ebd57c4e3e26287cb8ab1f833828192b9bbb0f4f
|
@@ -85,7 +85,7 @@ class CrmFormWidget < Widget
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def field_as_select?(options)
|
88
|
-
columns == 'two' || options['valid_values'].count >
|
88
|
+
columns == 'two' || options['valid_values'].count > ScrivitoCrmFormWidget.configuration.as_select_field
|
89
89
|
end
|
90
90
|
|
91
91
|
def file_upload?
|
@@ -1,13 +1,17 @@
|
|
1
1
|
<div class="form-group form-field-<%= name %>">
|
2
2
|
<%= form.label name.to_sym, label, class: "control-label col-sm-3 #{options[:mandatory] ? 'mandatory' : ''}" %>
|
3
3
|
<div class="col-sm-9">
|
4
|
-
<% options
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
<% if widget.field_as_select?(options) %>
|
5
|
+
<%= form.select(name.to_sym, options_for_select(options['valid_values'].map { |u| [t("helpers.label.crm_form_presenter.#{name}_option.#{u.parameterize}"), u] }), {}, class: 'form-control', required: options[:mandatory] ) %>
|
6
|
+
<% else %>
|
7
|
+
<% options['valid_values'].each do |value| %>
|
8
|
+
<div class="checkbox">
|
9
|
+
<%= form.label "#{name}_#{value.parameterize}" do %>
|
10
|
+
<%= form.check_box name.to_sym, {:multiple => true, id: "crm_form_presenter_#{name}_#{value.parameterize}", required: options[:mandatory] }, value, nil %>
|
11
|
+
<%= t("helpers.label.crm_form_presenter.#{name}_option.#{value.parameterize}", default: value) %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
11
15
|
<% end %>
|
12
16
|
</div>
|
13
17
|
</div>
|
@@ -5,6 +5,8 @@
|
|
5
5
|
|
6
6
|
<%= form.hidden_field(:widget_id, value: widget.id) %>
|
7
7
|
|
8
|
+
<%= Obj.additional_hidden_attributes(form, widget, request) if Obj.respond_to?('additional_hidden_attributes') %>
|
9
|
+
|
8
10
|
<div class="form-group last">
|
9
11
|
<label class="control-label col-sm-3" for="crm_form_presenter_email">Email</label>
|
10
12
|
<div class="col-sm-9">
|
@@ -2,10 +2,12 @@ module ScrivitoCrmFormWidget
|
|
2
2
|
class Configuration
|
3
3
|
attr_accessor :hidden_attributes
|
4
4
|
attr_accessor :show_error_message
|
5
|
+
attr_accessor :as_select_field
|
5
6
|
|
6
7
|
def initialize
|
7
8
|
@hidden_attributes = ['origin','referrer','tracking','service']
|
8
9
|
@show_error_message = true
|
10
|
+
@as_select_field = 4
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.
|
4
|
+
version: 1.0.0.beta6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scrivito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: scrivito
|