<% assets = ordered_assets(step) %>

<%= t('protocols.steps.files', count: assets.length) %>

<% if !(preview) && (can_manage_protocol_in_module?(@protocol) || can_manage_protocol_in_repository?(@protocol)) %> <%= render partial: '/assets/marvinjs/create_marvin_sketch_button.html.erb', locals: { element_id: step.id, element_type: 'Step', sketch_container: ".attachments#att-#{step.id}" } %> <%= render partial: '/assets/wopi/create_wopi_file_button.html.erb', locals: { element_id: step.id, element_type: 'Step' } %> <% end %>
<% assets.each_with_index do |asset, i| %> <% order_atoz = az_ordered_assets_index(step, asset.id) %> <% order_ztoa = assets.length - az_ordered_assets_index(step, asset.id) %> <% if asset.class.name == 'Asset' %> <%= render partial: 'steps/attachments/item.html.erb', locals: { asset: asset, i: i, assets_count: assets.length, step: step, order_atoz: order_atoz, order_ztoa: order_ztoa } %> <% elsif asset.class.name == 'MarvinJsAsset' %> <%= render partial: 'assets/marvinjs/marvin_sketch_card.html.erb', locals: { sketch: asset, i:i, assets_count: assets.count, step: step} %> <% end %> <% end %>