% if can_view_or_download_result_assets(result.my_module) %> <% if result.asset.file.processing? %> <%= image_tag 'medium/processing.gif' %> <% else %> <% if result.asset.is_image? %> <%= link_to download_asset_path(result.asset), class: 'image-preview-link', id: "modal_link#{result.asset.id}", data: {no_turbolink: true, description: "#{truncate(result.name, length: Constants::FILENAME_TRUNCATION_LENGTH)}"} do %> <%= image_tag result.asset.url(:medium), data: {'preview-url': large_image_url_asset_path(result.asset)} %>
<%= truncate(result.asset.file_file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
<% end %> <% else %> <%= link_to download_asset_path(result.asset), data: {no_turbolink: true} do %> <% if wopi_file?(result.asset) %> <%= wopi_asset_file_name(result.asset) %> <% else %><%= truncate(result.asset.file_file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
<% end %> <% end %> <%= wopi_result_view_file_button(result) %> <%= wopi_result_edit_file_button(result) %> <% end %> <% end %> <% end %>