% if asset.file_present %> <% if asset.file.processing? && display_image_tag && asset.is_image? %> <%= image_tag 'medium/processing.gif' %> <%= link_to download_asset_path(asset), class: 'file-preview-link', id: "modal_link#{asset.id}", data: { no_turbolink: true, id: true, status: 'asset-present', 'preview-url': asset_file_preview_path(asset) } do %> <%= truncate(asset.file_file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %> <% end %> <% else %> <%= link_to download_asset_path(asset), class: 'file-preview-link', id: "modal_link#{asset.id}", data: { no_turbolink: true, id: true, status: 'asset-present', 'preview-url': asset_file_preview_path(asset) } do %> <% if asset.is_image? && display_image_tag %> <%= image_tag asset.url(:medium) %> <% end %> <% if display_image_tag %>
<%= truncate(asset.file_file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
<% else %> <%= truncate(asset.file_file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %> <% end %> <% end %> <% end %> <% else %> <%= image_tag 'medium/processing.gif' %> <% end %>