platformx 0.0.9.3 → 0.0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/platformx/form.rb +5 -5
- data/lib/platformx/text.rb +19 -0
- data/lib/platformx/version.rb +1 -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: 122eefeb83c23fe1a8a36d1569f5b16ad7fcc329
|
4
|
+
data.tar.gz: 418b4ec9149c94225a7627063aae4a492cbf9d57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ad520745395c80ae0aa0ca97a94b0a43b3d0326824ee86ee637d94694362f726f6b55301e0a869fa3cf600070f581ed253b406919720ee0faa82c8a48a24bf7
|
7
|
+
data.tar.gz: 90952a0d411e21a4daa2ed650b89c09f3d35f0c6186e9183d5b86acd514ab2b58c318f487b0346fc417d71bd380ee2a931165268f3811f58f199a465b1be0053
|
data/lib/platformx/form.rb
CHANGED
@@ -161,7 +161,7 @@ end
|
|
161
161
|
def x_input(id: "", name: "", value: "", label: "", required: false, placeholder: "", mask: "", maxlength: "", css:"")
|
162
162
|
|
163
163
|
id = name unless id != ""
|
164
|
-
if required
|
164
|
+
if required
|
165
165
|
if label != ""
|
166
166
|
required_output = '<sup class="text-danger">*</sup>'
|
167
167
|
else
|
@@ -1055,7 +1055,7 @@ EOS
|
|
1055
1055
|
ta = <<EOS
|
1056
1056
|
<div class="form-group">
|
1057
1057
|
#{label}#{required_output}
|
1058
|
-
<textarea name="post[#{name}]" id="#{id}" rows="4" class="form-control" placeholder="#{placeholder}" #{maxlength}>#{value}</textarea>
|
1058
|
+
<textarea name="post[#{name}]" id="#{id}" rows="4" class="form-control" placeholder="#{placeholder}" #{maxlength} #{required_tag}>#{value}</textarea>
|
1059
1059
|
</div>
|
1060
1060
|
EOS
|
1061
1061
|
return ta
|
@@ -1367,17 +1367,17 @@ EOS
|
|
1367
1367
|
options_html << "<option value=''>No available selections</option>"
|
1368
1368
|
end
|
1369
1369
|
|
1370
|
-
if add_none == true
|
1370
|
+
if add_none == true
|
1371
1371
|
add_none_option = "<option value=''>Select One</option>"
|
1372
1372
|
end
|
1373
1373
|
|
1374
1374
|
if menu_size == 0
|
1375
1375
|
menu_size_html = ""
|
1376
|
-
else
|
1376
|
+
else
|
1377
1377
|
menu_size_html = "data-size='#{menu_size}'"
|
1378
1378
|
end
|
1379
1379
|
|
1380
|
-
if live_search == true
|
1380
|
+
if live_search == true
|
1381
1381
|
live_search_html = "data-live-search='true'"
|
1382
1382
|
end
|
1383
1383
|
|
data/lib/platformx/text.rb
CHANGED
@@ -27,6 +27,25 @@ def x_boolean_label(value: "", type: "text")
|
|
27
27
|
|
28
28
|
return str
|
29
29
|
|
30
|
+
end
|
31
|
+
|
32
|
+
# Generate icon label
|
33
|
+
# @param value [Boolean] boolean value
|
34
|
+
# @param type [String] boolean label type
|
35
|
+
# @return [String] boolean label (yes or no for boolean value)
|
36
|
+
# @example
|
37
|
+
# x_boolean_label(true) # -> "Yes"
|
38
|
+
# x_boolean_label(false) # -> "No"
|
39
|
+
def x_boolean_icon(value)
|
40
|
+
|
41
|
+
if !value.nil? && value == true
|
42
|
+
str = "<i class='fa fa-check text-success'></i>"
|
43
|
+
else
|
44
|
+
str = "<i class='fa fa-ban text-danger'></i>"
|
45
|
+
end
|
46
|
+
|
47
|
+
return str
|
48
|
+
|
30
49
|
end
|
31
50
|
|
32
51
|
end
|
data/lib/platformx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: platformx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.9.
|
4
|
+
version: 0.0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- timmushen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|