formtastic-bootstrap 3.1.0 → 3.1.1

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: 9a4c8ccd643acebbf6e74e39dd50f116ec11aecf
4
- data.tar.gz: ffdc3de2dcf7c48ffa0254f054331e873c96562c
3
+ metadata.gz: 867c007b1b33a3d99b593be86a16d0f90ca7c6eb
4
+ data.tar.gz: 8f42c1f7139d95b8caa27b743e21bb54e2c524b7
5
5
  SHA512:
6
- metadata.gz: 1263c8854ccb91e32f3f561d901f28382f52f4cf539e862cb051b3b329470d202951cb64a1b4102a432628cd8d0ad548fee93d5bca151aac9431ef99452e6eb4
7
- data.tar.gz: 6a3d94a0a0afd6c74f8c259e78c736da4c4ccecf691333e47e5501fdac374107b71883c57d8e03637013aa8eea579e6e05b436f34867a98b3029088199b8ccaf
6
+ metadata.gz: dedefd2ee40290f0fdbbabf898b1ef9de71f308a2e3b57c083c05ed64c5926b7ce19f8ee77bc3fb049b9698e1b938588177cc74e36f03947669294a4c17aa5d5
7
+ data.tar.gz: 877d3ca5c502ce2e26293e40da5eb3476f3b7ac3d5d665a3b2a14c55d0952b7097b998ab0940a821a7f656bdf290571e3adad5da1415dd7bd6bd6b4bad14b190
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Formtastic Bootstrap
2
2
 
3
+ [![Build Status](https://travis-ci.org/mjbellantoni/formtastic-bootstrap.svg?branch=master)](https://travis-ci.org/mjbellantoni/formtastic-bootstrap)
4
+
3
5
  A [Formtastic](https://github.com/justinfrench/formtastic) form builder that creates markup suitable for the [Twitter Bootstrap](http://twitter.github.com/bootstrap/) framework. In theory, it should just work. Two great tastes in one!
4
6
 
5
7
  You can follow [FormBoot on twitter](http://twitter.com/FormBoot) for update announcements and other relevant info.
@@ -17,7 +19,7 @@ This version of Formtastic Bootstrap should support the following:
17
19
  *Rails*
18
20
 
19
21
  * Rails 3.2.x
20
- * Rails 4.0.x
22
+ * Rails 4.x.x
21
23
 
22
24
  *Formtastic*
23
25
 
@@ -28,11 +30,11 @@ This version of Formtastic Bootstrap should support the following:
28
30
 
29
31
  * 1.9.2
30
32
  * 1.9.3
31
- * 2.0.x
33
+ * 2.x.x
32
34
 
33
35
  #### Installation
34
36
 
35
- Install the gem with
37
+ Install the gem with
36
38
 
37
39
  gem install formtastic-bootstrap
38
40
 
@@ -63,9 +65,9 @@ THIS SECTION IS OUT OF DATE.
63
65
 
64
66
  ### Overview
65
67
 
66
- In general, Formtastic creates very verbose HTML whereas
68
+ In general, Formtastic creates very verbose HTML whereas
67
69
  Bootstrap expects (ever) simpler HTML. Every attempt has been
68
- made to generate the HTML expected by Bootstrap while still
70
+ made to generate the HTML expected by Bootstrap while still
69
71
  generating the rich HTML provided by Formtastic. When there
70
72
  is a conflict, Bootstrap wins.
71
73
 
@@ -88,9 +90,9 @@ The gem also provides some "shim" CSS where Bootstrap is missing styles provided
88
90
 
89
91
  ### Other
90
92
 
91
- A lot of the code (especially the test suite) was copied
92
- over from Formtastic and then beaten into submission. I'm
93
- sure you'll find some ugliness in there. In general, I
93
+ A lot of the code (especially the test suite) was copied
94
+ over from Formtastic and then beaten into submission. I'm
95
+ sure you'll find some ugliness in there. In general, I
94
96
  mimicked the Formtastic code structure as much as possible.
95
97
 
96
98
  In particular:
@@ -144,7 +146,7 @@ use the ```:append_content``` or ```:prepend_content``` option.
144
146
  <% end %>
145
147
 
146
148
  ## Contributing
147
-
149
+
148
150
  ### Contributors
149
151
 
150
152
  A big thank you [to all contributors](https://github.com/mjbellantoni/formtastic-bootstrap/contributors)!
@@ -185,7 +187,7 @@ Source contributions are very welcome! Most of the recent work on this package
185
187
  * As rich functionally as their Rails counterparts.
186
188
  * Extract into a standalone gem.
187
189
  * Tests
188
- * Get them passing!
190
+ * Fill in all pending specs
189
191
  * Refactor
190
192
  * More -- See if I'm making sure the Bootstrap classes are present.
191
193
  * Documentation
@@ -196,5 +198,5 @@ Source contributions are very welcome! Most of the recent work on this package
196
198
 
197
199
  ## Copyright
198
200
 
199
- Copyright (c) 2013 Matthew Bellantoni. See LICENSE.txt for further details.
201
+ Copyright (c) 2013-2015 Matthew Bellantoni. See LICENSE.txt for further details.
200
202
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.1.1
@@ -1,4 +1,5 @@
1
1
  require "formtastic"
2
+ require "formtastic/version"
2
3
  require "formtastic-bootstrap/engine" if defined?(::Rails) # For tests
3
4
  require "formtastic-bootstrap/helpers"
4
5
  require "formtastic-bootstrap/inputs"
@@ -11,6 +11,15 @@ module FormtasticBootstrap
11
11
  :second => "col-xs-1"
12
12
  }
13
13
 
14
+ FRAGMENT_PLACEHOLDERS = {
15
+ :year => nil,
16
+ :month => nil,
17
+ :day => nil,
18
+ :hour => nil,
19
+ :minute => nil,
20
+ :second => nil
21
+ }
22
+
14
23
  def to_html
15
24
  bootstrap_wrapping do
16
25
  hidden_fragments <<
@@ -45,12 +54,11 @@ module FormtasticBootstrap
45
54
  end
46
55
 
47
56
  def fragment_class(fragment)
48
- options[:fragment_classes] || self.class::FRAGMENT_CLASSES[fragment]
57
+ (options[:fragment_classes] || self.class::FRAGMENT_CLASSES)[fragment.to_sym]
49
58
  end
50
59
 
51
60
  def fragment_placeholder(fragment)
52
- # TODO This sets a useless placeholer right now.
53
- "." + fragment_class(fragment)
61
+ (options[:fragment_placeholders] || self.class::FRAGMENT_PLACEHOLDERS)[fragment.to_sym]
54
62
  end
55
63
 
56
64
  end
@@ -10,7 +10,7 @@ module FormtasticBootstrap
10
10
  label_html <<
11
11
  template.content_tag(:span, :class => 'form-wrapper') do
12
12
  input_content(&block) <<
13
- hint_html <<
13
+ hint_html(:block) <<
14
14
  error_html(:block)
15
15
  end
16
16
  end
@@ -4,11 +4,15 @@ module FormtasticBootstrap
4
4
  class BooleanInput < Formtastic::Inputs::BooleanInput
5
5
  include Base
6
6
 
7
+ # Skip rendering of .form-label in #bootstrap_wrapping
8
+ def render_label?
9
+ false
10
+ end
11
+
7
12
  def to_html
8
13
  bootstrap_wrapping do
9
14
  hidden_field_html <<
10
- "".html_safe <<
11
- [label_with_nested_checkbox, hint_html].join("\n").html_safe
15
+ label_with_nested_checkbox
12
16
  end
13
17
  end
14
18
 
@@ -33,7 +37,7 @@ module FormtasticBootstrap
33
37
 
34
38
  def wrapper_html_options
35
39
  super.tap do |options|
36
- options[:class] = (options[:class].split - ["form-group"] + ["checkbox"]).join(" ")
40
+ options[:class] = (options[:class].split + ["checkbox"]).join(" ")
37
41
  end
38
42
  end
39
43
 
@@ -3,6 +3,13 @@ module FormtasticBootstrap
3
3
  class ColorInput < Formtastic::Inputs::ColorInput
4
4
  include Base
5
5
  include Base::Stringish
6
+
7
+ def to_html
8
+ raise "The :color input requires the color_field form helper, which is only available in Rails 4+" unless builder.respond_to?(:color_field)
9
+ bootstrap_wrapping do
10
+ builder.color_field(method, form_control_input_html_options)
11
+ end
12
+ end
6
13
  end
7
14
  end
8
15
  end
@@ -5,29 +5,12 @@ module FormtasticBootstrap
5
5
  include Base
6
6
  include Base::Collections
7
7
 
8
- def select_html
9
- builder.select(input_name, collection, input_options, form_control_input_html_options)
10
- end
11
-
12
- def grouped_select_html
13
- builder.grouped_collection_select(
14
- input_name,
15
- grouped_collection,
16
- group_association,
17
- group_label_method,
18
- value_method,
19
- label_method,
20
- input_options,
21
- form_control_input_html_options
22
- )
23
- end
24
-
25
8
  def to_html
26
9
  bootstrap_wrapping do
27
- options[:group_by] ? grouped_select_html : select_html
10
+ builder.select(input_name, collection, input_options, form_control_input_html_options)
28
11
  end
29
12
  end
30
13
 
31
14
  end
32
15
  end
33
- end
16
+ end
@@ -4,7 +4,7 @@ module FormtasticBootstrap
4
4
  FRAGMENT_CLASSES = {
5
5
  :hour => "col-xs-4",
6
6
  :minute => "col-xs-4",
7
- :secound => "col-xs-4"
7
+ :second => "col-xs-4"
8
8
  }
9
9
 
10
10
  include Base
@@ -1,3 +1,3 @@
1
1
  module FormtasticBootstrap
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formtastic-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Bellantoni
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-11 00:00:00.000000000 Z
12
+ date: 2015-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: formtastic
@@ -81,34 +81,6 @@ dependencies:
81
81
  - - <
82
82
  - !ruby/object:Gem::Version
83
83
  version: 1.6.0
84
- - !ruby/object:Gem::Dependency
85
- name: rspec
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - ~>
89
- - !ruby/object:Gem::Version
90
- version: '2.14'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ~>
96
- - !ruby/object:Gem::Version
97
- version: '2.14'
98
- - !ruby/object:Gem::Dependency
99
- name: rspec-rails
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ~>
103
- - !ruby/object:Gem::Version
104
- version: '2.14'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ~>
110
- - !ruby/object:Gem::Version
111
- version: '2.14'
112
84
  - !ruby/object:Gem::Dependency
113
85
  name: rspec_tag_matchers
114
86
  requirement: !ruby/object:Gem::Requirement