report_html 0.4.0 → 0.4.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/lib/report_html/report_html.rb +15 -4
- data/lib/report_html/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: ae390a98f4aba531a0136ef3ba84f173606fa2fe
|
4
|
+
data.tar.gz: 99b6d40461c46fefbdde2dd57362186de97ce9ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc5800e555d65b3b755ee63bde4bf2cd967d2475225b96dcd1031f99f3fb7f77e55b53d6d441ea6e9586a8dd7548a227bd499388c5faa455965d6e1e7ad07104
|
7
|
+
data.tar.gz: 2722a44f4841d1cf5c7c6f73be72db4a5c950f05e2069ad75f6053a6c411a424815cd8eef91f9be03d17dcf1249797ee197b9f56ecbc5da5f73f193d0c533563
|
@@ -14,6 +14,7 @@ class Report_html
|
|
14
14
|
@plots_data = []
|
15
15
|
@count_objects = 0
|
16
16
|
@dt_tables = [] #Tables to be styled with the DataTables js lib"
|
17
|
+
@bs_tables = [] #Tables to be styled with the bootstrap js lib"
|
17
18
|
end
|
18
19
|
|
19
20
|
def build(template)
|
@@ -57,7 +58,8 @@ class Report_html
|
|
57
58
|
<meta charset=\"utf-8\">
|
58
59
|
<meta http-equiv=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">
|
59
60
|
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
|
60
|
-
<meta http-equiv=\"Content-Language\" content=\"en-us\"
|
61
|
+
<meta http-equiv=\"Content-Language\" content=\"en-us\" />
|
62
|
+
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n"
|
61
63
|
|
62
64
|
# ADD JS LIBRARIES AND CSS
|
63
65
|
js_libraries = []
|
@@ -66,10 +68,18 @@ class Report_html
|
|
66
68
|
js_libraries << 'canvasXpress.min.js'
|
67
69
|
css_files << 'canvasXpress.css'
|
68
70
|
end
|
71
|
+
|
72
|
+
if !@dt_tables.empty? || !@bs_tables.empty? #Bootstrap for datatables or only for static tables. Use bootstrap version needed by datatables to avoid incompatibility issues
|
73
|
+
@all_report << '<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>'+"\n"
|
74
|
+
end
|
75
|
+
|
69
76
|
if !@dt_tables.empty? # CDN load, this library is difficult to embed in html file
|
70
|
-
|
71
|
-
|
72
|
-
|
77
|
+
@all_report << '<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap.min.css"/>'+"\n"
|
78
|
+
@all_report << '<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>' + "\n"
|
79
|
+
@all_report << '<script type="text/javascript" src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>' + "\n"
|
80
|
+
@all_report << '<script type="text/javascript" src="https://cdn.datatables.net/1.10.21/js/dataTables.bootstrap.min.js"></script>' + "\n"
|
81
|
+
end
|
82
|
+
|
73
83
|
loaded_js_libraries = load_js_libraries(js_libraries)
|
74
84
|
loaded_css = load_css(css_files)
|
75
85
|
loaded_css.each do |css|
|
@@ -221,6 +231,7 @@ class Report_html
|
|
221
231
|
rowspan, colspan = get_col_n_row_span(array_data)
|
222
232
|
table_id = 'table_' + @count_objects.to_s
|
223
233
|
@dt_tables << table_id if options[:styled] == 'dt'
|
234
|
+
@bs_tables << table_id if options[:styled] == 'bs'
|
224
235
|
tbody_tag = false
|
225
236
|
html = "
|
226
237
|
<table id=\"#{table_id}\" border=\"#{options[:border]}\" #{table_attr}>
|
data/lib/report_html/version.rb
CHANGED