Sha256: 9621ce33548dede7d04578525b98ae60910d2ee036767dda721cc71f05063408

Contents?: true

Size: 368 Bytes

Versions: 3

Compression:

Stored size: 368 Bytes

Contents

module Spree::ReviewsHelper

  def star(the_class)
    content_tag(:span, " ✮ ".html_safe, :class => the_class)
  end

  def mk_stars(m)
    (1..5).collect {|n| n <= m ? star("lit") : star("unlit") }.join
  end

  def txt_stars(n, show_out_of = true)
    res = Spree.t('star', :count => n)
    res += " #{Spree.t('out_of_5')}" if show_out_of
    res
  end

end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
solidus_reviews-1.0.0 app/helpers/spree/reviews_helper.rb
jiffyshirts_spree_reviews-2.3.1.2 app/helpers/spree/reviews_helper.rb
jiffyshirts_spree_reviews-2.3.1.1 app/helpers/spree/reviews_helper.rb