-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2725 from sul-dlss/primary-outline
Use Primary outline style for search related controls
- Loading branch information
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %> |