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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4569ddbae114e16cb7d17dc8e8d2857b0ebc62da
4
- data.tar.gz: 262ecd566b718f014b97b5ffc4ee6cc2f71aac55
3
+ metadata.gz: 445ae51d6ff6bd4b7d01038a4de1e0656b2b14e4
4
+ data.tar.gz: 87420d5167f8893a63b3411a3f0f7bec15962676
5
5
  SHA512:
6
- metadata.gz: a6081661f981e78cd231405670b376559913d60bc2521fa71ff8dd285c594139aa019df5bcea30b78097264a12fbc4d6b50064a699e198182dbc64d1989f1292
7
- data.tar.gz: b71cb0354e2f52ea1bd027d5e39aa7b5ead25219c96d866271820bff830ed0311e12612cc8c3ccce535fe7a89ad6678589dfd6a56b5bcc839ff7b67b4ea040f1
6
+ metadata.gz: b3737a7f7bd5ded881213af98218ff3cc01b7744f6e7c18131d99179ef0661c9b97afef1c6183bf59cb4649a4c787cd9c0c613633095ad8aec0b4f62f769f96c
7
+ data.tar.gz: 643ed3f4b9fc428ea3f13e36ebbc0f986ec641024c0e587b835bbe3f285373e78178e0f1e0f64d6d9c27c067e62ece645152378c3667aef730899d9e08eed212
@@ -22,9 +22,13 @@ form.form-horizontal.two-column-layout {
22
22
  margin: 0;
23
23
  }
24
24
 
25
- .btn {
25
+ .form-submit-button-container {
26
26
  clear: both;
27
+ }
28
+
29
+ .btn {
27
30
  margin-right: 15px;
31
+ margin-top: 15px;
28
32
  }
29
33
  }
30
34
 
@@ -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.downcase] })) %>
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.downcase}" do %>
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.downcase}") %>
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.downcase}" do %>
7
- <%= form.check_box name.to_sym, {:multiple => true, id: "crm_form_presenter_#{name}_#{value.downcase}"}, value, nil %>
8
- <%= t("helpers.label.crm_form_presenter.#{name}_option.#{value.downcase}", default: 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
- <%= form.submit widget.submit_button, class: "btn btn-primary pull-right" %>
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">
@@ -1,3 +1,3 @@
1
1
  module ScrivitoCrmFormWidget
2
- VERSION = "0.9.0.beta1"
2
+ VERSION = "0.9.0.beta3"
3
3
  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: 0.9.0.beta1
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-05-31 00:00:00.000000000 Z
11
+ date: 2017-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scrivito