Sha256: 515cc53a034ab2973566b929da845e213d8e2cc6d1f6145ce49a60ccc579bcfe
Contents?: true
Size: 1.28 KB
Versions: 8
Compression:
Stored size: 1.28 KB
Contents
module Spotlight ## # Exhibit dashboard controller class DashboardsController < Spotlight::ApplicationController before_action :authenticate_user! load_and_authorize_resource :exhibit, class: Spotlight::Exhibit include Spotlight::Base include Spotlight::Catalog::AccessControlsEnforcement before_action only: [:show] do blacklight_config.view.reject! { |_k, _v| true } blacklight_config.view.admin_table.partials = ['index_compact'] blacklight_config.view.admin_table.document_actions = [] end def show authorize! :curate, @exhibit @pages = @exhibit.pages.recent.limit(5) @solr_documents = load_recent_solr_documents 5 attach_dashboard_breadcrumbs end def _prefixes @_prefixes ||= super + ['spotlight/catalog', 'catalog'] end protected def attach_dashboard_breadcrumbs add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit add_breadcrumb t(:'spotlight.curation.sidebar.dashboard'), exhibit_dashboard_path(@exhibit) end def load_recent_solr_documents(count) solr_params = { sort: "#{blacklight_config.index.timestamp_field} desc" } @response, docs = search_results(solr_params, search_params_logic) docs.take(count) end end end
Version data entries
8 entries across 8 versions & 1 rubygems