sanger/sequencescape

View on GitHub
app/views/pipelines/_assets.html.erb

Summary

Maintainability
Test Coverage

<table class="sortable table table-striped" id="pipeline_inbox">
  <thead>
    <tr>
      <th>&nbsp;</th>
      <th id="priority_flag"><a><%= vite_image_tag("images/icon_0_flag.png", size: "16x16") %></a></th>

      <% @inbox_presenter.each_field_header do |field_name| %>
        <th><a><%= field_name %></a></th>
      <% end %>

      <th></th>
    </tr>
  </thead>
  <tbody>
    <% @inbox_presenter.each_line do |line| -%>

      <% line.groupless? do -%>
        <tr><td colspan="<%= @inbox_presenter.field_count+2 %>">Null Group</td></tr>
      <% end -%>

      <% line.standard_fields? do %>
        <tr>
          <!-- Shared fields. -->
          <td class="request center" width='5%'>
            <%= label_tag(line.request_group_id, "Select #{ line.parent.human_barcode } for batch", style: 'display:none') %>
            <%= label_tag(line.request_group_id, "Include request #{line.index+1}", style: 'display:none') %>
            <%= check_box(:request_group, line.group_id, id: line.request_group_id, class: 'grouped_checkbox', :'data-count' => line.well_count) %>
            <%= hidden_field_tag("#{line.request_group_id}_size", "",  value: line.well_count)  %>
          </td>
          <td  style='text-align: center'>
            <!-- TODO: Restore priority toggle for grouped submissions -->
            <%= vite_image_tag "images/icon_#{line.priority}_flag.png", 'alt' => line.priority, size: '16x16', class: "flag_image", "data-priority" => line.priority %>
          </td>

          <!-- Custom fields -->
          <% line.each_field do |value| %>
            <td><%= value %></td>
          <% end %>

          <td><%= link_to 'Show plate', show_plate_labware_url(line.parent) %></td>
        </tr>
      <% end %>

      <% line.parentless? do %>
        <tr>
          <!-- Shared Fields -->
          <td class="bg-danger"></td>
          <td class="bg-danger"></td>
          <!-- Custom Fields -->
          <td class="request center" width='5%' colspan="3" style="background:red;font-weight:bold;">Empty parent ID set</td>
          <td class="bg-danger"><%= line.wells %></td>
          <% (@inbox_presenter.field_count-2).times do %>
            <td class="bg-danger"></td>
          <% end %>
        </tr>
      <% end -%>
    <% end -%>
  </tbody>
</table>