sanger/sequencescape

View on GitHub
app/views/plate_summaries/show.html.erb

Summary

Maintainability
Test Coverage
<%= page_title("plate summary", @plate.human_barcode) %>

<div class='columnize'>
  <%= bs_custom_panel(:info, :table, {class: 'table table-summary'}, {title: 'Summary' }) do %>
        <tr>
          <th>Submissions</th>
          <td>
            <ul>
             <% @plate.submissions.each do |submission|%>
               <li><%= link_to submission.name, submission_path(submission) %></li>
             <% end %>
           </ul>
          </td>
        </tr>
        <tr>
          <th>Plate link</th>
          <td><%= link_to "Plate page", labware_path(@plate) %></td>
        </tr>
        <tr>
          <th>Sequencing batches</th>
          <td><ul><%- @sequencing_batches.each do |batch| %>
            <li>
              <%= link_to "Batch #{batch.id}", batch_path(batch) %>
              (<%= link_to "Show in NPG", "#{configatron.run_data_by_batch_id_url}#{batch.id}" %>)
            </li>
            <% end %>
          </ul></td>
        </tr>
  <% end %>

  <%= render partial: "custom_metadatum_collection" %>
</div>

<%= bs_custom_panel(:info, :table, {class: 'sortable table table-striped'}, {title: 'Samples' }) do %>
   <thead>
     <tr>
       <th>Well</th>
       <th>Sample</th>
       <th>Study</th>
       <th>Project</th>
     </tr>
   </thead>
   <tbody>
      <% @plate.wells.for_summary.each do |well| %>
        <tr>
          <td><%= link_to well.map_description, receptacle_path(well) %></td>
          <td><% well.samples.each do |sample| %>
                <%= link_to sample.name, sample_path(sample) %>
              <% end %>
          </td>
          <td><% well.studies.each do |study| %>
                <%= link_to study.name, study_path(study) %>
              <% end %>
          </td>
           <td><% well.projects.each do |project| %>
                <%= link_to project.name, project_path(project) %>
              <% end %>
          </td>
        </tr>
      <% end %>
   </tbody>
<% end %>

<div class='columnize'>
  <% @plate.descendant_plates.each do |descendant| %>
    <%= render partial: "descendant", locals: {descendant: descendant} %>
  <% end %>
  <% @plate.descendant_tubes.each do |descendant| %>
    <%= render partial: "descendant", locals: {descendant: descendant} %>
  <% end %>
</div>