|
|
|
@ -1301,9 +1301,14 @@ module ApplicationHelper
|
|
|
|
|
#added by nie
|
|
|
|
|
# Display watcher picture
|
|
|
|
|
def show_watcher_profile(obj)
|
|
|
|
|
count = 0
|
|
|
|
|
html = ''
|
|
|
|
|
for user in User.watched_by(obj.id)
|
|
|
|
|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}")
|
|
|
|
|
count = count + 1
|
|
|
|
|
if count >= 12
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
html.html_safe
|
|
|
|
|
end
|
|
|
|
@ -1311,8 +1316,13 @@ module ApplicationHelper
|
|
|
|
|
#display fans picture
|
|
|
|
|
def show_fans_picture(obj)
|
|
|
|
|
html = ''
|
|
|
|
|
count = 0
|
|
|
|
|
for user in obj.watcher_users
|
|
|
|
|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}")
|
|
|
|
|
count = count + 1
|
|
|
|
|
if count >= 12
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
html.html_safe
|
|
|
|
|
end
|
|
|
|
@ -1320,8 +1330,13 @@ module ApplicationHelper
|
|
|
|
|
# add by huang
|
|
|
|
|
def show_watcher_list(user)
|
|
|
|
|
html = ''
|
|
|
|
|
count = 0
|
|
|
|
|
for user in User.watched_by(user.id)
|
|
|
|
|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.name}")
|
|
|
|
|
count = count + 1
|
|
|
|
|
if count >= 12
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
html.html_safe
|
|
|
|
|
end
|
|
|
|
|