2018-12-12 18:15:16 +08:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<style type="text/css">
|
2018-12-19 04:03:10 +08:00
|
|
|
<%= Rails.application
|
|
|
|
.assets_manifest
|
|
|
|
.find_sources('application.css')
|
|
|
|
.first
|
|
|
|
.to_s
|
|
|
|
.force_encoding(Encoding::UTF_8)
|
|
|
|
.html_safe %>
|
2018-12-12 18:15:16 +08:00
|
|
|
</style>
|
2019-01-31 14:39:17 +08:00
|
|
|
|
2019-03-08 00:42:47 +08:00
|
|
|
<!-- Libraries for tables and formulas -->
|
|
|
|
<% ['handsontable.full.min.js', 'lodash.js', 'numeral.js', 'numeric.js',
|
|
|
|
'md5.js', 'jstat.js', 'formula.js', 'parser.js', 'ruleJS.js',
|
|
|
|
'handsontable.formula.js', 'big.min.js' ].each do |js_asset| %>
|
2019-09-12 16:45:43 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
<%= j Rails.application
|
2019-03-08 00:42:47 +08:00
|
|
|
.assets_manifest
|
|
|
|
.find_sources(js_asset)
|
|
|
|
.first
|
2019-09-12 16:45:43 +08:00
|
|
|
.to_s
|
2019-03-08 00:42:47 +08:00
|
|
|
.force_encoding(Encoding::UTF_8)
|
|
|
|
.html_safe %>
|
2019-09-12 16:45:43 +08:00
|
|
|
</script>
|
2019-03-08 00:42:47 +08:00
|
|
|
<% end %>
|
2019-01-31 14:39:17 +08:00
|
|
|
|
|
|
|
<!-- Init Handsontables -->
|
|
|
|
<script>
|
|
|
|
window.onload = function() {
|
|
|
|
var tables = document.getElementsByClassName('hot-table-container');
|
|
|
|
var tableVals = document.getElementsByClassName('hot-table-contents');
|
|
|
|
|
|
|
|
for (i = 0; i < tables.length; i++) {
|
|
|
|
tables[i].innerHTML=''
|
|
|
|
new Handsontable(tables[i], {
|
|
|
|
data: JSON.parse(tableVals[i].value).data,
|
|
|
|
rowHeaders: true,
|
|
|
|
colHeaders: true,
|
|
|
|
filters: true,
|
|
|
|
dropdownMenu: true,
|
|
|
|
formulas: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2018-12-12 18:15:16 +08:00
|
|
|
<title><%= title %></title>
|
|
|
|
</head>
|
|
|
|
<body class='print-report-body'>
|
|
|
|
<div class='print-report'>
|
2018-12-19 04:03:10 +08:00
|
|
|
<%= content.force_encoding(Encoding::UTF_8).html_safe %>
|
2018-12-12 18:15:16 +08:00
|
|
|
</div>
|
|
|
|
</body>
|
2019-01-31 14:39:17 +08:00
|
|
|
</html>
|