Sha256: 121f8978cdb50b15ffa34f48ae22783ec80a25d0327f1d840a5fbccddf9668f0

Contents?: true

Size: 962 Bytes

Versions: 3

Compression:

Stored size: 962 Bytes

Contents

# encoding: utf-8

module Gluttonberg
  module Public
    module CmsStylesheets
      # It generates css links for all published CMS based css
      def cms_managed_stylesheets_link_tag
        if Rails.configuration.cms_based_public_css == true
          html = ""
          Gluttonberg::Stylesheet.all.each do |stylesheet|
            html << _stylesheet_tag_for(stylesheet)
          end
          html << "\n"
          html.html_safe
        end
      end

      private
        def _stylesheet_tag_for(stylesheet)
          html = ""
          unless stylesheet.css_prefix.blank?
            html << stylesheet.css_prefix
            html << "\n"
          end
          html << stylesheet_link_tag( stylesheets_path(stylesheet.slug) +".css?#{stylesheet.version}" )
          unless stylesheet.css_postfix.blank?
            html << "\n"
            html << stylesheet.css_postfix
          end
          html
        end

    end #CmsStylesheets
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gluttonberg-core-3.0.2 app/helpers/gluttonberg/public/cms_stylesheets.rb
gluttonberg-core-3.0.1 app/helpers/gluttonberg/public/cms_stylesheets.rb
gluttonberg-core-3.0.0 app/helpers/gluttonberg/public/cms_stylesheets.rb