Sha256: 881036ef7d1029b0bd32445cac572c58f166041cd4b6ddb71871920462854bed

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

Spree::BaseHelper.module_eval do
  def link_to_cart(text = t('cart'))
    css_class = nil
    if current_order.nil? or current_order.line_items.empty?
      text = "#{text}"
      css_class = 'empty'
    else
      text = "#{text} (#{current_order.item_count})"
      css_class = 'full'
    end
    link_to text, cart_path, :class => css_class
  end
  
  # Outputs the corresponding flash message if any are set
  def flash_messages
    %w(notice warning error).map do |msg|
      content_tag(:script,
      		"$.jGrowl(\"#{flash.delete(msg.to_sym)}\", { header: '#{t(msg, :default => msg).mb_chars.titleize}', sticky: true, theme: '#{msg}' });".html_safe
			) unless flash[msg.to_sym].blank?
    end.join("\n").html_safe
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
synergy_default_theme-1.0.2 app/helpers/base_helper_decorator.rb
synergy_default_theme-1.0.1 app/helpers/base_helper_decorator.rb