diff --git a/app/views/protocols/index/_protocol_preview_modal_body.html.erb b/app/views/protocols/index/_protocol_preview_modal_body.html.erb index 965233d2a..e686ad1af 100644 --- a/app/views/protocols/index/_protocol_preview_modal_body.html.erb +++ b/app/views/protocols/index/_protocol_preview_modal_body.html.erb @@ -113,13 +113,24 @@ <% assets.each do |asset| %>
  • <% if can_view_or_download_step_assets(@protocol) %> - <%= link_to download_asset_path(asset), data: {no_turbolink: true, id: true, status: "asset-present"} do %> - <%= image_tag preview_asset_path(asset) if asset.is_image? %> -

    <%= truncate(asset.file_file_name, - length: Constants::FILENAME_TRUNCATION_LENGTH) %>

    + <% if asset.is_image? %> + <%= link_to download_asset_path(asset), + class: 'image-preview-link', + id: "modal_link#{asset.id}", + data: {no_turbolink: true, id: true, status: "asset-present", + description: "#{step.position + 1}. #{truncate(step.name, length: Constants::FILENAME_TRUNCATION_LENGTH)}"} do %> + <%= image_tag asset.url(:medium), data: {'preview-url': large_image_url_asset_path(asset)} %> +

    <%= truncate(asset.file_file_name, + length: Constants::FILENAME_TRUNCATION_LENGTH) %>

    + <% end %> + <% else %> + <%= link_to download_asset_path(asset), data: {no_turbolink: true} do %> +

    <%= truncate(asset.file_file_name, + length: Constants::FILENAME_TRUNCATION_LENGTH) %>

    + <% end %> <% end %> <% else %> - <%= image_tag preview_asset_path(asset) if asset.is_image? %> + <%= image_tag asset.url(:medium) if asset.is_image? %>

    <%= truncate(asset.file_file_name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>

    <% end %>