Skip to content

Commit

Permalink
argument order
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcam-src committed Dec 16, 2024
1 parent 91032ef commit 0fb3857
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- https://github.com/projectblacklight/blacklight/blob/v8.7.0/app/components/blacklight/facet_field_pagination_component.html.erb -->
<!-- [hyc-override] paginate using Kaminari gem to enable skipping pages -->
<% paginator = @facet_field.paginator %>
<% if paginator.present? %>
<% items = paginator.instance_variable_get(:@all) %>
<% rows = paginator.instance_variable_get(:@limit) %>
<% paginated_items = convert_facet_to_paginated_array(paginator, rows: rows) %>

<div class="facet-pagination" aria-label="pagination links">
<%= paginate paginated_items, theme: 'blacklight', param_name: :page %>
</div>
<% end %>

<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" }) %>
<% 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>
<% end -%>
</div>

0 comments on commit 0fb3857

Please sign in to comment.