MiraitSystems/enju_trunk

View on GitHub
app/views/accepts/_list.html.erb

Summary

Maintainability
Test Coverage
<div style="color: red"><%= flash[:message] -%></div>

<div class="search_form">
<%= form_for(:accept, url: accepts_path(basket_id: @basket.id), remote: true) do |f| %>
  <%= f.error_messages %>
  <p>
    <%= label_tag :item_identifier, t('accept.order_number_or_item_identifier') -%>:
    <%= f.search_field :item_identifier, class: 'resource_item_identifier', value: nil -%>
    <%= f.submit t('activerecord.attributes.accept.accept'), 'data-disable-with' => t('page.saving') -%>
    <%= t('accept.accept_notice') %>
  </p>
<%- end -%>
</div>
<br />

<table class="index">
  <tr>
    <th><%= t('activerecord.models.item') -%></th>
    <th><%= t('activerecord.models.order') -%></th>
  </tr>
  <%- @accepts.each_with_index do |accept, i| -%>
    <tr class="line<%= cycle("0", "1") -%>">
      <td>
        <%= render 'manifestations/show_index', manifestation: accept.item.manifestation %>
        <%= link_to accept.item.item_identifier, accept.item -%> / <%= accept.item.call_number %>
        (<%= link_to accept.item.shelf.library.display_name.localize, accept.item.shelf.library %> /
        <%= link_to accept.item.shelf.display_name.localize, accept.item.shelf %>)<br />
        <%=l accept.created_at %>
      </td>
      <td>
        <%= accept.order.order_list.title %> <br />
        <%= accept.order.purchase_order_number %> <br />
        <%= l(accept.order.order_list.ordered_on) %> <br />
        <%= accept.order.order_list.bookstore.name %>
      </td>
    </tr>
  <%- end -%>
</table>

<%= javascript_tag("$(function(){$('#accept_item_identifier').focus()})") %>