2016-02-12 23:52:43 +08:00
|
|
|
<% if asset.blank? and @asset.present? then asset = @asset end %>
|
|
|
|
<% is_image = asset.is_image? %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% timestamp = asset.created_at %>
|
2017-06-20 22:07:34 +08:00
|
|
|
<% icon_class = 'glyphicon ' + (is_image ? 'glyphicon-picture' : 'glyphicon-file') %>
|
2017-06-05 18:24:06 +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_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">
|
|
|
|
<span class="glyphicon <%= icon_class %>"></span>
|
|
|
|
</div>
|
|
|
|
<div class="pull-left file-name">
|
2016-10-11 21:13:05 +08:00
|
|
|
<em><%=t 'projects.reports.elements.step_asset.file_name', file: truncate( asset.file_file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %></em>
|
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">
|
|
|
|
<% if is_image %>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12 file-image">
|
2016-07-21 19:11:15 +08:00
|
|
|
<%= report_image_asset_url(asset) %>
|
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>
|