Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/ratyrate/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ def rating_for(rateable_obj, dimension=nil, options={})
enable_half = options[:enable_half] || false
half_show = options[:half_show] || true
star_path = options[:star_path] || ''
star_on = options[:star_on] || image_path('star-on.png')
star_off = options[:star_off] || image_path('star-off.png')
star_half = options[:star_half] || image_path('star-half.png')
star_on = options[:star_on] || asset_path('star-on.png')
star_off = options[:star_off] || asset_path('star-off.png')
star_half = options[:star_half] || asset_path('star-half.png')
cancel = options[:cancel] || false
cancel_place = options[:cancel_place] || 'left'
cancel_hint = options[:cancel_hint] || 'Cancel current rating!'
cancel_on = options[:cancel_on] || image_path('cancel-on.png')
cancel_off = options[:cancel_off] || image_path('cancel-off.png')
cancel_on = options[:cancel_on] || asset_path('cancel-on.png')
cancel_off = options[:cancel_off] || asset_path('cancel-off.png')
noRatedMsg = options[:noRatedMsg] || 'I\'am readOnly and I haven\'t rated yet!'
# round = options[:round] || { down: .26, full: .6, up: .76 }
space = options[:space] || false
Expand All @@ -40,7 +40,7 @@ def rating_for(rateable_obj, dimension=nil, options={})
end

if options[:imdb_avg] && readOnly
content_tag :div, '', :style => "background-image:url('#{image_path('mid-star.png')}');width:61px;height:57px;margin-top:10px;" do
content_tag :div, '', :style => "background-image:url('#{asset_path('mid-star.png')}');width:61px;height:57px;margin-top:10px;" do
content_tag :p, avg, :style => "position:relative;font-size:.8rem;text-align:center;line-height:60px;"
end
else
Expand Down Expand Up @@ -76,7 +76,7 @@ def imdb_style_rating_for(rateable_obj, user, options = {})
#TODO: add option to change the star icon
overall_avg = rateable_obj.overall_avg(user)

content_tag :div, '', :style => "background-image:url('#{image_path('big-star.png')}');width:81px;height:81px;margin-top:10px;" do
content_tag :div, '', :style => "background-image:url('#{asset_path('big-star.png')}');width:81px;height:81px;margin-top:10px;" do
content_tag :p, overall_avg, :style => "position:relative;line-height:85px;text-align:center;"
end
end
Expand All @@ -91,14 +91,14 @@ def rating_for_user(rateable_obj, rating_user, dimension = nil, options = {})
enable_half = options[:enable_half] || false
half_show = options[:half_show] || true
star_path = options[:star_path] || ''
star_on = options[:star_on] || image_path('star-on.png')
star_off = options[:star_off] || image_path('star-off.png')
star_half = options[:star_half] || image_path('star-half.png')
star_on = options[:star_on] || asset_path('star-on.png')
star_off = options[:star_off] || asset_path('star-off.png')
star_half = options[:star_half] || asset_path('star-half.png')
cancel = options[:cancel] || false
cancel_place = options[:cancel_place] || 'left'
cancel_hint = options[:cancel_hint] || 'Cancel current rating!'
cancel_on = options[:cancel_on] || image_path('cancel-on.png')
cancel_off = options[:cancel_off] || image_path('cancel-off.png')
cancel_on = options[:cancel_on] || asset_path('cancel-on.png')
cancel_off = options[:cancel_off] || asset_path('cancel-off.png')
noRatedMsg = options[:noRatedMsg] || 'I\'am readOnly and I haven\'t rated yet!'
# round = options[:round] || { down: .26, full: .6, up: .76 }
space = options[:space] || false
Expand Down