app/controllers/spotlight/home_pages_controller.rb in blacklight-spotlight-0.0.2 vs app/controllers/spotlight/home_pages_controller.rb in blacklight-spotlight-0.0.3

- old
+ new

@@ -1,21 +1,22 @@ module Spotlight class HomePagesController < Spotlight::PagesController include Blacklight::SolrHelper + skip_authorize_resource only: :show + def edit + add_breadcrumb t(:'spotlight.curation.sidebar.feature_pages'), exhibit_feature_pages_path(@exhibit) + add_breadcrumb @page.title_or_default, edit_home_page_path(@page) + super + end + def index redirect_to exhibit_feature_pages_path(@exhibit) end def show - @page = @home_page = if params[:id] - Spotlight::HomePage.find_by(id: params[:id]) - else - Spotlight::Exhibit.default.home_page - end - (@response, @document_list) = get_search_results if @page.nil? or !@page.published? render '/catalog/index' else @@ -26,29 +27,21 @@ def _prefixes @_prefixes ||= super + ['catalog'] end private + def search_action_url *args exhibit_catalog_index_url(@page.exhibit, *args) end def blacklight_config if @page @page.exhibit.blacklight_config - else - Spotlight::Exhibit.default.blacklight_config + elsif current_exhibit + current_exhibit.blacklight_config + else + super end end - - def page_model - :home_page - end - def cast_page_instance_variable - if @home_pages - @pages = @home_pages - elsif @home_page - @page = @home_page - end - end end -end \ No newline at end of file +end