Sha256: 5e1de8f7ee5a6be17f268843b5960cfe4ad7fc90f38b875b4ea673c3d3a1573a

Contents?: true

Size: 484 Bytes

Versions: 21

Compression:

Stored size: 484 Bytes

Contents

class ComfortableMexicanSofa::Tag::Template
  include ComfortableMexicanSofa::Tag

  def self.regex_tag_signature(identifier = nil)
    identifier ||= /[\w\/\-]+/
    /\{\{\s*cms:template:(#{identifier})\s*\}\}/
  end

  def content
    "<%= render :template => '#{identifier}' %>"
  end

  def render
    whitelist = ComfortableMexicanSofa.config.allowed_templates
    if whitelist.is_a?(Array)
      content if whitelist.member?(identifier)
    else
      content
    end
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.12.11 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.10 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.9 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.8 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.7 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.6 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.5 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.4 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.3 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.2 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.1 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.12.0 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.11.2 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.11.1 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.11.0 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.10.3 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.10.2 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.10.1 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.10.0 lib/comfortable_mexican_sofa/tags/template.rb
comfortable_mexican_sofa-1.9.3 lib/comfortable_mexican_sofa/tags/template.rb