volt-fields 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/fields/controllers/text_controller.rb +4 -4
- data/app/fields/views/text/index.html +2 -2
- data/app/fields/views/textarea/index.html +2 -2
- 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: 3000ef89135d19d93015f9676b2258d30366b99b
|
4
|
+
data.tar.gz: ef005d240671aaa5bcff49626c372442f68c1492
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fca8794895003c6e88f9eb1b0d16459e7bbb78365709544a75f8a029d12d7bd4df6b1e3ede8e7ea166bcc4ab5bc9ba15bdff7633d87420181786f185e1dd1f20
|
7
|
+
data.tar.gz: e8fb9b8e169dff61c0ccb063854baf68fab4c89ad27672c6b547794db13ded147d652d514d8ac4a327ee975b0896f40b56706154e4ca5f83d0eb66d1da3f5d77
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
@@ -1,7 +1,5 @@
|
|
1
1
|
module Fields
|
2
2
|
class TextController < Volt::ModelController
|
3
|
-
reactive_accessor :blurred
|
4
|
-
reactive_accessor :errors
|
5
3
|
def index
|
6
4
|
# Default to text fields
|
7
5
|
if attrs.respond_to?(:type)
|
@@ -15,7 +13,7 @@ module Fields
|
|
15
13
|
@model = attrs.value_parent
|
16
14
|
|
17
15
|
# Get the name of the field by looking at the method scope
|
18
|
-
@field_name = attrs.value_last_method
|
16
|
+
@field_name = attrs.value_last_method.gsub(/^[_]/, '')
|
19
17
|
|
20
18
|
end
|
21
19
|
|
@@ -37,8 +35,10 @@ module Fields
|
|
37
35
|
# When a field goes out of focus, then we want to start checking a field
|
38
36
|
def blur
|
39
37
|
@model.mark_field!(@field_name)
|
38
|
+
end
|
40
39
|
|
41
|
-
|
40
|
+
def marked
|
41
|
+
@model.marked_fields[@field_name]
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<:Body>
|
2
|
-
<div class="form-group {{ if errors }}has-error{{ elsif
|
2
|
+
<div class="form-group {{ if errors }}has-error{{ elsif marked }}has-success{{ end }} has-feedback">
|
3
3
|
{{ if label }}
|
4
4
|
<label class="control-label">{{ label }}</label>
|
5
5
|
{{ end }}
|
@@ -7,7 +7,7 @@
|
|
7
7
|
{{ if errors }}
|
8
8
|
<span class="glyphicon glyphicon-remove form-control-feedback"></span>
|
9
9
|
<span class="control-label errors">{{ errors.or([]).join(', ') }}</span>
|
10
|
-
{{ elsif
|
10
|
+
{{ elsif marked }}
|
11
11
|
<span class="glyphicon glyphicon-ok form-control-feedback"></span>
|
12
12
|
{{ end }}
|
13
13
|
</div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<:Body>
|
2
|
-
<p class="form-group {{ if errors }}has-error{{ elsif
|
2
|
+
<p class="form-group {{ if errors }}has-error{{ elsif marked }}has-success{{ end }} has-feedback">
|
3
3
|
{{ if label }}
|
4
4
|
<label class="control-label">{{ label }}</label>
|
5
5
|
{{ end }}
|
@@ -7,7 +7,7 @@
|
|
7
7
|
{{ if errors }}
|
8
8
|
<span class="glyphicon glyphicon-remove form-control-feedback"></span>
|
9
9
|
<span class="control-label errors">{{ errors.or([]).join(', ') }}</span>
|
10
|
-
{{ elsif
|
10
|
+
{{ elsif marked }}
|
11
11
|
<span class="glyphicon glyphicon-ok form-control-feedback"></span>
|
12
12
|
{{ end }}
|
13
13
|
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt-fields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: volt
|