sanger/limber

View on GitHub
app/views/labware/_simple_tube.html.erb

Summary

Maintainability
Test Coverage
<%# locals: (tube:, open_in_new_window: false) %>
<% tube_path = limber_tube_path(tube.uuid) + "#relatives" %>
<div class="relative-item">
  <div id="<%= "aliquot_#{tube.uuid}" %>" class="tube-svg colour-<%= 1 %> float-left">
    <%= inline_svg_tag 'images/tube.svg', height:'5.5em' %>
  </div>
  <dl class='metadata'>
    <dt>Tube name</dt>
      <dd class="position-static"><%# relative positioning breaks the link, static is browser default -%>
        <%= link_to tube_path, class: 'card-link stretched-link', target: (open_in_new_window ? '_blank' : '_self') do %>
          <%= tube.name %>
        <% end %>
      </dd>
    <dt>Barcode</dt><dd><%= useful_barcode(tube.barcode) %></dd>
    <dt>Current state</dt><dd><%= content_tag(:span, state_badge(tube.state)) %></dd>
  </dl>
</div>