Skip to content

Commit

Permalink
Merge pull request #2725 from sul-dlss/primary-outline
Browse files Browse the repository at this point in the history
Use Primary outline style for search related controls
  • Loading branch information
corylown authored Dec 13, 2024
2 parents 5126a1d + 7c8593b commit f8bfcc9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
11 changes: 11 additions & 0 deletions app/components/dropdown_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

# Displays drop down for search controls. Overriding to use btn-outline-primary
class DropdownComponent < Blacklight::System::DropdownComponent
def before_render
# this is overriding the default button classes set in Blacklight
# (we want to use btn-outline-primary for EarthWorks instead of btn-outline-secondary)
with_button(label: button_label, classes: %w(btn btn-outline-primary dropdown-toggle))
super
end
end
1 change: 1 addition & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class CatalogController < ApplicationController
config.skip_link_component = SkipLinkComponent
config.exhibit_navbar_component = ExhibitNavbarComponent
config.index.search_bar_component = ExhibitSearchBarComponent
config.index.dropdown_component = DropdownComponent
config.index.default_thumbnail = :exhibits_default_thumbnail

config.document_solr_request_handler = 'document'
Expand Down
13 changes: 13 additions & 0 deletions app/views/catalog/_view_type_group.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<%= render(Blacklight::Response::ViewTypeComponent.new(
response: @response,
views: document_index_view_controls,
search_state: search_state,
selected: document_index_view_type)) do |component| %>
<% document_index_view_controls.each do |key, config| %>
<% component.with_view(key: key,
view: config,
selected: document_index_view_type == key,
search_state: search_state,
classes: 'btn btn-outline-primary btn-icon') %>
<% end %>
<% end %>
4 changes: 2 additions & 2 deletions app/views/search_across/_group_toggle.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% unless @response.documents.blank? %>
<div class="btn-group search-group" role="group" aria-label="Basic example">
<%= link_to 'All results', url_for(search_without_group), class: "btn btn-sm btn-secondary #{'active' unless params[:group]}" %>
<%= link_to 'Grouped by exhibit', url_for(search_with_group), class: "btn btn-sm btn-secondary #{'active' if params[:group]}" %>
<%= link_to 'All results', url_for(search_without_group), class: "btn btn-sm btn-primary #{'active' unless params[:group]}" %>
<%= link_to 'Grouped by exhibit', url_for(search_with_group), class: "btn btn-sm btn-primary #{'active' if params[:group]}" %>
</div>
<% end %>

0 comments on commit f8bfcc9

Please sign in to comment.