">
<%= step.position + 1 %>
<% if can_reorder_step_in_protocol(@protocol) %> " data-remote="true"> " data-remote="true"> <% end %> <% if can_edit_step_in_protocol(@protocol) %> " href="<%= edit_step_path(step, format: :json) %>" data-remote="true"> <% end %> <% if can_delete_step_in_protocol(@protocol) && step.can_destroy? %> <%= link_to(step_path(step), title: t("protocols.steps.options.delete_title"), method: "delete", class: "btn btn-link", data: {action: "delete-step", confirm: t("protocols.steps.destroy.confirm", step: step.name)}) do %> <% end %> <% end %>
<%= step.name %> | <%= sanitize_input t('protocols.steps.published_on', timestamp: l(step.created_at, format: :full), user: h(step.user.full_name)) %>
<% if strip_tags(step.description).blank? %> <%= t('protocols.steps.no_description') %> <% else %>
<%= custom_auto_link(generate_image_tag_from_token(step.description), simple_format: false, tags: %w(img)) %>
<% end %>

<% unless step.tables.blank? then %>
<% step.tables.each do |table| %> <%= auto_link(simple_format(table.name), link: :urls, html: { target: '_blank' }) %>
<%= hidden_field(table, :contents, value: table.contents_utf_8, class: "hot-contents") %>
<% end %>
<% end %> <% assets = ordered_assets(step) %> <% unless assets.blank? then %>
<%= t("protocols.steps.files") %>
    <% assets.each do |asset| %>
  • <% if can_view_or_download_step_assets(@protocol) %> <% if asset.file_present %> <% if asset.file.processing? %> <%= image_tag 'medium/processing.gif' %> <% else %> <% 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 %> <%= render partial: 'steps/wopi_controlls.html.erb', locals: { asset: asset } %> <% end %> <% end %> <% else %> <%= image_tag 'medium/processing.gif' %> <% end %> <% else %> <% if asset.file.processing? %> <%= image_tag 'medium/processing.gif' %> <% else %> <%= image_tag asset.url(:medium) if asset.is_image? %> <% end %>

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

    <% end %>
  • <% end %>
<% end %> <% unless step.checklists.blank? then %>
<% step.checklists.asc.each do |checklist| %> <%= custom_auto_link(checklist.name) %> <% if checklist.checklist_items.empty? %>
<%= t("protocols.steps.empty_checklist") %>
<% else %> <% ordered_checklist_items(checklist).each do |checklist_item| %>
>
<% end %> <% end %> <% end %>
<% end %> <% if @protocol.in_module? %> <% if !step.completed? and can_complete_step_in_protocol(@protocol) %>
<% elsif step.completed? and can_uncomplete_step_in_protocol(@protocol) %>
<% end %> <% end %>
<% if can_view_step_comments(@protocol) %>
<% end %>