effective_form_inputs 0.4.1 → 0.4.2

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: c1e577be5802efc63230b2b66f9f3d52bec1ee06
4
- data.tar.gz: 3dfe18e3f27b3039a16fbbb638b615ababe9be03
3
+ metadata.gz: 2f903f343a6b2612545534ce9a86fa00e953bb50
4
+ data.tar.gz: 81bafa3159d6e521f38dca2b5f31f3970b638ce5
5
5
  SHA512:
6
- metadata.gz: 220cd031a9bd83bd4999b3f69dc387bc0d899ecb3cb1462ac0d9900df841ec028606d526e6fbdf3e24f2db366645ef6d61e622a0b23251c6c6368fe73ca32a25
7
- data.tar.gz: 1a2a5508b86cd3ad67e17622eb32719d7d8b7f131adc2c9c8fa5187984b80ce61f69373a4eaa15616658088b9908f532e523a5a0c41410e1746936656b65b8e5
6
+ metadata.gz: 2d09274264261dcb884eaccb193926de684985ebac1bbc20c34948dbfd7ee95bca244d36eb72b764672c106dba726cfd1cb4e7a15b2a6003cf5be230fbfeb353
7
+ data.tar.gz: d29abe9f25363244106b176a81be578f86c4b11563276a84f28a165073b405c87110d2847abfc2d7e7bb365412fcea4d1fbee5a8e673abdfcc39afaeb5d25270
@@ -4,9 +4,3 @@
4
4
  margin-top: -1px;
5
5
  margin-right: 0px;
6
6
  }
7
-
8
- .form-group {
9
- .select2-container--bootstrap {
10
- min-width: 178px;
11
- }
12
- }
@@ -12,6 +12,10 @@ module Inputs
12
12
  end
13
13
 
14
14
  def to_html
15
+ if options.delete(:input_group) == false
16
+ return text_field_tag(field_name, value, options)
17
+ end
18
+
15
19
  content_tag(:div, :class => 'input-group') do
16
20
  content_tag(:span, :class => 'input-group-addon') do
17
21
  content_tag(:i, '', :class => 'glyphicon glyphicon-calendar').html_safe
@@ -6,6 +6,7 @@ if defined?(SimpleForm)
6
6
  class EffectiveDatePickerInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
8
  options = merge_wrapper_options(input_html_options, wrapper_options) || {}
9
+ options.merge!(input_options.select { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) })
9
10
  options['data-input-js-options'] = input_options.reject { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) }
10
11
 
11
12
  Inputs::EffectiveDatePicker::Input.new(object, object_name, template, attribute_name, options).to_html
@@ -12,6 +12,10 @@ module Inputs
12
12
  end
13
13
 
14
14
  def to_html
15
+ if options.delete(:input_group) == false
16
+ return text_field_tag(field_name, value, options)
17
+ end
18
+
15
19
  content_tag(:div, :class => 'input-group') do
16
20
  content_tag(:span, :class => 'input-group-addon') do
17
21
  content_tag(:i, '', :class => 'glyphicon glyphicon-calendar').html_safe
@@ -6,6 +6,7 @@ if defined?(SimpleForm)
6
6
  class EffectiveDateTimePickerInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
8
  options = merge_wrapper_options(input_html_options, wrapper_options) || {}
9
+ options.merge!(input_options.select { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) })
9
10
  options['data-input-js-options'] = input_options.reject { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) }
10
11
 
11
12
  Inputs::EffectiveDateTimePicker::Input.new(object, object_name, template, attribute_name, options).to_html
@@ -8,10 +8,7 @@ if defined?(SimpleForm)
8
8
  label_method, value_method = detect_collection_methods
9
9
 
10
10
  options = merge_wrapper_options(input_html_options, wrapper_options) || {}
11
-
12
- # This gives us multiple and include_blank properly
13
11
  options.merge!(input_options.select { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) })
14
-
15
12
  options['data-input-js-options'] = input_options.reject { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) }
16
13
 
17
14
  options[:collection] = collection
@@ -6,6 +6,7 @@ if defined?(SimpleForm)
6
6
  class EffectiveStaticControlInput < SimpleForm::Inputs::StringInput
7
7
  def input(wrapper_options = nil)
8
8
  options = merge_wrapper_options(input_html_options, wrapper_options) || {}
9
+ options.merge!(input_options.select { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) })
9
10
  options['data-input-js-options'] = input_options.reject { |k, _| EffectiveFormInputs::REJECTED_INPUT_JS_OPTIONS.include?(k) }
10
11
 
11
12
  Inputs::EffectiveStaticControl::Input.new(object, object_name, template, attribute_name, options).to_html
@@ -3,5 +3,5 @@
3
3
  = form_for Effective::StyleGuide.new(:category => 'Category 2'), :url => '/' do |f|
4
4
  = f.effective_date_time_picker :updated_at
5
5
  = f.effective_date_picker :updated_at
6
- = f.select :category, 10.times.map { |x| "Category #{x}"}, :include_blank => false, :placeholder => 'Pleze chooze', :multiple => true
7
- = f.effective_select :category, 10.times.map { |x| "Category #{x}"}, :include_blank => false, :placeholder => 'Pleze chooze', :multiple => true
6
+ = f.select :category, 10.times.map { |x| "Category #{x}"}, :include_blank => true
7
+ = f.effective_select :category, 10.times.map { |x| "Category #{x}"}, :include_blank => false, :placeholder => 'Pleze chooze', :input_group => false
@@ -1,3 +1,3 @@
1
1
  module EffectiveFormInputs
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.4.2'.freeze
3
3
  end
@@ -2,5 +2,5 @@ require "effective_form_inputs/engine"
2
2
  require "effective_form_inputs/version"
3
3
 
4
4
  module EffectiveFormInputs
5
- REJECTED_INPUT_JS_OPTIONS = [:as, :hint, :error, :readonly, :disabled, :required, :label, :inline_label, :prompt, :min_max, :maxlength, :pattern, :input_html, :wrapper_html, :error_html, :id, :wrapper, :collection, :multiple, :include_blank, :label_method, :value_method]
5
+ REJECTED_INPUT_JS_OPTIONS = [:as, :hint, :error, :readonly, :disabled, :required, :label, :inline_label, :prompt, :min_max, :maxlength, :pattern, :input_html, :wrapper_html, :error_html, :id, :wrapper, :collection, :multiple, :include_blank, :label_method, :value_method, :input_group]
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_form_inputs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-01 00:00:00.000000000 Z
11
+ date: 2015-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails