diff --git a/app/components/blacklight/search/sidebar_component.html.erb b/app/components/blacklight/search/sidebar_component.html.erb index 875525941a..1f7058e6c0 100644 --- a/app/components/blacklight/search/sidebar_component.html.erb +++ b/app/components/blacklight/search/sidebar_component.html.erb @@ -1,8 +1,10 @@ -<% facet_group_names.each do |groupname| %> - <% fields = facet_fields_in_group(groupname) %> - <%= render group_component_class.new(id: groupname, fields: fields, response: response) do |component| %> - <% component.with_body do %> - <%= render Blacklight::FacetComponent.with_collection(fields, response: response) %> + + <% facet_group_names.each do |groupname| %> + <% fields = facet_fields_in_group(groupname) %> + <%= render group_component_class.new(id: groupname, fields: fields, response: response) do |component| %> + <% component.with_body do %> + <%= render Blacklight::FacetComponent.with_collection(fields, response: response) %> + <% end %> <% end %> <% end %> -<% end %> \ No newline at end of file + diff --git a/app/components/blacklight/search_bar_component.html.erb b/app/components/blacklight/search_bar_component.html.erb index 77027e2d62..56b04acdb7 100644 --- a/app/components/blacklight/search_bar_component.html.erb +++ b/app/components/blacklight/search_bar_component.html.erb @@ -1,39 +1,41 @@ -<%= form_with url: @url, local: true, method: @method, class: @classes.join(' '), scope: @prefix, role: 'search', **@form_options do |f| %> - <%= render Blacklight::HiddenSearchStateComponent.new(params: @params) %> - <% if search_fields.length > 1 %> - <%= f.label :search_field, scoped_t('search_field.label'), class: 'sr-only visually-hidden' %> - <% end %> - <% before_input_groups.each do |input_group| %> - <%= input_group %> - <% end %> -
- <%= prepend %> - + + <%= form_with url: @url, local: true, method: @method, class: @classes.join(' '), scope: @prefix, role: 'search', **@form_options do |f| %> + <%= render Blacklight::HiddenSearchStateComponent.new(params: @params) %> <% if search_fields.length > 1 %> - <%= f.select(:search_field, - options_for_select(search_fields, h(@search_field)), - {}, - title: scoped_t('search_field.title'), - class: "custom-select form-select search-field") %> - <% elsif search_fields.length == 1 %> - <%= f.hidden_field :search_field, value: search_fields.first.last %> + <%= f.label :search_field, scoped_t('search_field.label'), class: 'sr-only visually-hidden' %> <% end %> - - <%= f.label @query_param, scoped_t('search.label'), class: 'sr-only visually-hidden' %> - <% if autocomplete_path.present? %> - - <%= f.search_field @query_param, value: @q, placeholder: scoped_t('search.placeholder'), class: "search-q q form-control rounded-#{search_fields.length > 1 ? '0' : 'left'}", autofocus: @autofocus, aria: { label: scoped_t('search.label'), autocomplete: 'list', controls: 'autocomplete-popup' } %> - - - <% else %> - <%= f.search_field @query_param, value: @q, placeholder: scoped_t('search.placeholder'), class: "search-q q form-control rounded-#{search_fields.length > 1 ? '0' : 'left'}", autofocus: @autofocus, aria: { label: scoped_t('search.label') } %> + <% before_input_groups.each do |input_group| %> + <%= input_group %> <% end %> +
+ <%= prepend %> - <%= append %> - <%= search_button || render(Blacklight::SearchButtonComponent.new(id: "#{@prefix}search", text: scoped_t('submit'))) %> -
-<% end %> + <% if search_fields.length > 1 %> + <%= f.select(:search_field, + options_for_select(search_fields, h(@search_field)), + {}, + title: scoped_t('search_field.title'), + class: "custom-select form-select search-field") %> + <% elsif search_fields.length == 1 %> + <%= f.hidden_field :search_field, value: search_fields.first.last %> + <% end %> -<% if advanced_search_enabled? %> - <%= link_to t('blacklight.advanced_search.more_options'), @advanced_search_url, class: 'advanced_search btn btn-secondary'%> -<% end %> + <%= f.label @query_param, scoped_t('search.label'), class: 'sr-only visually-hidden' %> + <% if autocomplete_path.present? %> + + <%= f.search_field @query_param, value: @q, placeholder: scoped_t('search.placeholder'), class: "search-q q form-control rounded-#{search_fields.length > 1 ? '0' : 'left'}", autofocus: @autofocus, aria: { label: scoped_t('search.label'), autocomplete: 'list', controls: 'autocomplete-popup' } %> + + + <% else %> + <%= f.search_field @query_param, value: @q, placeholder: scoped_t('search.placeholder'), class: "search-q q form-control rounded-#{search_fields.length > 1 ? '0' : 'left'}", autofocus: @autofocus, aria: { label: scoped_t('search.label') } %> + <% end %> + + <%= append %> + <%= search_button || render(Blacklight::SearchButtonComponent.new(id: "#{@prefix}search", text: scoped_t('submit'))) %> +
+ <% end %> + + <% if advanced_search_enabled? %> + <%= link_to t('blacklight.advanced_search.more_options'), @advanced_search_url, class: 'advanced_search btn btn-secondary'%> + <% end %> +