diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fedefeb7..891842ea 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1284,4 +1284,23 @@ module ApplicationHelper def link_to_content_update(text, url_params = {}, html_options = {}) link_to(text, url_params, html_options) end + +#added by nie +# Display watcher picture + def show_watcher_profile(obj) + 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") + end + html.html_safe + end + +#display fans picture + def show_fans_picture(obj) + html = '' + for user in obj.watcher_users + html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar") + end + html.html_safe + end end diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 46f549a3..3f04f57d 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -63,14 +63,6 @@
- -
@@ -81,9 +73,7 @@ @@ -103,9 +93,7 @@
- <% for user in User.watched_by(@user.id)%> - <%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar" %> - <% end%> + <%= show_watcher_profile(@user) %>
@@ -133,16 +121,12 @@ <%= render_flash_messages %> - <%=render :partial => 'layouts/base_footer'%> - - - + <%=render :partial => 'layouts/base_footer'%> + - - - +
- <% for user in @user.watcher_users %> - <%= link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar" %> - <% end%> + <%= show_fans_picture(@user) %>