Class: Spotlight::CatalogController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Spotlight::CatalogController
- Includes:
- Blacklight::Catalog, Catalog
- Defined in:
- app/controllers/spotlight/catalog_controller.rb
Instance Method Summary collapse
- #admin ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #make_private ⇒ Object
- #make_public ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods included from Catalog
Methods inherited from ApplicationController
Instance Method Details
#admin ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/controllers/spotlight/catalog_controller.rb', line 35 def admin self.blacklight_config.view.reject! { |k,v| true } self.blacklight_config.view.admin_table.partials = [:index_compact] t(:'spotlight.curation.sidebar.header'), exhibit_dashboard_path(@exhibit) t(:'spotlight.curation.sidebar.items'), admin_exhibit_catalog_index_path(@exhibit) (@response, @document_list) = get_search_results @filters = params[:f] || [] respond_to do |format| format.html end end |
#edit ⇒ Object
62 63 64 65 66 67 |
# File 'app/controllers/spotlight/catalog_controller.rb', line 62 def edit @document = ::SolrDocument.find(params[:id]) blacklight_config.view.edit.partials = blacklight_config.view_config(:show).partials.dup blacklight_config.view.edit.partials.delete "spotlight/catalog/tags" blacklight_config.view.edit.partials.insert(2, :edit) end |
#index ⇒ Object
12 13 14 15 16 |
# File 'app/controllers/spotlight/catalog_controller.rb', line 12 def index super t(:'spotlight.catalog.breadcrumb.index'), request.fullpath if has_search_parameters? end |
#make_private ⇒ Object
69 70 71 72 73 74 75 76 77 78 |
# File 'app/controllers/spotlight/catalog_controller.rb', line 69 def make_private @document = ::SolrDocument.find params[:catalog_id] @document.make_private!(current_exhibit) @document.save respond_to do |format| format.html { redirect_to :back } format.json { render json: true } end end |
#make_public ⇒ Object
80 81 82 83 84 85 86 87 88 89 |
# File 'app/controllers/spotlight/catalog_controller.rb', line 80 def make_public @document = ::SolrDocument.find params[:catalog_id] @document.make_public!(current_exhibit) @document.save respond_to do |format| format.html { redirect_to :back } format.json { render json: true } end end |
#show ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/spotlight/catalog_controller.rb', line 18 def show super if @document.private? current_exhibit authenticate_user! :curate, current_exhibit end if current_browse_category t(:'spotlight.browse.nav_link'), exhibit_browse_index_path(current_browse_category.exhibit) current_browse_category.title, exhibit_browse_path(current_browse_category.exhibit, current_browse_category) else t(:'spotlight.catalog.breadcrumb.index'), search_action_url(current_search_session[:query_params]) if current_search_session end Array(@document[blacklight_config.view_config(:show).title_field]).join(', '), exhibit_catalog_path(@exhibit, @document) end |
#update ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'app/controllers/spotlight/catalog_controller.rb', line 49 def update if params[:solr_document] @document = ::SolrDocument.find params[:id] authenticate_user! :curate, current_exhibit @document.update(current_exhibit, solr_document_params) @document.save redirect_to exhibit_catalog_path(current_exhibit, @document) else super end end |