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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e45267f019c40fe488e3c7070de36a90dc01ad3
4
- data.tar.gz: 6aa48716a5a1c95d4ddce54cfb2d1974667e54e7
3
+ metadata.gz: 122eefeb83c23fe1a8a36d1569f5b16ad7fcc329
4
+ data.tar.gz: 418b4ec9149c94225a7627063aae4a492cbf9d57
5
5
  SHA512:
6
- metadata.gz: 25949836328f197df1e3ad52fda8341837d740c03509f0d91ff52a3bf4dccc704f66ab771c83daa010312d08d6c5c978ac92abf10533c27bbb55dd91b69c1f26
7
- data.tar.gz: db2b5c0b1c8d16db3e6377074923141005599d75cdc29f998423d5549442711f3312ab1bc793ae443b4a151b4fb5357f77cc976a3e385118494a108b2c00c8fc
6
+ metadata.gz: 7ad520745395c80ae0aa0ca97a94b0a43b3d0326824ee86ee637d94694362f726f6b55301e0a869fa3cf600070f581ed253b406919720ee0faa82c8a48a24bf7
7
+ data.tar.gz: 90952a0d411e21a4daa2ed650b89c09f3d35f0c6186e9183d5b86acd514ab2b58c318f487b0346fc417d71bd380ee2a931165268f3811f58f199a465b1be0053
@@ -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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Platformx
2
- VERSION = "0.0.9.3"
2
+ VERSION = "0.0.9.4"
3
3
  end
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.3
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-04 00:00:00.000000000 Z
11
+ date: 2017-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler