kadmin 1.2.0 → 1.2.1
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/app/helpers/kadmin/bootstrap_helper.rb +14 -6
- data/config/locales/en.yml +2 -0
- data/lib/kadmin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ae7ab81f575c8f1b81ea683971e2d1c1eb674f71ee0f7434ac2295394763363
|
|
4
|
+
data.tar.gz: 2e9dbf8da6871530fd4bb86a6c7213fdc4c2c6bdfabdf4fad71dff8f5095e27e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0ceaa06561d11a4a467af85d8e979b96c5f4378fda459f78d0a0bef941f94866c254a856c9c7341a2ad444288d2531c68d7cdd019bf2b6cddb644ea213a67f42
|
|
7
|
+
data.tar.gz: 1938dc5c81a833f9dadb3780cc5d5d1ef1757a6a9b8fdd3eb70a02fdac9617d837d52e61a52792a5b5caa7cf28162bef60b961e593f36a967626c1d7b5dea09b
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Kadmin
|
|
2
4
|
# Collection of Bootstrap helpers
|
|
3
5
|
module BootstrapHelper
|
|
@@ -17,7 +19,13 @@ module Kadmin
|
|
|
17
19
|
# @param [Hash, String] url_options anything accepted by link_to and image_tag
|
|
18
20
|
# @param [Integer] max_height maximum height of the thumbnail
|
|
19
21
|
def thumbnail_link(url_options, max_height)
|
|
20
|
-
return link_to(
|
|
22
|
+
return link_to(
|
|
23
|
+
image_tag(url_options),
|
|
24
|
+
url_options,
|
|
25
|
+
class: 'thumbnail',
|
|
26
|
+
style: "max-height: #{max_height}px",
|
|
27
|
+
target: 'new'
|
|
28
|
+
)
|
|
21
29
|
end
|
|
22
30
|
|
|
23
31
|
# Generates a navigation drop down for bootstrap
|
|
@@ -35,7 +43,7 @@ module Kadmin
|
|
|
35
43
|
return content_tag(:div, button + list, class: 'dropdown', style: 'display: inline-block;')
|
|
36
44
|
end
|
|
37
45
|
|
|
38
|
-
#
|
|
46
|
+
# Custom label generator using bootstrap i.e. * for mendatory feilds, help icon and popover for help
|
|
39
47
|
# @param [String] label text for the view
|
|
40
48
|
# @param [String] label_for is ID of the html element for which we are displaying label.
|
|
41
49
|
# @param [Boolean] Display the red asteric to indicate mendatory field.
|
|
@@ -43,15 +51,15 @@ module Kadmin
|
|
|
43
51
|
# @param [String] Title of the popover
|
|
44
52
|
# @param [String] Body text of popover
|
|
45
53
|
# @param [String] classname for the label.
|
|
46
|
-
def
|
|
54
|
+
def create_custom_label(label, label_for = '', required = false, display_help = true, title = '', message = '', label_class = 'control-label')
|
|
47
55
|
label = t(label)
|
|
48
56
|
label = label.html_safe
|
|
49
57
|
|
|
50
|
-
require_html = required ? '<span class="required-field"><span>':''
|
|
58
|
+
require_html = required ? '<span class="required-field"><span>' : ''
|
|
51
59
|
icon_html = "<i class='fa fa-question-circle' style='color:green'></i>"
|
|
52
60
|
|
|
53
|
-
display_message =
|
|
54
|
-
if
|
|
61
|
+
display_message = ''
|
|
62
|
+
if display_help
|
|
55
63
|
message = t(message)
|
|
56
64
|
message = message.gsub('"', '\"')
|
|
57
65
|
message = message.gsub("'", "\'")
|
data/config/locales/en.yml
CHANGED
data/lib/kadmin/version.rb
CHANGED