trenni-formatters 1.1.0 → 1.2.0
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 +4 -4
- data/lib/trenni/formatters/html/form_formatter.rb +7 -0
- data/lib/trenni/formatters/html/option_select.rb +4 -1
- data/lib/trenni/formatters/html/radio_select.rb +1 -0
- data/lib/trenni/formatters/version.rb +1 -1
- data/spec/trenni/formatters/html/option_select_spec.rb +8 -0
- data/trenni-formatters.gemspec +1 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 806ee963b3b27c735e6eaa8479dd82589a863a7c
|
4
|
+
data.tar.gz: ccfd1e70f2fcb6620c3479c8ba514b6765318e3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17dbe8759970644d8b66c90a3f94a7b7b303e2e86cbf51f8cbddafc459ddd4a9ba9ee9686d08a27dfeb545588406998b2bf8ae5d3d3f0291e3265e67e91bd6e5
|
7
|
+
data.tar.gz: 320e119d5d24eff4dff0edec6b7cca61b898ddc3a3362c53f1bb9b2cb4dbc87343f95013e1277b0a0c2b7ca2b94c47eb1e6a5192e32b00a16da81657f7694f1f
|
@@ -112,6 +112,7 @@ module Trenni
|
|
112
112
|
# for <input type="text">
|
113
113
|
:minlength => options[:minlength],
|
114
114
|
:maxlength => options[:maxlength],
|
115
|
+
:data => options[:data],
|
115
116
|
}
|
116
117
|
|
117
118
|
return attributes
|
@@ -124,6 +125,7 @@ module Trenni
|
|
124
125
|
:class => options[:class],
|
125
126
|
:for => options[:for],
|
126
127
|
:form => options[:form],
|
128
|
+
:data => options[:data],
|
127
129
|
}
|
128
130
|
|
129
131
|
return attributes
|
@@ -141,6 +143,7 @@ module Trenni
|
|
141
143
|
:placeholder => placeholder_for(options),
|
142
144
|
:minlength => options[:minlength],
|
143
145
|
:maxlength => options[:maxlength],
|
146
|
+
:data => options[:data],
|
144
147
|
}
|
145
148
|
end
|
146
149
|
|
@@ -155,6 +158,7 @@ module Trenni
|
|
155
158
|
:required => options[:required],
|
156
159
|
:disabled => options[:disabled],
|
157
160
|
:readonly => options[:readonly],
|
161
|
+
:data => options[:data],
|
158
162
|
}
|
159
163
|
end
|
160
164
|
|
@@ -166,6 +170,7 @@ module Trenni
|
|
166
170
|
:class => options[:class],
|
167
171
|
:disabled => options[:disabled],
|
168
172
|
:value => title_for(options),
|
173
|
+
:data => options[:data],
|
169
174
|
}
|
170
175
|
end
|
171
176
|
|
@@ -180,6 +185,7 @@ module Trenni
|
|
180
185
|
:class => options[:class],
|
181
186
|
:name => name_for(options),
|
182
187
|
:value => value_for(options),
|
188
|
+
:data => options[:data],
|
183
189
|
}
|
184
190
|
end
|
185
191
|
|
@@ -200,6 +206,7 @@ module Trenni
|
|
200
206
|
:class => options[:class],
|
201
207
|
:disabled => options[:disabled],
|
202
208
|
:value => value_for(options),
|
209
|
+
:data => options[:data],
|
203
210
|
}
|
204
211
|
end
|
205
212
|
|
@@ -65,6 +65,7 @@ module Trenni
|
|
65
65
|
:selected => options.fetch(:selected){ value_for(@options) == value_for(options) },
|
66
66
|
:id => options[:id],
|
67
67
|
:class => options[:class],
|
68
|
+
:data => options[:data],
|
68
69
|
}
|
69
70
|
end
|
70
71
|
|
@@ -81,6 +82,7 @@ module Trenni
|
|
81
82
|
:label => title_for(options),
|
82
83
|
:id => options[:id],
|
83
84
|
:class => options[:class],
|
85
|
+
:data => options[:data],
|
84
86
|
}
|
85
87
|
end
|
86
88
|
|
@@ -101,7 +103,8 @@ module Trenni
|
|
101
103
|
:name => name_for(options),
|
102
104
|
:id => options[:id],
|
103
105
|
:class => options[:class],
|
104
|
-
:multiple => options[:multiple]
|
106
|
+
:multiple => options[:multiple],
|
107
|
+
:data => options[:data],
|
105
108
|
}
|
106
109
|
end
|
107
110
|
|
@@ -43,6 +43,14 @@ module Trenni::Formatters::HTML::OptionSelectSpec
|
|
43
43
|
expect(_out.join).to be == "<dt>Bar</dt>\n<dd>\n\t<select name=\"bar\">\n\t\t<option value=\"0\">A</option><option value=\"10\" selected>B</option>\n\t</select>\n</dd>"
|
44
44
|
end
|
45
45
|
|
46
|
+
it "should list items with data attributes" do
|
47
|
+
formatter.select :field => :bar do |select|
|
48
|
+
_out << select.item(:title => "A", :value => 0, :data => {foo: 'bar'})
|
49
|
+
end
|
50
|
+
|
51
|
+
expect(_out.join).to be == "<dt>Bar</dt>\n<dd>\n\t<select name=\"bar\">\n\t\t<option value=\"0\" data-foo=\"bar\">A</option>\n\t</select>\n</dd>"
|
52
|
+
end
|
53
|
+
|
46
54
|
it "should list items for multiple selection" do
|
47
55
|
formatter.select :field => :bar, multiple: true do |select|
|
48
56
|
_out << select.item(:title => "A", :value => 0)
|
data/trenni-formatters.gemspec
CHANGED
@@ -24,8 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
|
-
spec.add_dependency "trenni", "~> 1.
|
28
|
-
|
27
|
+
spec.add_dependency "trenni", "~> 1.7.0"
|
29
28
|
spec.add_dependency "mapping", "~> 1.0.0"
|
30
29
|
|
31
30
|
spec.add_development_dependency "bundler", "~> 1.3"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trenni-formatters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trenni
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.7.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mapping
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.5.
|
134
|
+
rubygems_version: 2.5.1
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Formatters for Trenni, to assist with typical views and form based interfaces.
|