-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91032ef
commit 0fb3857
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
app/components/blacklight/facet_field_pagination_component_defnc.html.erb
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,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> |