Skip to content

Commit 8e92299

Browse files
committed
WIP components for width collapsible search bar group for result navigation
1 parent 74fd73b commit 8e92299

4 files changed

+24
-2
lines changed

app/components/dcv/search_bar/catalog_component.html.erb

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
<%= render_hash_as_hidden_fields(@params.except(:q, :search_field, :qt, :page, :utf8, :format)) %>
33

44
<div class="input-group flex-sm-row flex-md-fill">
5+
<%= render Dcv::SearchContext::CollapsiblePaginationComponent.new(search_context: helpers.instance_variable_get(:@search_context), search_session: helpers.instance_variable_get(:@search_session)) %>
56
<% unless search_fields.empty? %>
6-
<span class="input-group-prepend">
7+
<span class="input-group-append">
78
<%= hidden_field_tag(:search_field, h(params[:search_field] || search_fields.first[1]), :title => t('blacklight.search.form.search_field.title')) %>
89
</span>
910
<% end %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div class="input-group-prepend">
2+
<button class="btn btn-info" type="button" data-toggle="collapse" data-target="#collapsePrevNext" aria-expanded="true" aria-controls="collapsePrevNext" aria-pressed="true"><i class="previous fa fa-exchange-alt" title="Navigate search results" data-toggle="tooltip" data-original-title="Navigate search results"></i></button>
3+
</div>
4+
<div class="collapse show width input-group-prepend" id="collapsePrevNext">
5+
<% if params[:return_to_filesystem].present? %>
6+
<%= link_to('<i class="fa fa-reply-all"></i>'.html_safe, params[:return_to_filesystem], class: 'btn btn-outline-secondary', :"data-toggle" => 'tooltip', "aria-label": t('views.pagination.return_to_filesystem'), title: t('views.pagination.return_to_filesystem')) %>
7+
<% else %>
8+
<%= helpers.link_back_to_catalog(label: '<i class="fa fa-reply-all"></i> '.html_safe, class: 'btn btn-outline-secondary', :"data-toggle" => 'tooltip', "aria-label": t('views.pagination.return_to_search'), title: t('views.pagination.return_to_search') ) %>
9+
<% if @search_context[:prev] || @search_context[:next] %>
10+
<span class="btn btn-outline-secondary" style="pointer-events:none;"><%= item_page_entry_info %></span>
11+
<%= link_to_previous_document @search_context[:prev], "btn btn-outline-secondary btn-sm" %>
12+
<%= link_to_next_document @search_context[:next], "btn btn-outline-secondary btn-sm" %>
13+
<% end %>
14+
<% end %>
15+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
module Dcv::SearchContext
4+
class CollapsiblePaginationComponent < PaginationComponent
5+
end
6+
end

app/components/dcv/search_context_component.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def initialize(document:, **opts)
77
@document = document
88
end
99
def render?
10-
@document['dc_type_ssm']&.first != 'FileSystem'
10+
false #@document['dc_type_ssm']&.first != 'FileSystem'
1111
end
1212
end
1313
end

0 commit comments

Comments
 (0)