Sha256: d231aba0affe150292287abe2d9f8c03aac2e8b312a1235439a773df39fe549c

Contents?: true

Size: 1.91 KB

Versions: 5

Compression:

Stored size: 1.91 KB

Contents

<%
# Overridden from Blacklight to add a drop down that allows the user to choose to search w/i the collection or all collections
%>
<%= form_tag search_action_url, method: :get, class: 'search-query-form pr-0', role: 'search' do %>
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:q, :search_field, :qt, :page, :utf8).merge(f: (search_state.params_for_search[:f] || {}).except(:collection_sim))) %>
  <div class="d-md-flex">
    <%= render 'catalog/within_collection_dropdown' %>

    <% if search_fields.length > 1 %>
      <label for="search_field" class="sr-only"><%= t('blacklight.search.form.search_field.label') %></label>
    <% end %>
    <div class="input-group flex-nowrap">
      <% if search_fields.length > 1 %>
          <%= select_tag(:search_field,
                         options_for_select(search_fields, h(params[:search_field])),
                         title: t('blacklight.search.form.search_field.title'),
                         id: "search_field",
                         class: "custom-select search-field") %>
      <% elsif search_fields.length == 1 %>
        <%= hidden_field_tag :search_field, search_fields.first.last %>
      <% end %>

      <label for="q" class="sr-only"><%= t('blacklight.search.form.search.label') %></label>
      <%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search-q q rounded-0 form-control", id: "q", autofocus: presenter.autofocus?, data: { autocomplete_enabled: presenter.autocomplete_enabled?, autocomplete_path: search_action_path(action: :suggest) }  %>

      <span class="input-group-append">
        <button type="submit" class="btn btn-primary search-btn" id="search">
          <span class="submit-search-text d-none d-lg-inline"><%= t('blacklight.search.form.submit') %></span>
          <%= blacklight_icon :search, aria_hidden: true %>
        </button>
      </span>
    </div>
  </div>
<% end %>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
arclight-0.4.0 app/views/catalog/_search_form.html.erb
arclight-0.3.3 app/views/catalog/_search_form.html.erb
arclight-0.3.2 app/views/catalog/_search_form.html.erb
arclight-0.3.1 app/views/catalog/_search_form.html.erb
arclight-0.3.0 app/views/catalog/_search_form.html.erb