mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-07 23:44:55 +08:00
24 lines
992 B
Text
24 lines
992 B
Text
<% if can_view_or_download_result_assets(result.my_module) %>
|
|
<% if result.asset.file.processing? %>
|
|
<span data-status='asset-loading'
|
|
data-present-url='<%= file_present_asset_path(result.asset) %>'>
|
|
<%= image_tag 'medium/processing.gif' %>
|
|
</span>
|
|
<% else %>
|
|
<%= link_to download_asset_path(result.asset), data: {no_turbolink: true} do %>
|
|
<%= image_tag(preview_asset_path result.asset) if result.asset.is_image? %>
|
|
<p><%= truncate(result.asset.file_file_name,
|
|
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
|
|
<% end %>
|
|
<% end %>
|
|
<% else %>
|
|
<% if result.asset.file.processing? %>
|
|
<span data-status='asset-loading'
|
|
data-present-url='<%= file_present_asset_path(result.asset) %>'>
|
|
<%= image_tag 'medium/processing.gif' %>
|
|
</span>
|
|
<% else %>
|
|
<%= image_tag(preview_asset_path result.asset) if result.asset.is_image? %>
|
|
<p><%= result.asset.file_file_name %></p>
|
|
<% end %>
|
|
<% end %>
|