2021-06-10 16:59:34 +08:00
|
|
|
<% asset ||= report_element.asset %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% timestamp = asset.created_at %>
|
2021-06-10 16:59:34 +08:00
|
|
|
<div class="report-element report-step-attachment-element report-step-asset-element">
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="report-element-header">
|
2022-05-31 20:40:25 +08:00
|
|
|
<div class="pull-left attachment-icon <%= defined?(export_all) && export_all ? 'export-all-icons' : '' %>">
|
|
|
|
<%= file_extension_icon_html(asset, true) %>
|
|
|
|
</div>
|
|
|
|
<div class="pull-left file-name">
|
|
|
|
<% if defined? export_all and export_all %>
|
|
|
|
<% if @obj_filenames.dig(:assets, asset.id, :bio_eddie) %>
|
|
|
|
<% file_link = @obj_filenames.dig(:assets, asset.id, :bio_eddie) %>
|
2018-08-29 12:56:47 +08:00
|
|
|
<% else %>
|
2022-05-31 20:40:25 +08:00
|
|
|
<% file_link = @obj_filenames.dig(:assets, asset.id, :file) %>
|
2018-08-29 12:56:47 +08:00
|
|
|
<% end %>
|
2022-05-31 20:40:25 +08:00
|
|
|
<a href="<%= file_link %>" class="export-all-link">
|
|
|
|
<em><%= file_link&.split('/')&.last %></em>
|
|
|
|
</a>
|
|
|
|
<% else %>
|
|
|
|
<em>
|
2022-10-14 19:57:13 +08:00
|
|
|
<% if asset.file.metadata && asset.file.metadata[:asset_type] == 'bio_eddie' %>
|
2022-05-31 20:40:25 +08:00
|
|
|
<%= truncate("#{asset.file.metadata[:name]}.helm", length: Constants::FILENAME_TRUNCATION_LENGTH) %>
|
|
|
|
<a class="btn btn-light file-download-link" href="data:text/plain;charset=utf-8,<%= asset.file.metadata[:description] %>" download="<%= asset.file.metadata[:name] %>.helm" data-turbolinks="false">
|
|
|
|
<span class="fas fa-download"></span> <%= t('Download')%>
|
|
|
|
</a>
|
|
|
|
<% else %>
|
|
|
|
<%= truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
|
|
|
|
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
|
|
|
|
<% end %>
|
|
|
|
</em>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="user-time">
|
2023-02-07 17:39:11 +08:00
|
|
|
<%= t('projects.reports.elements.step_asset.user_time', timestamp: l(timestamp, format: :full)) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="report-element-body">
|
2020-10-28 23:32:22 +08:00
|
|
|
<% if asset.previewable? && !asset.list? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12 file-image">
|
2019-01-10 21:16:09 +08:00
|
|
|
<% if defined?(export_all) && export_all %>
|
2021-06-08 20:21:34 +08:00
|
|
|
<img class="report-export-img" src="<%= @obj_filenames.dig(:assets, asset.id, :preview) %>">
|
2019-01-10 21:16:09 +08:00
|
|
|
<% else %>
|
|
|
|
<%= report_image_asset_url(asset) %>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2021-05-20 20:16:39 +08:00
|
|
|
<% if defined?(children) %>
|
|
|
|
<div class="report-element-children">
|
|
|
|
<%= children %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|