Module: Spotlight::ExhibitThemeHelper

Included in:
ApplicationHelper, MainAppHelpers
Defined in:
app/helpers/spotlight/exhibit_theme_helper.rb

Overview

Exhibit theme/stylesheet helper

Instance Method Summary collapse

Instance Method Details

#current_exhibit_themeObject



16
17
18
# File 'app/helpers/spotlight/exhibit_theme_helper.rb', line 16

def current_exhibit_theme
  current_exhibit.theme if current_exhibit && current_exhibit.theme.present? && current_exhibit.themes.include?(current_exhibit.theme)
end


7
8
9
10
11
12
13
14
# File 'app/helpers/spotlight/exhibit_theme_helper.rb', line 7

def exhibit_stylesheet_link_tag(tag)
  if current_exhibit_theme && current_exhibit&.theme != 'default'
    stylesheet_link_tag "#{tag}_#{current_exhibit_theme}"
  else
    Rails.logger.debug { "Exhibit theme '#{current_exhibit_theme}' not in the list of available themes: #{current_exhibit&.themes}" }
    stylesheet_link_tag(tag)
  end
end