Sha256: 195d8267f7b9a38865e8ee99501f2d8cdaf4245052953c07b7a2a1d9a946b707

Contents?: true

Size: 1.03 KB

Versions: 23

Compression:

Stored size: 1.03 KB

Contents

module Hydra
  module BlacklightHelperBehavior
    include Blacklight::BlacklightHelperBehavior
    
    # Given a Fedora uri, generate a reasonable partial name
    def document_partial_name(document)
      display_type = document[blacklight_config.show.display_type]

      return 'default' unless display_type 

      display_type.first.gsub(/^[^\/]+\/[^:]+:/,"").underscore
    end    

  #   COPIED from vendor/plugins/blacklight/app/helpers/application_helper.rb
    # Used in catalog/facet action, facets.rb view, for a click
    # on a facet value. Add on the facet params to existing
    # search constraints. Remove any paginator-specific request
    # params, or other request params that should be removed
    # for a 'fresh' display. 
    # Change the action to 'index' to send them back to
    # catalog/index with their new facet choice. 
    def add_facet_params_and_redirect(field, value)
      new_params = super

      # Delete :qt, if needed - added to resolve NPE errors
      new_params.delete(:qt)

      new_params
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
hydra-core-5.4.1 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.1.0 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.rc4 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.rc3 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.rc2 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.rc1 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.pre8 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-5.4.0 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.pre7 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.pre6 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.pre5 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.pre4 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.pre3 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.pre2 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-6.0.0.pre1 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-5.4.0.pre1 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-5.3.0 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-5.2.0 app/helpers/hydra/blacklight_helper_behavior.rb
hydra-core-5.1.0 app/helpers/hydra/blacklight_helper_behavior.rb