sanger/sequencescape

View on GitHub
app/views/assets/samples_partials/_lane_samples.erb

Summary

Maintainability
Test Coverage
<section id="samples-table" class='info-panel'>
  <header>
    <a href='#plate-samples-table-collapser' role="button" data-toggle='collapse'>
    <h3>Samples
      <%= counter_badge asset.aliquots.count %>
      <small class='show-hide'>Click to toggle</small>
    </h3>
    </a>
  </header>
  <div class="card-body">
    If the tags below are not correct, you may wish to <%= link_to 'perform tag substitution', new_receptacle_tag_substitution_path(asset) %>.
  </div>
  <div id="plate-samples-table-collapser" class="collapse in show">
    <table id="plate-samples-table" class="sortable">
      <colgroup>
        <col class="npg_aliquot_index">
      </colgroup>
      <thead>
        <tr>
          <th>NPG Aliquot Index</th>
          <th>Sample Name</th>
          <th>Sanger Sample Id</th>
          <th>Tag</th>
          <th>Tag2</th>
        </tr>
      </thead>
      <tbody>
       <% asset.aliquots.include_summary.each_with_index do |aliquot,i| %>
       <tr>
         <td><%= aliquot.aliquot_index.try(:aliquot_index)||'Not Set' %></td>
         <td><%= link_to(aliquot.sample.name, sample_url(aliquot.sample)) -%></td>
         <td><%= aliquot.sample.sanger_sample_id %></td>
         <td><%= render partial: 'shared/tag_info', locals: {tag: aliquot.tag } if aliquot.tag.present? %></td>
         <td><%= render partial: 'shared/tag_info', locals: {tag: aliquot.tag2 } if aliquot.tag2.present? %></td>
       </tr>
       <% end %>
      </tbody>
    </table>
  </div>
</section>