Sha256: 19f0fa1bd30d59144038c360466db52a7cd2a57cd87ec9fca674feeecca5882a

Contents?: true

Size: 1.69 KB

Versions: 1

Compression:

Stored size: 1.69 KB

Contents

<%= form_tag search_action_url, method: :get, class: 'search-query-form', role: 'search', 'aria-label' => t('blacklight.search.form.submit') do %>
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:q, :search_field, :qt, :page, :utf8)) %>
  <% 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">
    <% 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 form-control rounded-#{search_fields.length > 1 ? '0' : 'left'}", id: "q", autocomplete: presenter.autocomplete_enabled? ? "off" : "", 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"><%= t('blacklight.search.form.submit') %></span>
        <%= blacklight_icon :search, aria_hidden: true %>
      </button>
    </span>
  </div>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-7.10.0 app/views/catalog/_search_form.html.erb