sanger/sequencescape

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

Summary

Maintainability
Test Coverage

<% add :menu, "New/Edit Plate Templates" => plate_templates_path -%>

<%= form_for @workflow, url: { action: "stage", id: @stage, workflow_id: @workflow.id, batch_id: @batch.id, next_stage: true }, html: { id: "stage_form", multipart: true} do |form| %>
  <%= panel(:info,title:"Step 1: Layout wells on plates") do %>
  <fieldset class="col-md-5">
    <legend>Automatic</legend>
    <table cellspacing='0' cellpadding='0'>
      <tr>
        <td><label for="plate_purpose_id">Output plate purpose</label>:</td>
        <td><%= select_tag("plate_purpose_id", options_for_select(@plate_purpose_options, PlatePurpose.stock_plate_purpose.id)) %></td>
      </tr>
      <%- if fluidigm_target?(@batch) %>
        <tr>
          <td>Scan fluidigm plate:</td>
          <td><%= text_field_tag 'fluidigm_plate' %></td>
        </tr>
      <%- end %>
      <tr>
        <td><label for="plate_template_0">Plate Template</label>:</td>
        <td><%= select("plate_template", "0", @plate_templates.pluck(:name, :id))  %></td>
      </tr>
    </table>
    <p class='help-block'>Templates define which wells to leave empty on a plate when you cherrypick samples. You can add to an existing partial plate by scanning the barcode, or entering the plate ID.  The plate must have been previously picked in SequenceScape.  Wells can be rearranged in the next step.</p>
  </fieldset>

  <div class="col-md-2">
    <h3 class="text-center">OR</h3>
  </div>

  <fieldset class="col-md-5">
    <legend>Manual</legend>
    <table cellspacing='0' cellpadding='0'>
      <tr>
        <td></td>
        <td><%= link_to "Download spreadsheet", url_for(controller: :batches, action: :download_spreadsheet, id: @batch.id) %></td>
      </tr>
      <tr>
        <td></td>
        <td>
          <%= file_field_tag "file", size: 50 %>
        </td>
      </tr>
    </table>
    <p class='help-block'><%= link_to "Download the file", url_for(controller: :batches, action: :download_spreadsheet, id: @batch.id) %>, enter the destination wells (A1,B2...), save as CSV, then upload.  If there are any errors with the uploaded wells, the wells wont be cherrypicked and will be put back in the inbox.  Wells can be rearranged in the next step.</p>
  </fieldset>
  <% end %>

  <div class="col-md-6">
    <%= panel(:info,title:"Step 2: Select robot and plate type") do %>
      <fieldset>
        <legend>Cherrypicking robot</legend>
        <table cellspacing='0' cellpadding='0'>
          <tr>
            <td><label for="plate_type">Source Plates Type</label>:</td>
            <td><%= select_tag "plate_type", options_for_select(PlateType.pluck(:name)) %></td>
          </tr>
          <tr>
            <td><label for="robot_id">Picking Robot</label>:</td>
            <td><%= select_tag("robot_id", options_for_select(@robots.collect {|p| [ p.name, p.id ] }))  %></td>
          </tr>
        </table>
      </fieldset>
    <% end %>
  </div>
  <div class="col-md-6">
    <%= panel(:info,title:"Step 3: Layout wells on plates") do %>
      <%= render partial: 'cherrypicking_volume_by_micro_litre' %>
    <% end %>
  </div>

  <%= render partial: "next_stage_submit" %>
<% end %>