Sha256: 3f3074be789fd739f24e2c8248bb1846aac7dd00036c30f51c65e4a5e71c5ac2

Contents?: true

Size: 751 Bytes

Versions: 21

Compression:

Stored size: 751 Bytes

Contents

# frozen_string_literal: true

module Blacklight
  module SearchHistory
    extend ActiveSupport::Concern
    include Blacklight::Configurable
    include Blacklight::SearchContext

    included do
      copy_blacklight_config_from(CatalogController)
    end

    def index
      @searches = searches_from_history
    end

    # TODO: we may want to remove unsaved (those without user_id) items from
    # the database when removed from history
    def clear
      if session[:history].clear
        flash[:notice] = I18n.t('blacklight.search_history.clear.success')
      else
        flash[:error] = I18n.t('blacklight.search_history.clear.failure')
      end

      redirect_back fallback_location: blacklight.search_history_path
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

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