MiraitSystems/enju_trunk

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

Summary

Maintainability
Test Coverage
<script>
  jQuery(function(){ $('#query').focus(); })
</script>

<%= form_for :manifestations, :url => manifestations_path, :html => {:method => 'get'} do -%>
  <br />
  <p class="bigger_font">
    <%= t('page.search_term') -%>:
    <%= search_field_tag 'query', nil, :class => 'search_form_short', :placeholder => t('page.search_term') -%> 
    <%= submit_tag t('page.search') -%><br />
    <%- if SystemConfiguration.get('nacsis.use_cat') -%>
      <%= t('page.search_for') -%>:
      <%= radio_button_tag 'index', 'local', true -%><%= t('page.search_local', :library => "#{LibraryGroup.first.display_name}") -%>
      <%= radio_button_tag 'index', 'nacsis', false -%><%= t('page.search_nacsis') -%>
    <%- end -%>
  </p>
  <p class="bigger_font">
    <% unless SystemConfiguration.get("manifestation.show_all") %>
      <% if user_signed_in? and current_user.has_role?('Librarian') %>
        <%= check_box_tag 'all_manifestations', true %><%= t('advanced_search.all_manifestations') %>
        |
      <% end %>
    <% end %>
    <style="display: inline"><%= link_to t('page.advanced_search'), page_advanced_search_path -%></style>
  </p>
<%- end -%>
<%= javascript_tag("$('#query').focus()") -%>