Sha256: b6484f3d9594f37a921c2278700859ec24ac489bb7eaa637ff857acebc998837

Contents?: true

Size: 1.01 KB

Versions: 18

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module Blacklight
  class SearchContextComponent < Blacklight::Component
    with_collection_parameter :search_context

    def initialize(search_context:, search_session:)
      @search_context = search_context
      @search_session = search_session
    end

    def render?
      @search_context.present? && (@search_context[:prev] || @search_context[:next])
    end

    def item_page_entry_info
      Deprecation.silence(Blacklight::CatalogHelperBehavior) do
        helpers.item_page_entry_info
      end
    end

    def link_to_previous_document(document = nil, *args, **kwargs)
      Deprecation.silence(Blacklight::UrlHelperBehavior) do
        helpers.link_to_previous_document(document || @search_context[:prev], *args, **kwargs)
      end
    end

    def link_to_next_document(document = nil, *args, **kwargs)
      Deprecation.silence(Blacklight::UrlHelperBehavior) do
        helpers.link_to_next_document(document || @search_context[:next], *args, **kwargs)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
blacklight-7.40.0 app/components/blacklight/search_context_component.rb
blacklight-7.39.0 app/components/blacklight/search_context_component.rb
blacklight-7.38.0 app/components/blacklight/search_context_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/app/components/blacklight/search_context_component.rb
blacklight-7.37.0 app/components/blacklight/search_context_component.rb
blacklight-7.36.2 app/components/blacklight/search_context_component.rb
blacklight-7.36.1 app/components/blacklight/search_context_component.rb
blacklight-7.36.0 app/components/blacklight/search_context_component.rb
blacklight-7.35.0 app/components/blacklight/search_context_component.rb
blacklight-7.34.0 app/components/blacklight/search_context_component.rb
blacklight-7.33.1 app/components/blacklight/search_context_component.rb
blacklight-7.33.0 app/components/blacklight/search_context_component.rb
blacklight-7.32.0 app/components/blacklight/search_context_component.rb
blacklight-7.31.0 app/components/blacklight/search_context_component.rb
blacklight-7.30.0 app/components/blacklight/search_context_component.rb
blacklight-7.29.0 app/components/blacklight/search_context_component.rb
blacklight-7.28.0 app/components/blacklight/search_context_component.rb
blacklight-7.27.1 app/components/blacklight/search_context_component.rb