Sha256: a67f67e17a38a28338e64172823183e530b870dded84e6d87af0ab4fb0168aae
Contents?: true
Size: 1018 Bytes
Versions: 25
Compression:
Stored size: 1018 Bytes
Contents
module Spotlight ## # Helpers that are injected into the main application (because they used in layouts) module MainAppHelpers include Spotlight::NavbarHelper def cache_key_for_spotlight_exhibits "#{Spotlight::Exhibit.count}/#{Spotlight::Exhibit.maximum(:updated_at).try(:utc)}" 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 && (Spotlight::Engine.config.default_contact_email || current_exhibit.contact_emails.confirmed.any?) end def link_back_to_catalog(opts = { label: nil }) if (current_search_session.try(:query_params) || {}).fetch(:controller, '').starts_with? 'spotlight' opts[:route_set] ||= spotlight end super end def presenter(document) case action_name when 'index' super else show_presenter(document) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems