Sha256: 84ef1eaab8e5e08412d3a2bd3ebd4953d2a331cb38f7b9072f287213e8dfc963
Contents?: true
Size: 1.89 KB
Versions: 1
Compression:
Stored size: 1.89 KB
Contents
module Spotlight ## # Index and read actions for browse (see {Spotlight::SearchesController} # for the curator's create-update-delete actions) class BrowseController < Spotlight::ApplicationController load_and_authorize_resource :exhibit, class: 'Spotlight::Exhibit' include Spotlight::Base load_and_authorize_resource :search, except: :index, through: :exhibit, parent: false before_action :attach_breadcrumbs record_search_parameters only: :show helper_method :should_render_spotlight_search_bar? def index @searches = @exhibit.searches.published end def show blacklight_config.index.document_actions = blacklight_config.browse.document_actions add_breadcrumb @search.title, exhibit_browse_path(@exhibit, @search) (@response, @document_list) = search_results(search_query) end protected def search_query @search.merge_params_for_search(params, blacklight_config) end ## # Browsing an exhibit should start a new search session def start_new_search_session? params[:action] == 'show' end # WARNING: Blacklight::Catalog::SearchContext sets @searches in history_session in a before_filter # See https://github.com/projectblacklight/blacklight/pull/780 def history_session # nop end def attach_breadcrumbs add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit add_breadcrumb(@exhibit.main_navigations.browse.label_or_default, exhibit_browse_index_path(@exhibit)) end def _prefixes @_prefixes ||= super + ['catalog'] end def current_masthead if resource_masthead? @search.masthead else super end end def resource_masthead? @search && @search.masthead && @search.masthead.display? end def should_render_spotlight_search_bar? !resource_masthead? end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
blacklight-spotlight-0.28.1 | app/controllers/spotlight/browse_controller.rb |