<%= t("protocols.steps.new.asset_panel_title") %>
<% unless ff.object.file.exists? && ff.object.locked? %> <%= ff.remove_nested_fields_link do %> <% end %> <% end %>
<% if ff.object.file.exists? %> <% if can_view_or_download_step_assets(@protocol) %> <% if ff.object.is_image? %> <%= link_to download_asset_path(ff.object), class: 'image-preview-link', id: "modal_link#{ff.object.id}", data: {no_turbolink: true, id: true, status: "asset-present", description: "#{step.position + 1}. #{truncate(step.name, length: Constants::FILENAME_TRUNCATION_LENGTH)}"} do %> <% if ff.object.is_image? %> <%= image_tag ff.object.url(:medium), data: {'preview-url': large_image_url_asset_path(ff.object)} %>

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

<% else %>

<%= file_extension_icon(ff.object) %> <%= ff.object.file_file_name %>

<% end %> <% end %> <% else %> <%= link_to download_asset_path(ff.object), data: {no_turbolink: true} do %> <% if ff.object.is_image? %> <%= image_tag ff.object.url(:medium) %>

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

<% else %>

<%= file_extension_icon(ff.object) %> <%= ff.object.file_file_name %>

<% end %> <% end %> <% end %> <% else %> <%= image_tag image_tag ff.object.url(:medium) if ff.object.is_image? %>

<%= ff.object.file_file_name %>

<% end %> <% else %> <%= ff.file_field :file %> <% end %>