scrivito_crm_form_widget 0.9.0.beta1 → 0.9.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/styles/scrivito_crm_form_widget.scss +5 -1
- data/app/models/crm_form_widget.rb +9 -0
- data/app/views/crm_form_widget/_crm_enum.html.erb +4 -4
- data/app/views/crm_form_widget/_crm_multienum.html.erb +3 -3
- data/app/views/crm_form_widget/_form.html.erb +5 -3
- data/app/views/crm_form_widget/details.html.erb +4 -0
- data/lib/scrivito_crm_form_widget/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 445ae51d6ff6bd4b7d01038a4de1e0656b2b14e4
|
4
|
+
data.tar.gz: 87420d5167f8893a63b3411a3f0f7bec15962676
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3737a7f7bd5ded881213af98218ff3cc01b7744f6e7c18131d99179ef0661c9b97afef1c6183bf59cb4649a4c787cd9c0c613633095ad8aec0b4f62f769f96c
|
7
|
+
data.tar.gz: 643ed3f4b9fc428ea3f13e36ebbc0f986ec641024c0e587b835bbe3f285373e78178e0f1e0f64d6d9c27c067e62ece645152378c3667aef730899d9e08eed212
|
@@ -12,6 +12,15 @@ class CrmFormWidget < Widget
|
|
12
12
|
attribute :columns, :enum, values: ['one','two'], default: 'one'
|
13
13
|
|
14
14
|
attribute :file_upload, :enum, values: ['Yes','No'], default: 'No'
|
15
|
+
attribute :styles, :stringlist
|
16
|
+
|
17
|
+
def scrivito_selectable_style_classes
|
18
|
+
if Obj.respond_to? 'scrivito_selectable_style_classes'
|
19
|
+
Obj.scrivito_selectable_style_classes('CrmFormWidget')
|
20
|
+
else
|
21
|
+
[]
|
22
|
+
end
|
23
|
+
end
|
15
24
|
|
16
25
|
def valid_widget_classes_for(field_name)
|
17
26
|
[DynamicAttributeWidget]
|
@@ -2,16 +2,16 @@
|
|
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
4
|
<% if widget.field_as_select?(options) %>
|
5
|
-
<%= form.select(name.to_sym, options_for_select(options['valid_values'].map { |u| [u, u
|
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') %>
|
6
6
|
<% else %>
|
7
7
|
<% options['valid_values'].each do |value| %>
|
8
8
|
<div class="radio">
|
9
|
-
<%= form.label "#{name}_#{value.
|
9
|
+
<%= form.label "#{name}_#{value.parameterize}" do %>
|
10
10
|
<%= form.radio_button name.to_sym, value %>
|
11
|
-
<%= t("helpers.label.crm_form_presenter.#{name}_option.#{value.
|
11
|
+
<%= t("helpers.label.crm_form_presenter.#{name}_option.#{value.parameterize}") %>
|
12
12
|
<% end %>
|
13
13
|
</div>
|
14
14
|
<% end %>
|
15
15
|
<% end %>
|
16
16
|
</div>
|
17
|
-
</div>
|
17
|
+
</div>
|
@@ -3,9 +3,9 @@
|
|
3
3
|
<div class="col-sm-9">
|
4
4
|
<% options['valid_values'].each do |value| %>
|
5
5
|
<div class="checkbox">
|
6
|
-
<%= form.label "#{name}_#{value.
|
7
|
-
<%= form.check_box name.to_sym, {:multiple => true, id: "crm_form_presenter_#{name}_#{value.
|
8
|
-
<%= t("helpers.label.crm_form_presenter.#{name}_option.#{value.
|
6
|
+
<%= form.label "#{name}_#{value.parameterize}" do %>
|
7
|
+
<%= form.check_box name.to_sym, {:multiple => true, id: "crm_form_presenter_#{name}_#{value.parameterize}"}, value, nil %>
|
8
|
+
<%= t("helpers.label.crm_form_presenter.#{name}_option.#{value.parameterize}", default: value) %>
|
9
9
|
<% end %>
|
10
10
|
</div>
|
11
11
|
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= form_for CrmFormPresenter.new(widget, request, controller), url: scrivito_path(widget.obj), html: { class: "form-horizontal clearfix label-position-#{widget.label_position} #{widget.columns}-column-layout"} do |form| %>
|
1
|
+
<%= form_for CrmFormPresenter.new(widget, request, controller), url: scrivito_path(widget.obj), html: { class: "form-horizontal clearfix label-position-#{widget.label_position} #{widget.columns}-column-layout #{widget.activity.id.parameterize} #{widget.styles.join(' ')}"} do |form| %>
|
2
2
|
<% if widget.subject %>
|
3
3
|
<%= form.hidden_field(:title, value: widget.subject) %>
|
4
4
|
<% end %>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<% if widget.file_upload? %>
|
19
19
|
<div class="form-group form-field-custom-file">
|
20
20
|
<% CrmFormPresenter.send(:attr_accessor, :custom_file) %>
|
21
|
-
<%= form.label :custom_file, t('scrivito_crm_form_widget.view.file', default: 'File'), class: "control-label col-sm-3" %>
|
21
|
+
<%= form.label :custom_file, t('scrivito_crm_form_widget.view.file', default: 'File upload'), class: "control-label col-sm-3" %>
|
22
22
|
<div class="col-sm-9">
|
23
23
|
<%= form.file_field :custom_file, class: "form-control" %>
|
24
24
|
</div>
|
@@ -32,5 +32,7 @@
|
|
32
32
|
</div>
|
33
33
|
</div>
|
34
34
|
|
35
|
-
|
35
|
+
<div class="form-submit-button-container clearfix">
|
36
|
+
<%= form.submit widget.submit_button, class: "btn btn-primary pull-right" %>
|
37
|
+
</div>
|
36
38
|
<% end %>
|
@@ -31,6 +31,10 @@
|
|
31
31
|
<%= scrivito_details_for t('scrivito_crm_form_widget.details.file_upload', default: 'File upload') do %>
|
32
32
|
<%= scrivito_tag :div, widget, :file_upload %>
|
33
33
|
<% end %>
|
34
|
+
|
35
|
+
<%= scrivito_details_for t('scrivito_crm_form_widget.details.file_upload', default: 'File upload') do %>
|
36
|
+
<%= scrivito_tag :div, widget, :styles, data: { multi_select_list: widget.scrivito_selectable_style_classes } %>
|
37
|
+
<% end %>
|
34
38
|
</div>
|
35
39
|
|
36
40
|
<div class="tab-panel" id="edit-tags">
|
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: 0.9.0.
|
4
|
+
version: 0.9.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scrivito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: scrivito
|