sanger/sequencescape

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

Summary

Maintainability
Test Coverage

<h2>Plate <%= index+1 %></h2>
<%= hidden_field_tag 'rows', plate_rows %>
<%= hidden_field_tag 'columns', plate_cols %>
<%= hidden_field_tag 'plate_size', plate_cols*plate_rows %>
<% unless @plate.nil?-%><%= hidden_field_tag 'plate_barcode', @plate.human_barcode %><% end -%>

<table id="plate_<%=index+1-%>" class="plate destination_plate" width="100%">
  <thead>
    <% (plate_cols+1).times do |i| %>
    <th scope='col'><%= i %></th>
    <% end %>
  </thead>
  <% plate_rows.times do |row| %>
    <tr id="plate[<%= index %>][<%= row %>]">
      <th class='border' width='2%' scope='row'><%= (65+row).chr %></td>
      <% plate_cols.times do |col| %>
        <% current_well = plate[col*plate_rows + row]  %>

        <% if current_well[0] == 0 -%>
          <td class="empty" draggable="true"><%= current_well[1] %></td>
        <% else -%>
          <td id="well_<%= current_well[0] %>" draggable="true" class="<%= plate_class[current_well[1]] %>" ><%= current_well[1] %><br /><%= current_well[2] %></td>
        <% end -%>
      <% end %>
    </tr>
  <% end %>
</table>