Sha256: ff4813156ba5cdcdac603cbb0a817afee3f80cb0ea33462c5dc30f1e21ac91b0

Contents?: true

Size: 978 Bytes

Versions: 1

Compression:

Stored size: 978 Bytes

Contents

module Spotlight
  class HomePagesController < Spotlight::PagesController
    include Blacklight::SolrHelper
    include Spotlight::Catalog

    load_and_authorize_resource through: :exhibit, singleton: true, instance_name: 'page'

    before_filter :attach_breadcrumbs, except: :show

    def edit
      add_breadcrumb t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit)
      add_breadcrumb @page.title, [:edit, @exhibit, @page]
      super
    end

    def index
      redirect_to exhibit_feature_pages_path(@exhibit)
    end

    def show
      (@response, @document_list) = get_search_results

      if @page.nil? or !@page.published?
        render '/catalog/index'
      else
        render 'show'
      end
    end

    private
    alias_method :search_action_url, :exhibit_search_action_url
    alias_method :search_facet_url, :exhibit_search_facet_url

    def allowed_page_params
      super.concat [:display_title]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-spotlight-0.2.0 app/controllers/spotlight/home_pages_controller.rb