<%= t('page.editing', :model => t('activerecord.models.inter_library_loan')) -%>

<%= form_for(@inter_library_loan) do |f| -%> <%= f.error_messages -%>
<%= f.label t('inter_library_loan.borrowing_library') -%>
<%= f.select(:borrowing_library_id, @libraries.collect{|l| [l.display_name.localize, l.id]}) -%>
<%= f.label t('activerecord.models.item') -%>
<%= link_to @inter_library_loan.item.shelf.library.display_name.localize, @inter_library_loan.item.shelf.library -%> <%= link_to @inter_library_loan.item.item_identifier, @inter_library_loan.item -%> (<%= link_to @inter_library_loan.item.manifestation.original_title, @inter_library_loan.item.manifestation -%>) <%= f.hidden_field :item_id -%>
<%- case @inter_library_loan.state when 'requested' -%>
<%= f.label :requested_at -%>
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
<%- if @inter_library_loan.item.hold?(current_user.library) -%>
<%= f.label :shipped_at -%>
<%= f.datetime_select :shipped_at -%>
<%= f.submit :data => {:confirm => t('page.are_you_sure')} -%>
<%- end -%> <%- when 'shipped' -%>
<%= f.label :requested_at -%>
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
<%= f.label :shipped_at -%>
<%=l @inter_library_loan.shipped_at if @inter_library_loan.shipped_at %>
<%- if !@inter_library_loan.item.hold?(current_user.library) -%>
<%= f.label :received_at -%>
<%= f.datetime_select :received_at -%>
<%= f.submit :data => {:confirm => t('page.are_you_sure')} -%>
<%- end -%> <%- when 'received' -%>
<%= f.label :requested_at -%>
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
<%= f.label :shipped_at -%>
<%=l @inter_library_loan.shipped_at if @inter_library_loan.shipped_at %>
<%= f.label :received_at -%>
<%=l @inter_library_loan.received_at if @inter_library_loan.received_at %>
<%- if !@inter_library_loan.item.hold?(current_user.library) -%>
<%= f.label :return_shippd_at -%>
<%= f.datetime_select :return_shipped_at -%>
<%= f.submit :data => {:confirm => t('page.are_you_sure')} -%>
<%- end -%> <%- when 'return_shipped' -%>
<%= f.label :requested_at -%>
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
<%= f.label :shipped_at -%>
<%=l @inter_library_loan.shipped_at if @inter_library_loan.shipped_at %>
<%= f.label :received_at -%>
<%=l @inter_library_loan.received_at if @inter_library_loan.received_at %>
<%= f.label :return_shippd_at -%>
<%=l @inter_library_loan.return_shipped_at if @inter_library_loan.return_shipped_at %>
<%- if @inter_library_loan.item.hold?(current_user.library) -%>
<%= f.label :return_received_at -%>
<%= f.datetime_select :return_received_at -%>
<%= f.submit :data => {:confirm => t('page.are_you_sure')} -%>
<%- end -%> <%- when 'return_received' -%>
<%= f.label :requested_at -%>
<%=l @inter_library_loan.requested_at if @inter_library_loan.requested_at %>
<%= f.label :shipped_at -%>
<%=l @inter_library_loan.shipped_at if @inter_library_loan.shipped_at %>
<%= f.label :received_at -%>
<%=l @inter_library_loan.received_at if @inter_library_loan.received_at %>
<%= f.label :return_shippd_at -%>
<%=l @inter_library_loan.return_shipped_at if @inter_library_loan.return_shipped_at %>
<%= f.label :return_received_at -%>
<%=l @inter_library_loan.return_received_at if @inter_library_loan.return_received_at %>
<%- end -%> <%- end -%>