Module: Spotlight::Catalog

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

Overview

Spotlight catalog mixins

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



15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/concerns/spotlight/catalog.rb', line 15

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

#render_save_this_search?Boolean

Returns:

  • (Boolean)


28
29
30
31
# File 'app/controllers/concerns/spotlight/catalog.rb', line 28

def render_save_this_search?
  (current_exhibit && can?(:curate, current_exhibit)) &&
    !(params[:controller] == 'spotlight/catalog' && params[:action] == 'admin')
end