Class: Spotlight::HomePagesController

Inherits:
PagesController show all
Includes:
Blacklight::SearchHelper, Catalog
Defined in:
app/controllers/spotlight/home_pages_controller.rb

Overview

CRUD actions for the exhibit home page

Instance Method Summary collapse

Methods included from Catalog

#add_facet_visibility_field, #render_save_this_search?

Methods included from Base

#autocomplete_json_response, #autocomplete_json_response_for_document, #blacklight_config

Methods included from Config

#exhibit_specific_blacklight_config

Methods inherited from PagesController

#create, #destroy, #new, #preview, #update, #update_all

Methods included from Concerns::ApplicationController

#enabled_in_spotlight_view_type_configuration?, #field_enabled?

Methods included from Controller

#blacklight_config, #current_exhibit, #current_masthead, #current_masthead=, #current_site, #exhibit_masthead?, #exhibit_search_action_url, #exhibit_search_facet_url, #redirect_back, #resource_masthead?

Instance Method Details

#editObject



12
13
14
15
16
# File 'app/controllers/spotlight/home_pages_controller.rb', line 12

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

#indexObject



18
19
20
# File 'app/controllers/spotlight/home_pages_controller.rb', line 18

def index
  redirect_to exhibit_feature_pages_path(@exhibit)
end

#showObject



22
23
24
25
26
27
28
29
30
# File 'app/controllers/spotlight/home_pages_controller.rb', line 22

def show
  @response, @document_list = search_results({}) if @page.display_sidebar?

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