express_templates 0.11.9 → 0.11.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/express_templates/components/forms/radio.rb +1 -1
- data/lib/express_templates/version.rb +1 -1
- data/test/components/forms/radio_test.rb +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae4b19c45903080f13a98d80b752a4f0454f8d48
|
4
|
+
data.tar.gz: 9459a475d5784d7edaa7f09240b8fed15a01f5e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03661034f2894cc14a6270b5d65171225ba590b6edd5f1de2667d3e74b6ede8450bf347cba20c83ec724e6148a43b196c2ce4cd76852756e55dd5261d65e7e79
|
7
|
+
data.tar.gz: f4bbcd6364eaa8f281c59551d8e4c7cf41b839ab7e3cc17d876d282a1d50b77e9417e9f59fc1fb990f751a35d9994a3d72c227cde0d303e2e88a5651bd85e3e8
|
data/README.md
CHANGED
@@ -52,6 +52,15 @@ Control flow should only be used in Components. This is currently not enforced
|
|
52
52
|
|
53
53
|
The purpose of express_templates is to provide a foundation for a library of reusable UX components which we can enhance for drag-and-drop style UX construction and template editing.
|
54
54
|
|
55
|
+
## Dependencies
|
56
|
+
|
57
|
+
To set a label's "for" value, you must use a version of arbre that allows for this. Place this in your app:
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
gem "arbre", github: "aelogica/arbre", branch: "tag_for"
|
61
|
+
```
|
62
|
+
|
63
|
+
See https://github.com/activeadmin/arbre/pull/49 for more details.
|
55
64
|
|
56
65
|
## Block Structure
|
57
66
|
|
@@ -59,7 +59,7 @@ module ExpressTemplates
|
|
59
59
|
radio_button(resource_name, field_name.to_sym, key, class: 'radio')
|
60
60
|
label({
|
61
61
|
class: config[:label_wrapper_class],
|
62
|
-
for:
|
62
|
+
for: [resource_name, field_name, key].join("_").downcase,
|
63
63
|
}) {
|
64
64
|
current_arbre_element.add_child value
|
65
65
|
}
|
@@ -103,7 +103,7 @@ class RadioTest < ActiveSupport::TestCase
|
|
103
103
|
test "label_after is true, options specified is an array - label appears after the input" do
|
104
104
|
html = arbre {
|
105
105
|
express_form(:person) {
|
106
|
-
radio :subscribed, options: ['Yes', 'No'], label_after: true
|
106
|
+
radio :subscribed, options: ['Yes', 'No', 'IThinkSo'], label_after: true
|
107
107
|
}
|
108
108
|
}
|
109
109
|
|
@@ -117,6 +117,11 @@ class RadioTest < ActiveSupport::TestCase
|
|
117
117
|
container_2 = radio_input_containers[1]
|
118
118
|
assert_equal "input", container_2.element_children[0].name
|
119
119
|
assert_equal "label", container_2.element_children[1].name
|
120
|
+
|
121
|
+
# Label's for value is downcased
|
122
|
+
container_3 = radio_input_containers[2]
|
123
|
+
for_attr = container_3.element_children[1].attributes['for']
|
124
|
+
assert_equal "person_subscribed_ithinkso", for_attr.value
|
120
125
|
end
|
121
126
|
|
122
127
|
test "label_after is true, options specified is a hash - label appears after the input" do
|
@@ -136,6 +141,10 @@ class RadioTest < ActiveSupport::TestCase
|
|
136
141
|
container_2 = radio_input_containers[1]
|
137
142
|
assert_equal "input", container_2.element_children[0].name
|
138
143
|
assert_equal "label", container_2.element_children[1].name
|
144
|
+
|
145
|
+
# Label's for value is downcased
|
146
|
+
for_attr = container_2.element_children[1].attributes['for']
|
147
|
+
assert_equal "person_subscribed_1", for_attr.value
|
139
148
|
end
|
140
149
|
|
141
150
|
# test "radio supports html options"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: express_templates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Talcott Smith
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-01-
|
12
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|