platformx 0.0.8.8 → 0.0.8.9
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/platformx/form.rb +44 -0
- data/lib/platformx/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b08fcc1ee6d0d62b6721b0e8876139255a0803c5
|
4
|
+
data.tar.gz: 67ffce324e4c8bdcacb277b663650da5730fe2ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69c7b607d77bc1e587750ee39318de63fd9390a863e82a18333cd5820bd729fa9756da64aac76cdb4722c17cdc319238055004b66a051956c0f9a473b2245091
|
7
|
+
data.tar.gz: f26f72821fa5872c8203ad8b3bfce9961f1f44d2b2e95e05b7656b2b33dbc2092dc340d0a8abfa828bed305ffb87d287cc573aa6c05dd548d9c65a4d1dc7c4a3
|
data/lib/platformx/form.rb
CHANGED
@@ -483,6 +483,50 @@ EOS
|
|
483
483
|
return tb
|
484
484
|
end
|
485
485
|
|
486
|
+
# EIN input helper
|
487
|
+
# @param id [String] ein input id
|
488
|
+
# @param name [String] ein input name
|
489
|
+
# @param value [String] ein input value
|
490
|
+
# @param label [String] ein input label
|
491
|
+
# @param required [Boolean] if required or not
|
492
|
+
# @param placeholder [String] ein input placeholder text
|
493
|
+
# @param mask [String] ein input mask
|
494
|
+
# @param maxlength [String] nuber input max length
|
495
|
+
# @return [String] compiled html of ein input
|
496
|
+
def x_ein(id: "", name: "", value: "", label: "", required: false, placeholder: "", mask: "99-9999999", maxlength: "10")
|
497
|
+
|
498
|
+
if required
|
499
|
+
if label != ""
|
500
|
+
required_output = '<sup class="text-danger">*</sup>'
|
501
|
+
else
|
502
|
+
required_output = ''
|
503
|
+
end
|
504
|
+
required_tag = 'required="required"'
|
505
|
+
else
|
506
|
+
required_output = ""
|
507
|
+
required_tag = ""
|
508
|
+
end
|
509
|
+
|
510
|
+
if label != ""
|
511
|
+
label = "<label>#{label}#{required_output}</label>"
|
512
|
+
end
|
513
|
+
|
514
|
+
if mask != ""
|
515
|
+
mask = "data-masked-input='#{mask}'"
|
516
|
+
end
|
517
|
+
|
518
|
+
if maxlength != ""
|
519
|
+
maxlength = "maxlength='#{maxlength}'"
|
520
|
+
end
|
521
|
+
|
522
|
+
tb = <<EOS
|
523
|
+
<div class="form-group">
|
524
|
+
#{label}
|
525
|
+
<input type="text" class="form-control" id="#{id}" name="post[#{name}]" value="#{value}" #{required_tag} placeholder="#{placeholder}" #{mask} #{maxlength} />
|
526
|
+
</div>
|
527
|
+
EOS
|
528
|
+
return tb
|
529
|
+
end
|
486
530
|
|
487
531
|
# Zip input helper
|
488
532
|
# @param id [String] zip input id
|
data/lib/platformx/version.rb
CHANGED