2016-07-21 19:11:15 +08:00
|
|
|
<% if can_view_or_download_result_assets(result.my_module) %>
|
2017-01-06 22:58:23 +08:00
|
|
|
<% 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 %>
|
|
|
|
<% if result.asset.is_image? %>
|
|
|
|
<%= link_to download_asset_path(result.asset),
|
|
|
|
class: 'image-preview-link',
|
|
|
|
id: "modal_link#{result.asset.id}",
|
2017-01-16 21:49:37 +08:00
|
|
|
data: {no_turbolink: true,
|
|
|
|
description: "#{truncate(result.name, length: Constants::FILENAME_TRUNCATION_LENGTH)}"} do %>
|
2017-01-06 22:58:23 +08:00
|
|
|
<%= image_tag result.asset.url(:medium), data: {'preview-url': large_image_url_asset_path(result.asset)} %>
|
|
|
|
<p><%= truncate(result.asset.file_file_name,
|
|
|
|
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
|
|
|
|
<% end %>
|
2016-12-20 00:36:18 +08:00
|
|
|
<% else %>
|
2017-01-06 22:58:23 +08:00
|
|
|
<%= link_to download_asset_path(result.asset), data: {no_turbolink: true} do %>
|
|
|
|
<p><%= truncate(result.asset.file_file_name,
|
2016-12-20 00:36:18 +08:00
|
|
|
length: Constants::FILENAME_TRUNCATION_LENGTH) %></p>
|
2017-01-06 22:58:23 +08:00
|
|
|
<% end %>
|
2016-12-09 20:59:49 +08:00
|
|
|
<% end %>
|
2016-08-17 21:51:04 +08:00
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
2016-12-09 20:59:49 +08:00
|
|
|
<% 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 %>
|
2016-12-20 00:36:18 +08:00
|
|
|
<%= image_tag result.asset.url(:medium) if result.asset.is_image? %>
|
2016-12-09 20:59:49 +08:00
|
|
|
<p><%= result.asset.file_file_name %></p>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|