2018-08-29 12:56:47 +08:00
|
|
|
<% asset ||= @asset %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% timestamp = asset.created_at %>
|
2020-10-28 23:32:22 +08:00
|
|
|
<% icon_class = file_fa_icon_class(asset) if asset.file_name %>
|
2019-07-09 16:28:15 +08:00
|
|
|
<div class="report-element report-step-attachment-element report-step-asset-element" data-ts="<%= timestamp.to_i %>" data-type="step_asset" data-id='{ "asset_id": <%= asset.id %> }' data-scroll-id="<%= asset.id %>" data-name="<%=t "projects.reports.elements.step_asset.sidebar_name", file: asset.file_name %>" data-icon-class="<%= icon_class %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="report-element-header">
|
|
|
|
<div class="row">
|
|
|
|
<div class="pull-left attachment-icon">
|
2020-10-28 23:32:22 +08:00
|
|
|
<span class="fas <%= icon_class %>"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
<div class="pull-left file-name">
|
2018-09-18 11:40:43 +08:00
|
|
|
<% if defined? export_all and export_all %>
|
2020-11-27 18:07:37 +08:00
|
|
|
<a href="<%= path[:file] %>">
|
2020-11-11 22:48:00 +08:00
|
|
|
<em><%= t('projects.reports.elements.step_asset.file_name', file: filename) %></em>
|
2018-08-29 12:56:47 +08:00
|
|
|
</a>
|
|
|
|
<% else %>
|
2020-11-11 22:48:00 +08:00
|
|
|
<em>
|
|
|
|
<%= t('projects.reports.elements.step_asset.file_name',
|
|
|
|
file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
|
2020-12-03 19:16:48 +08:00
|
|
|
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
|
2020-11-11 22:48:00 +08:00
|
|
|
</em>
|
|
|
|
|
2018-08-29 12:56:47 +08:00
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
<div class="pull-left user-time">
|
2016-08-17 15:28:35 +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 class="pull-right controls">
|
2016-08-17 15:28:35 +08:00
|
|
|
<%= render partial: 'reports/elements/element_controls.html.erb' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
</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 %>
|
2020-11-27 18:07:37 +08:00
|
|
|
<img class="report-export-img" src="<%= path[: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>
|
|
|
|
<div class="report-element-children">
|
|
|
|
<%= children if (defined? children and children.present?) %>
|
|
|
|
</div>
|
|
|
|
</div>
|