Skip to content

Commit

Permalink
enabling specific styling for buttons (#3492)
Browse files Browse the repository at this point in the history
  • Loading branch information
hudajkhan authored Jan 14, 2025
1 parent 99ec18a commit 67ad400
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

<div class="sort-options btn-group">
<% if @facet_field.paginator.sort == 'index' -%>
<span class="active az btn btn-outline-secondary"><%= t('blacklight.search.facets.sort.index') %></span>
<%= 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" }) %>
<span class="active az <%= @button_classes %>"><%= t('blacklight.search.facets.sort.index') %></span>
<%= 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" }) %>
<span class="active numeric btn btn-outline-secondary"><%= t('blacklight.search.facets.sort.count') %></span>
<%= helpers.link_to(t('blacklight.search.facets.sort.index'), sort_facet_url('index'), class: "sort_change az #{@button_classes}", data: { blacklight_modal: "preserve" }) %>
<span class="active numeric <%= @button_classes %>"><%= t('blacklight.search.facets.sort.count') %></span>
<% end -%>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 67ad400

Please sign in to comment.