Sha256: 204af6a025a5641e64f63af8e35597dec449215d50afe7c3ec53b916401a8423

Contents?: true

Size: 712 Bytes

Versions: 74

Compression:

Stored size: 712 Bytes

Contents

# frozen_string_literal: true
module Blacklight
  module SearchHistory
    extend ActiveSupport::Concern
    include Blacklight::Configurable

    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

74 entries across 74 versions & 2 rubygems

Version Path
blacklight-7.7.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.6.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.5.1 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.5.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.4.2 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.4.1 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.4.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.3.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.2.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.1.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.1.0.alpha app/controllers/concerns/blacklight/search_history.rb
blacklight-7.0.1 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.0.0 app/controllers/concerns/blacklight/search_history.rb
blacklight-7.0.0.rc2 app/controllers/concerns/blacklight/search_history.rb