% assets = step.assets.joins(file_attachment: :blob) %>
<% current_order = step.current_view_state(current_user).state.dig('assets', 'sort') %>
<%= t('protocols.steps.files', count: assets.length) %>
<% if !(preview) && (can_manage_protocol_in_module?(@protocol) ||
can_manage_protocol_draft_in_repository?(@protocol)) %>
<% end %>
<% assets.each_with_index do |asset, i| %>
<%= render partial: 'assets/asset.html.erb', locals: { asset: asset, gallery_view_id: step.id } %>
<% end %>