simple_form_bootstrap3 0.3.3 → 0.3.4

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: 97e47cd816c1b496af49ac16f4067a58533cbf3c
4
- data.tar.gz: 48402dd434343af059cc8a17d21ed9e46f405351
3
+ metadata.gz: 725a4c5ceb7e09aafd93b13edf45b8b18efeceea
4
+ data.tar.gz: bb00d269b04df3d96cb6150460f1f212df0c0df0
5
5
  SHA512:
6
- metadata.gz: 6dba10f376c231067077ac6b124b18839e6ec0671151ebfc2a5fbada885d6a05957f73a6ef70fbf06acf53958f4a4da974041f35191e4728b8f44334842a10b7
7
- data.tar.gz: 51f2447d805ae76ed8925839df10dd80e76d5bae862f8ce9cbe73960d778f07342ecbd9d4cd14ee7ffb008d07485c8f7850a78f2b61786b59074f358d6038198
6
+ metadata.gz: 842bd2ada6aaec277889c21b889deb8dfa204b35e17be6af1b21f6e57daf5a0f31926881115524eea93f5de0f4fa5d573f55dccdf0ee5a66fc0b7d876aaa13e0
7
+ data.tar.gz: 1456a0266c5023159a2b3d4410e226ddfef771429e0b26bbb91a582dba7c7a8d9a2b3de53ae828540b9756dd20b852fa6301552984e407523076ea427529bcbe
@@ -23,31 +23,39 @@ module SimpleForm
23
23
  end
24
24
 
25
25
  def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
26
- options[:collection_wrapper_tag] ||= :div
27
- options[:collection_wrapper_class] ||= 'form-group'
28
- options[:item_wrapper_tag] ||= :div
29
- options[:item_wrapper_class] ||= 'checkbox'
26
+ options[:collection_wrapper_tag] = :div unless options.key? :collection_wrapper_tag
27
+ options[:collection_wrapper_class] = 'form-group' unless options.key? :collection_wrapper_class
28
+ if options[:inline]
29
+ options[:item_wrapper_tag] = nil
30
+ else
31
+ options[:item_wrapper_tag] = :div unless options.key? :item_wrapper_tag
32
+ options[:item_wrapper_class] = 'checkbox' unless options.key? :item_wrapper_class
33
+ end
30
34
 
31
35
  if block_given?
32
36
  super
33
37
  else
34
38
  super do |input|
35
- input.label { input.check_box + input.text }
39
+ input.label(options[:inline] ? { class: 'checkbox-inline' } : {} ) { input.check_box + input.text }
36
40
  end
37
41
  end
38
42
  end
39
43
 
40
44
  def collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
41
- options[:collection_wrapper_tag] ||= :div
42
- options[:collection_wrapper_class] ||= 'form-group'
43
- options[:item_wrapper_tag] ||= :div
44
- options[:item_wrapper_class] ||= 'radio'
45
+ options[:collection_wrapper_tag] = :div unless options.key? :collection_wrapper_tag
46
+ options[:collection_wrapper_class] = 'form-group' unless options.key? :collection_wrapper_class
47
+ if options[:inline]
48
+ options[:item_wrapper_tag] = nil
49
+ else
50
+ options[:item_wrapper_tag] = :div unless options.key? :item_wrapper_tag
51
+ options[:item_wrapper_class] = 'radio' unless options.key? :item_wrapper_class
52
+ end
45
53
 
46
54
  if block_given?
47
55
  super
48
56
  else
49
57
  super do |input|
50
- input.label { input.radio_button + input.text }
58
+ input.label(options[:inline] ? { class: 'radio-inline' } : {} ) { input.radio_button + input.text }
51
59
  end
52
60
  end
53
61
  end
@@ -14,11 +14,13 @@ module SimpleForm
14
14
  end
15
15
 
16
16
  def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
17
+ raise ::ArgumentError, 'Inline is unsupported for horizontal form' if options.key? :inline
17
18
  options[:item_wrapper_class] ||= 'col-sm-offset-3 col-sm-9 col-md-offset-3 col-md-9 col-lg-offset-2 col-lg-10 checkbox'
18
19
  super
19
20
  end
20
21
 
21
22
  def collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
23
+ raise ::ArgumentError, 'Inline is unsupported for horizontal form' if options.key? :inline
22
24
  options[:item_wrapper_class] ||= 'col-sm-offset-3 col-sm-9 col-md-offset-3 col-md-9 col-lg-offset-2 col-lg-10 radio'
23
25
  super
24
26
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleFormBootstrap3
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_bootstrap3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuriy Kolodovskyy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-15 00:00:00.000000000 Z
11
+ date: 2014-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-sass