Sha256: 6205a2101e9281cf698197a4f5baea8a800e479c801ce637dd5c8376d25046db

Contents?: true

Size: 775 Bytes

Versions: 3

Compression:

Stored size: 775 Bytes

Contents

module Admin::SpreeEssentialsHelper
  
  def contents_tab
    routes = SpreeEssentials.essentials.map do |key, cls|
      route = cls.tab[:route] || "admin_#{key}"
      send("#{route}_path") rescue "##{key}"
    end
    routes.push admin_uploads_path
    cls = request.path.scan(Regexp.new(routes.join("|"))).empty? ? nil : 'selected'
    content_tag :li, :class => cls do
      link_to I18n.t('admin.shared.contents_tab.content'), routes.first
    end
  end
  
  def markdown_helper
    content_tag('em', :class => 'small') do
      [ 
       " ",
        t('essentials.parsed_with'),
        link_to("Markdown", "http://daringfireball.net/projects/markdown/basics", :onclick => 'window.open(this.href); return false')
      ].join(" ").html_safe
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_essentials-0.3.3 app/helpers/admin/spree_essentials_helper.rb
spree_essentials-0.3.2 app/helpers/admin/spree_essentials_helper.rb
spree_essentials-0.3.1 app/helpers/admin/spree_essentials_helper.rb