sanger/sequencescape

View on GitHub
app/views/workflows/_descriptors.html.erb

Summary

Maintainability
Test Coverage

  <% if @task.per_item_for(@batch.requests) %>
    <% @batch.requests.sort_by(&:position).each do |request| %>
      <h4>Request <%= request.position %>: <%= request.asset.display_name -%></h4>
      <%= render partial: 'descriptor', collection: @task.descriptors_for(request), locals: { request: request } %>
    <% end %>
  <% else %>
    <% descriptors = params[:descriptors].present? ? @task.descriptors_with_values(params[:descriptors]) :
                                                     @task.descriptors_for(@batch.requests.first) %>
    <%= render partial: 'descriptor', collection: descriptors, locals: { request: nil } %>
  <% end %>