app/helpers/spotlight/application_helper.rb in blacklight-spotlight-0.32.0 vs app/helpers/spotlight/application_helper.rb in blacklight-spotlight-0.33.0
- old
+ new
@@ -2,12 +2,12 @@
##
# General spotlight application helpers
module ApplicationHelper
include CrudLinkHelpers
include TitleHelper
- include JcropHelper
include MetaHelper
+ include CropHelper
##
# Give the application name a chance to include the exhibit title
def application_name
name = site_title
@@ -128,9 +128,22 @@
config.label || blacklight_config.index_fields[solr_field].try(:label) || t(".#{solr_field}")
end
def available_view_fields
current_exhibit.blacklight_configuration.default_blacklight_config.view.to_h.reject { |_k, v| v.if == false }
+ end
+
+ def exhibit_stylesheet_link_tag(tag)
+ if current_exhibit_theme && current_exhibit.theme != 'default'
+ stylesheet_link_tag "#{tag}_#{current_exhibit_theme}"
+ else
+ Rails.logger.warn "Exhibit theme '#{current_exhibit_theme}' not in white-list of available themes: #{Spotlight::Engine.config.exhibit_themes}"
+ stylesheet_link_tag(tag)
+ end
+ end
+
+ def current_exhibit_theme
+ current_exhibit.theme if current_exhibit && current_exhibit.theme.present? && Spotlight::Engine.config.exhibit_themes.include?(current_exhibit.theme)
end
private
def main_app_url_helper?(method)