Module: Spotlight::Catalog

Extended by:
ActiveSupport::Concern
Includes:
Blacklight::Catalog, Base, AccessControlsEnforcement
Included in:
CatalogController, HomePagesController
Defined in:
app/controllers/concerns/spotlight/catalog.rb,
app/controllers/concerns/spotlight/catalog/access_controls_enforcement.rb

Overview

Spotlight catalog mixins

Defined Under Namespace

Modules: AccessControlsEnforcement

Instance Method Summary collapse

Methods included from Base

#autocomplete_json_response, #autocomplete_json_response_for_document, #blacklight_config

Methods included from Config

#exhibit_specific_blacklight_config

Instance Method Details

#add_facet_visibility_fieldObject

Adds a facet to display document visibility for the current exhibit if the user is a curator



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/concerns/spotlight/catalog.rb', line 19

def add_facet_visibility_field
  return unless current_exhibit && can?(:curate, current_exhibit)
  blacklight_config.add_facet_field 'exhibit_visibility',
                                    label: I18n.t(:'spotlight.catalog.facets.exhibit_visibility.label'),
                                    query: {
                                      private: {
                                        label: I18n.t(:'spotlight.catalog.facets.exhibit_visibility.private'),
                                        fq: "#{blacklight_config.document_model.visibility_field(current_exhibit)}:false" }
                                    }
end