formtastic-bootstrap 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -11
- data/VERSION +1 -1
- data/lib/formtastic-bootstrap.rb +1 -0
- data/lib/formtastic-bootstrap/inputs/base/timeish.rb +11 -3
- data/lib/formtastic-bootstrap/inputs/base/wrapping.rb +1 -1
- data/lib/formtastic-bootstrap/inputs/boolean_input.rb +7 -3
- data/lib/formtastic-bootstrap/inputs/color_input.rb +7 -0
- data/lib/formtastic-bootstrap/inputs/select_input.rb +2 -19
- data/lib/formtastic-bootstrap/inputs/time_select_input.rb +1 -1
- data/lib/formtastic-bootstrap/version.rb +1 -1
- metadata +2 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 867c007b1b33a3d99b593be86a16d0f90ca7c6eb
|
4
|
+
data.tar.gz: 8f42c1f7139d95b8caa27b743e21bb54e2c524b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
-
*
|
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.
|
1
|
+
3.1.1
|
data/lib/formtastic-bootstrap.rb
CHANGED
@@ -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
|
-
|
53
|
-
"." + fragment_class(fragment)
|
61
|
+
(options[:fragment_placeholders] || self.class::FRAGMENT_PLACEHOLDERS)[fragment.to_sym]
|
54
62
|
end
|
55
63
|
|
56
64
|
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
|
-
|
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
|
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
|
-
|
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
|
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.
|
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-
|
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
|