MiraitSystems/enju_trunk

View on GitHub
app/views/page/_checkouts_family_list.html.erb

Summary

Maintainability
Test Coverage
<h3><%= t('checked_item.previous_checkout_family') -%></h3>

<table class="index">
  <tr>
    <%- if SystemConfiguration.get("checked_items.disp_title") -%>
      <th class="checked_item_title"><%= t('page.title') -%></th>
    <%- end -%>
    <th><%= t('activerecord.attributes.item.item_identifier') -%></th>
    <th><%= t('activerecord.attributes.item.note') -%></th>
    <th><%= t('activerecord.attributes.checkout.due_date') -%></th>
    <%- if SystemConfiguration.get("checked_items.disp_user") -%>
      <th><%= t('activerecord.attributes.checkout.family_info') -%></th>
    <%- end -%>
  </tr>

  <% @family_users.each do |f_user| %>
    <%- f_user.checkouts.not_returned.each_with_index do |checkout, i| -%>
      <tr class="line<%= cycle("0", "1") -%>">
        <%- if SystemConfiguration.get("checked_items.disp_title") -%>
          <td>
            <%= render 'manifestations/show_index', :manifestation => checkout.item.manifestation -%>
            <%= render 'manifestations/holding', :manifestation => checkout.item.manifestation -%>
          </td>
        <%- end -%>
        <td><%= link_to checkout.item.item_identifier, checkout.item -%></td>
        <td><%= checkout.item.note -%></td>
        <td>
          <%= l(checkout.due_date, :format => :only_date) %>
          <% if Time.zone.parse(checkout.due_date.to_s) < Time.now %>
            <br /><strong style="color: red;"><%= t('activerecord.attributes.checkout.past_due') %></strong>
          <% end %>
        </td>
        <%- if SystemConfiguration.get("checked_items.disp_user") -%>
          <td><%= link_to f_user.agent.full_name, f_user -%><br />
              (<%= link_to f_user.username, f_user -%>)</td>
        <%- end -%>
      </tr>
    <%- end -%>
  <%- end -%>
</table>