Sha256: 83b7d03873c81792f3e96f638bab9769300dc0d3011da515e73f794e9749d87b

Contents?: true

Size: 704 Bytes

Versions: 20

Compression:

Stored size: 704 Bytes

Contents

class CMS::ViewTags
  attr_accessor :context, :controller
  delegate :current_user, :config, to: :context

  include Singleton
  include ApplicationHelper
  include ActionView::Helpers::TextHelper
  include ActionView::Helpers::UrlHelper
  include ActionView::Helpers::AssetTagHelper
  include ApplicationHelper
  include CMS::Helper
  include Rails.application.routes.url_helpers

  def setup opts
    @context = @controller = opts[:context]
  end

  def parse content, opts = {}
    setup(opts)
    # content.gsub(/\xA0/u, ' ')
    content.gsub(/\{\{image [^}}]+\}\}/) do |tag|
      str, name, size = tag.match(/\{\{image (\w+) (\w+)\}\}/).to_a
      cms_image(name, size)
    end.html_safe
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
honey-cms-0.5.1 lib/cms/view_tags.rb
honey-cms-0.4.8 lib/cms/view_tags.rb
honey-cms-0.4.7 lib/cms/view_tags.rb
honey-cms-0.4.6 lib/cms/view_tags.rb
honey-cms-0.4.5 lib/cms/view_tags.rb
honey-cms-0.4.2 lib/cms/view_tags.rb
honey-cms-0.4.1 lib/cms/view_tags.rb
honey-cms-0.4.0 lib/cms/view_tags.rb
honey-cms-0.3.13 lib/cms/view_tags.rb
honey-cms-0.3.12 lib/cms/view_tags.rb
honey-cms-0.3.11 lib/cms/view_tags.rb
honey-cms-0.3.10 lib/cms/view_tags.rb
honey-cms-0.3.9 lib/cms/view_tags.rb
honey-cms-0.3.8 lib/cms/view_tags.rb
honey-cms-0.3.7 lib/cms/view_tags.rb
honey-cms-0.3.5 lib/cms/view_tags.rb
honey-cms-0.3.4 lib/cms/view_tags.rb
honey-cms-0.3.3 lib/cms/view_tags.rb
honey-cms-0.3.2 lib/cms/view_tags.rb
honey-cms-0.3.1 lib/cms/view_tags.rb