%= render 'page/required_field' %>
<%= simple_form_for(@item) do |f| -%>
<%= f.error_messages -%>
<%= f.hidden_field :manifestation_id, value: @item.manifestation_id if @item.manifestation_id %>
<%= f.label "#{t('activerecord.models.library')} / #{t('activerecord.models.shelf')}" -%>
<%= f.select :library_id, @libraries.map{|l| [l.display_name.localize, l.id]} %>
<%= f.select :shelf_id, @shelves.map{|s| [s.display_name.localize, s.id]} %>
<%= render 'observe_field' %>
<% if defined?(EnjuCirculation) %>
<%= f.label t('activerecord.models.checkout_type') -%>
<%= f.select(:checkout_type_id, @checkout_types.collect{|c| [c.display_name.localize, c.id]}) -%>
<%= f.label t('activerecord.models.circulation_status') -%>
<%= f.select(:circulation_status_id, @circulation_statuses.collect{|c| [c.display_name.localize, c.id]}) -%>
<%= f.label t('activerecord.models.use_restriction') -%>
<%= f.fields_for :item_has_use_restriction do |i| %>
<%= i.select :use_restriction_id, @use_restrictions.collect{|r| [r.display_name.localize, r.id]} %>
<% end %>
<% end %>
<%= f.label :include_supplements -%>
<%= f.check_box :include_supplements -%>
<%= f.label :call_number -%>
<%= f.text_field :call_number -%>
<%= f.label t('activerecord.models.budget_type') -%>
<%= f.select(:budget_type_id, @budget_types.collect{|b| [b.display_name.localize, b.id]}, include_blank: true) -%>
<%= f.label t('activerecord.models.bookstore') -%>
<%= f.select(:bookstore_id, @bookstores.collect{|b| [b.name, b.id]}, include_blank: true) -%>
<%= f.label :price -%>
<%= f.text_field :price -%>
<%= f.label :url -%>
<%= f.url_field :url, class: 'resource_url' -%>
<%= f.label t('role.required_role') -%>
<%= f.select(:required_role_id, @roles.collect{|r| [r.display_name.localize, r.id]}) -%>
<%= f.label :acquired_at -%>
<%= f.text_field :acquired_at, value: @item.acquired_at.try(:strftime, "%Y-%m-%d"), class: 'date_text_field', placeholder: "#{t('page.example')}: 2011-04-12"-%>
<%= f.label :binding_call_number -%>
<%= f.text_field :binding_call_number -%>
<%= f.label :binded_at -%>
<%= f.text_field :binded_at, value: @item.binded_at.try(:strftime, "%Y-%m-%d"), class: 'date_text_field', placeholder: "#{t('page.example')}: 2014-07-20"-%>
<%= f.label :binding_item_identifier -%>
<%= f.text_field :binding_item_identifier, class: 'resource_identifier' -%>
<%= f.label :note -%>
<%= f.text_area :note, class: 'resource_textarea' -%>
<%= f.label :item_identifier -%>
<%= f.text_field :item_identifier, class: 'resource_identifier' -%>
<%= f.hidden_field :lock_version %>
<%= f.submit data: {disable_with: t('page.saving')} -%>
<%= javascript_tag("$(function(){$('#library_id').focus()})") %>
<%- end -%>