Sha256: efa260250edf161e996c7d690df42486ec886108f98c94e723c52cf16ae1ab24

Contents?: true

Size: 867 Bytes

Versions: 2

Compression:

Stored size: 867 Bytes

Contents

module Spotlight::MainAppHelpers
  def cache_key_for_spotlight_exhibits
    Spotlight::Exhibit.maximum(:updated_at).try(:utc).try(:to_s, :number)
  end

  def on_browse_page?
    params[:controller] == 'spotlight/browse'
  end

  def on_about_page?
    params[:controller] == 'spotlight/about_pages'
  end
  
  def show_contact_form?
    current_exhibit && current_exhibit.contact_emails.confirmed.any?
  end
  
  def enabled_in_spotlight_view_type_configuration? config
    return true unless current_exhibit

    return true if controller.is_a? Spotlight::PagesController

    return current_exhibit.blacklight_configuration.document_index_view_types.include? config.key.to_s
  end
  
  def field_enabled? field, *args
    field.enabled && field.send((:show if controller.is_a? Blacklight::Catalog and action_name == "show") || document_index_view_type)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-spotlight-0.2.0 app/helpers/spotlight/main_app_helpers.rb
blacklight-spotlight-0.1.0 app/helpers/spotlight/main_app_helpers.rb