Sha256: 0a2e41f71acbf0f6d63067cedfe9f707393724fffbfa221304f0799f0c0d158c

Contents?: true

Size: 1.82 KB

Versions: 13

Compression:

Stored size: 1.82 KB

Contents

<%= form_tag @url, method: @method, class: @classes.join(' '), role: 'search', aria: { label: scoped_t('submit') }, **@form_options do %>
  <%= render_hash_as_hidden_fields(@params) %>
  <% if search_fields.length > 1 %>
    <label for="search_field" class="sr-only visually-hidden"><%= scoped_t('search_field.label') %></label>
  <% end %>
  <% before_input_groups.each do |input_group| %>
    <%= input_group %>
  <% end %>
  <div class="input-group">
    <%= prepend %>

    <% if search_fields.length > 1 %>
        <%= select_tag(:search_field,
                       options_for_select(search_fields, h(@search_field)),
                       title: scoped_t('search_field.title'),
                       id: "#{@prefix}search_field",
                       class: "custom-select form-select search-field") %>
    <% elsif search_fields.length == 1 %>
      <%= hidden_field_tag :search_field, search_fields.first.last %>
    <% end %>

    <label for="<%= @prefix %><%= @query_param %>" class="sr-only visually-hidden"><%= scoped_t('search.label') %></label>
    <%= text_field_tag @query_param, @q, placeholder: scoped_t('search.placeholder'), class: "search-q q form-control rounded-#{search_fields.length > 1 ? '0' : 'left'}", id: "#{@prefix}q", autocomplete: autocomplete_path.present? ? "off" : "", autofocus: @autofocus, aria: { label: scoped_t('search.label') }, data: { autocomplete_enabled: autocomplete_path.present?, autocomplete_path: autocomplete_path }  %>

    <span class="input-group-append">
      <%= append %>
      <%= search_button || render(Blacklight::SearchButtonComponent.new(id: "#{@prefix}search", text: scoped_t('submit'))) %>
    </span>
  </div>
<% end %>

<% if advanced_search_enabled? %>
  <%= link_to t('blacklight.advanced_search.more_options'), @advanced_search_url, class: 'advanced_search btn btn-secondary'%>
<% end %>

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
blacklight-7.40.0 app/components/blacklight/search_bar_component.html.erb
blacklight-7.39.0 app/components/blacklight/search_bar_component.html.erb
blacklight-7.38.0 app/components/blacklight/search_bar_component.html.erb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/app/components/blacklight/search_bar_component.html.erb
blacklight-7.37.0 app/components/blacklight/search_bar_component.html.erb
blacklight-7.36.2 app/components/blacklight/search_bar_component.html.erb
blacklight-7.36.1 app/components/blacklight/search_bar_component.html.erb
blacklight-7.36.0 app/components/blacklight/search_bar_component.html.erb
blacklight-7.35.0 app/components/blacklight/search_bar_component.html.erb
blacklight-7.34.0 app/components/blacklight/search_bar_component.html.erb
blacklight-7.33.1 app/components/blacklight/search_bar_component.html.erb
blacklight-7.33.0 app/components/blacklight/search_bar_component.html.erb
blacklight-7.32.0 app/components/blacklight/search_bar_component.html.erb