sanger/sequencescape

View on GitHub
app/views/receptacles/summary.html.erb

Summary

Maintainability
Test Coverage

<%- add :about, "Asset summary" %>

<div class="page-header"><h1>Summary of <%= h(@asset.display_name) %></h1></div>
<div class='subtitle'>
  <%= @asset.sti_type %> <%= @asset.id %> &middot; Created on <%= @asset.created_at.to_formatted_s(:long) %>
</div>

<% unless @summary.size > 0  -%>
  No events registered for this item.
<% else -%>

  <table width='100%' cellspacing="0" cellpadding="4" class="sortable">
    <thead>
      <tr>
        <th>Date</th>
        <th>Event</th>
        <th>Study information</th>
        <th>Lab information</th>
        </tr>
    </thead>
    <tbody>
    <% @summary.summaries.each do |summary_item| -%>
    <tr class="<%= cycle("rowodd", "roweven") %>">
      <td><%= summary_item.timestamp.to_formatted_s(:sortable) %></td>
      <td><%= summary_item.message %></td>
      <td><%= dynamic_link_to(summary_item) %></td>
      <% if summary_item.external_message %>
                <td><%= link_to(summary_item.external_message, summary_item.external_link.to_s) %></td>
      <% else %>
        <td></td>
      <% end %>

    </tr>
    <% end -%>
    </tbody>
  </table>
<% end -%>