Sha256: e1d9d6b7dfb8e2710f3584aa6eda306d03e4f1c4ccb31598379d370eb243a203

Contents?: true

Size: 702 Bytes

Versions: 21

Compression:

Stored size: 702 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  class StartOverButtonComponent < Blacklight::Component
    def call
      link_to t('blacklight.search.start_over'), start_over_path, class: 'catalog_startOverLink btn btn-primary'
    end

    private

    ##
    # Get the path to the search action with any parameters (e.g. view type)
    # that should be persisted across search sessions.
    def start_over_path query_params = params
      h = {}
      current_index_view_type = helpers.document_index_view_type(query_params)
      h[:view] = current_index_view_type unless current_index_view_type == helpers.default_document_index_view_type

      helpers.search_action_path(h)
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
blacklight-8.6.1 app/components/blacklight/start_over_button_component.rb
blacklight-8.6.0 app/components/blacklight/start_over_button_component.rb
blacklight-8.5.1 app/components/blacklight/start_over_button_component.rb
blacklight-8.5.0 app/components/blacklight/start_over_button_component.rb
blacklight-8.4.0 app/components/blacklight/start_over_button_component.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/app/components/blacklight/start_over_button_component.rb
blacklight-8.3.0 app/components/blacklight/start_over_button_component.rb
blacklight-8.2.2 app/components/blacklight/start_over_button_component.rb
blacklight-8.2.1 app/components/blacklight/start_over_button_component.rb
blacklight-8.2.0 app/components/blacklight/start_over_button_component.rb
blacklight-8.1.0 app/components/blacklight/start_over_button_component.rb
blacklight-8.0.1 app/components/blacklight/start_over_button_component.rb
blacklight-8.0.0 app/components/blacklight/start_over_button_component.rb
blacklight-8.0.0.beta8 app/components/blacklight/start_over_button_component.rb
blacklight-8.0.0.beta7 app/components/blacklight/start_over_button_component.rb
blacklight-8.0.0.beta6 app/components/blacklight/start_over_button_component.rb
blacklight-8.0.0.beta5 app/components/blacklight/start_over_button_component.rb
blacklight-8.0.0.beta4 app/components/blacklight/start_over_button_component.rb
blacklight-8.0.0.beta3 app/components/blacklight/start_over_button_component.rb
blacklight-8.0.0.beta2 app/components/blacklight/start_over_button_component.rb