From 72823a4af0b989569f201fc166e3d05f50acc023 Mon Sep 17 00:00:00 2001 From: Huda Khan Date: Mon, 27 Jan 2025 13:07:11 -0700 Subject: [PATCH] Backporting 3492 --- .../blacklight/facet_field_pagination_component.html.erb | 8 ++++---- .../blacklight/facet_field_pagination_component.rb | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/components/blacklight/facet_field_pagination_component.html.erb b/app/components/blacklight/facet_field_pagination_component.html.erb index 3a4897f473..a80adb09a0 100644 --- a/app/components/blacklight/facet_field_pagination_component.html.erb +++ b/app/components/blacklight/facet_field_pagination_component.html.erb @@ -10,10 +10,10 @@
<% if @facet_field.paginator.sort == 'index' -%> - <%= t('blacklight.search.facets.sort.index') %> - <%= helpers.link_to(t('blacklight.search.facets.sort.count'), sort_facet_url('count'), class: "sort_change numeric btn btn-outline-secondary", data: { blacklight_modal: "preserve" }) %> + <%= t('blacklight.search.facets.sort.index') %> + <%= helpers.link_to(t('blacklight.search.facets.sort.count'), sort_facet_url('count'), class: "sort_change numeric #{@button_classes}", data: { blacklight_modal: "preserve" }) %> <% elsif @facet_field.paginator.sort == 'count' -%> - <%= helpers.link_to(t('blacklight.search.facets.sort.index'), sort_facet_url('index'), class: "sort_change az btn btn-outline-secondary", data: { blacklight_modal: "preserve" }) %> - <%= t('blacklight.search.facets.sort.count') %> + <%= helpers.link_to(t('blacklight.search.facets.sort.index'), sort_facet_url('index'), class: "sort_change az #{@button_classes}", data: { blacklight_modal: "preserve" }) %> + <%= t('blacklight.search.facets.sort.count') %> <% end -%>
diff --git a/app/components/blacklight/facet_field_pagination_component.rb b/app/components/blacklight/facet_field_pagination_component.rb index c4e7cedd6f..f30751ff10 100644 --- a/app/components/blacklight/facet_field_pagination_component.rb +++ b/app/components/blacklight/facet_field_pagination_component.rb @@ -2,8 +2,9 @@ module Blacklight class FacetFieldPaginationComponent < Blacklight::Component - def initialize(facet_field:) + def initialize(facet_field:, button_classes: %w[btn btn-outline-secondary]) @facet_field = facet_field + @button_classes = button_classes.join(' ') end def sort_facet_url(sort)