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

<%= form_for :libraries, :url => libraries_path, :html => {:method => 'get'} do -%>

<%= t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%> <%= submit_tag t('page.search') -%>

<%- end -%>

<%= t('page.sort_by') -%>: <%= link_to t('activerecord.attributes.library.name'), libraries_path(:order => 'name') -%> <%= link_to t('page.created_at'), libraries_path(:sort_by => 'created_at') -%>

<%- @libraries.each_with_index do |library, i| -%> "> <%- end -%>
<%= t('activerecord.attributes.library.name') -%> <%= t('activerecord.attributes.library.telephone_number_1') -%> / <%= t('activerecord.attributes.library.telephone_number_2') -%> <%= t('activerecord.attributes.library.fax_number') -%>
<%- if can?(:update, library) and params[:query].blank? -%> <%= library.first? ? image_tag('icons/stop.png', :size => '16x16') : link_to(image_tag('icons/arrow_up.png', :size => '16x16', :alt => t('page.asc')), {:action => 'update', :move => 'higher', :id => library.name}, :method => :put) -%> <%= library.last? ? image_tag('icons/stop.png', :size => '16x16') : link_to(image_tag('icons/arrow_down.png', :size => '16x16', :alt => t('page.desc')), {:action => 'update', :move => 'lower', :id => library.name}, :method => :put) -%> <%- end -%> <%= link_to library.display_name.localize, library -%>
<%= library.zip_code -%> <%= library.address -%>
<%= library.telephone_number_1 -%>
<%= library.telephone_number_2 -%>
<%= library.fax_number -%> <%- if can? :update, library -%> <%= link_to image_tag('icons/page_white_edit.png', :size => '16x16', :alt => t('page.edit')), edit_library_path(library) -%> <% end %> <%- if can? :destroy, library -%> <%= link_to image_tag('icons/delete.png', :size => '16x16', :alt => t('page.destroy')), library, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%> <%- end -%>
<%= will_paginate(@libraries) %>