scinote-web/app/views/reports/elements/_step_table_element.html.erb

41 lines
1.5 KiB
Text
Raw Normal View History

2021-06-10 16:59:34 +08:00
<% table ||= report_element.table %>
2016-07-21 19:11:15 +08:00
<% timestamp = table.created_at %>
2021-06-10 16:59:34 +08:00
<div class="report-element report-step-attachment-element report-step-table-element">
2016-02-12 23:52:43 +08:00
<div class="report-element-header">
<div class="row">
<div class="pull-left attachment-icon">
2021-06-10 16:59:34 +08:00
<span class="fas fa-table"></span>
2016-02-12 23:52:43 +08:00
</div>
<div class="pull-left table-name">
<% if defined? export_all and export_all %>
<% file_link = @obj_filenames.dig(:tables, table.id, :file) %>
<a href="<%= file_link %>">
2021-06-10 16:59:34 +08:00
<em>
<%= t('projects.reports.elements.step_table.table_name', name: file_link&.split('/')&.last) %>
</em>
</a>
<% else %>
<% if table.try(:name) %>
2021-06-10 16:59:34 +08:00
<em>
<%= t('projects.reports.elements.step_table.table_name', name: truncate(table.name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
</em>
<% end %>
<% end %>
</div>
2016-02-12 23:52:43 +08:00
<div class="pull-left user-time">
2021-06-10 16:59:34 +08:00
<%= t('projects.reports.elements.step_table.user_time', timestamp: l(timestamp, format: :full)) %>
2016-02-12 23:52:43 +08:00
</div>
</div>
</div>
<div class="report-element-body">
2019-07-15 19:27:27 +08:00
<input type="hidden" class="hot-table-contents" value="<%= table.contents_utf_8 %>" />
<div class="hot-table-container"></div>
<table class="report-common-table-format"></table>
2016-02-12 23:52:43 +08:00
</div>
<% if defined?(children) %>
<div class="report-element-children">
<%= children %>
</div>
<% end %>
</div>