1
0
Fork 0
forked from OpenNeo/impress
impress/app/helpers/closet_hangers_helper.rb

27 lines
607 B
Ruby
Raw Normal View History

2011-07-20 12:16:22 -07:00
require 'cgi'
2011-07-12 17:03:04 -07:00
module ClosetHangersHelper
2011-07-22 14:55:05 -07:00
def closet_hanger_verb(owned)
ClosetHanger.verb(closet_hanger_subject, owned)
end
2011-07-20 12:16:22 -07:00
def send_neomail_url(user)
"http://www.neopets.com/neomessages.phtml?type=send&recipient=#{CGI.escape @user.neopets_username}"
end
2011-07-22 14:55:05 -07:00
def closet_hanger_subject
public_perspective? ? @user.name : :you
end
def public_perspective?
@public_perspective
end
2011-07-22 14:55:05 -07:00
def render_closet_hangers(owned)
render :partial => 'closet_hanger',
:collection => @closet_hangers_by_owned[owned],
:locals => {:show_controls => !public_perspective?}
end
2011-07-12 17:03:04 -07:00
end