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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3c778cfc4d16fb58dca14c2efc6880a6688dd7e
4
- data.tar.gz: 327ad156b2d7850d262ea407754d8b12e339314e
3
+ metadata.gz: ae390a98f4aba531a0136ef3ba84f173606fa2fe
4
+ data.tar.gz: 99b6d40461c46fefbdde2dd57362186de97ce9ed
5
5
  SHA512:
6
- metadata.gz: 142d48a425f8770302c736c772a3c7c6286eac94a457fed15e2c4407e7ccf194e069fd8b3dc306e92c67527cd06ded30990fd06bdb48f7f76ded18a46b6c7b9a
7
- data.tar.gz: aa57ba7753c8d8f44284b19d21a8fe4d6a3175bc83716f853245a7945ed4f37de5dc2866b2c7493fac7e0daac5a77f68ead7a370b4d27e3bc150bbd842ff4e06
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\" />\n"
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
- @all_report << '<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jq-3.3.1/dt-1.10.21/datatables.min.css"/>'+"\n"
71
- @all_report << '<script type="text/javascript" src="https://cdn.datatables.net/v/dt/jq-3.3.1/dt-1.10.21/datatables.min.js"></script>'+"\n"
72
- end
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}>
@@ -1,3 +1,3 @@
1
1
  module ReportHtml
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: report_html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - seoanezonjic