mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-08 07:21:03 +08:00
Replace Handson table in reports with simple table [SCI-3636] (#1895)
* Replace handsone table in reports with simple table * Add result tables
This commit is contained in:
parent
bdd1ca2a65
commit
01a01157d3
4 changed files with 54 additions and 6 deletions
|
|
@ -68,6 +68,28 @@ label {
|
|||
}
|
||||
}
|
||||
|
||||
.report-common-table-format {
|
||||
width: 100%;
|
||||
|
||||
tr {
|
||||
|
||||
td,
|
||||
th {
|
||||
border: 1px solid $color-silver;
|
||||
padding: 5px;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
min-height: 19px;
|
||||
}
|
||||
}
|
||||
|
||||
th {
|
||||
background: $color-concrete;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* New page content */
|
||||
#report-new {
|
||||
|
|
|
|||
|
|
@ -28,8 +28,20 @@
|
|||
</div>
|
||||
<div class="report-element-body">
|
||||
<% if rows_json[:data].count > 0 %>
|
||||
<input type="hidden" class="hot-table-contents hot-samples" value='<%= rows_json.to_json.force_encoding(Encoding::UTF_8) %>' />
|
||||
<div class="hot-table-container"></div>
|
||||
<table class="report-common-table-format">
|
||||
<tr>
|
||||
<% rows_json[:headers].each do |cell| %>
|
||||
<th><span><%= cell %></span></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% rows_json[:data].each do |row| %>
|
||||
<tr>
|
||||
<% row.each do |cell| %>
|
||||
<td><span><%= cell %></span></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% else %>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -34,8 +34,15 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="report-element-body">
|
||||
<input type="hidden" class="hot-table-contents" value="<%= table.contents_utf_8 %>" />
|
||||
<div class="hot-table-container"></div>
|
||||
<table class="report-common-table-format">
|
||||
<% JSON.parse(table.contents_utf_8)['data'].each do |row| %>
|
||||
<tr>
|
||||
<% row.each do |cell| %>
|
||||
<td><span><%= cell %></span></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
<div class="report-element-children">
|
||||
<%= children if (defined? children and children.present?) %>
|
||||
|
|
|
|||
|
|
@ -29,8 +29,15 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="report-element-body">
|
||||
<input type="hidden" class="hot-table-contents" value="<%= table.contents_utf_8 %>" />
|
||||
<div class="hot-table-container"></div>
|
||||
<table class="report-common-table-format">
|
||||
<% JSON.parse(table.contents_utf_8)['data'].each do |row| %>
|
||||
<tr>
|
||||
<% row.each do |cell| %>
|
||||
<td><span><%= cell %></span></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
<div class="report-element-children">
|
||||
<%= children if (defined? children and children.present?) %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue