Module: Hydra::BlacklightHelperBehavior

Includes:
Blacklight::BlacklightHelperBehavior
Included in:
BlacklightHelper
Defined in:
app/helpers/hydra/blacklight_helper_behavior.rb

Instance Method Summary collapse

Instance Method Details

#add_facet_params_and_redirect(field, value) ⇒ Object

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.



22
23
24
25
26
27
28
29
# File 'app/helpers/hydra/blacklight_helper_behavior.rb', line 22

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

#document_partial_name(document) ⇒ Object

Given a Fedora uri, generate a reasonable partial name



6
7
8
9
10
11
12
# File 'app/helpers/hydra/blacklight_helper_behavior.rb', line 6

def document_partial_name(document)
  display_type = document[blacklight_config.show.display_type]

  return 'default' unless display_type 

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