diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index fedefeb71..891842ea9 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 46f549a3d..3f04f57d0 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 @@
- <% 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) %>
|
@@ -103,9 +93,7 @@
- <% 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) %>
|
@@ -133,16 +121,12 @@
<%= render_flash_messages %>
- <%=render :partial => 'layouts/base_footer'%>
-
-
-
+ <%=render :partial => 'layouts/base_footer'%>
+
<%= l(:label_loading) %>
-
-
-
+