From 4114a18925d3bb36def9fda2630b15c518babd47 Mon Sep 17 00:00:00 2001 From: Toks Date: Sat, 20 Apr 2013 18:12:41 -0400 Subject: [PATCH] fixes #458 --- app/presenters/user_presenter.rb | 8 ++++++++ app/views/users/_statistics.html.erb | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb index 7eab088a3..78b18d14a 100644 --- a/app/presenters/user_presenter.rb +++ b/app/presenters/user_presenter.rb @@ -83,6 +83,10 @@ class UserPresenter template.link_to(Comment.for_creator(user.id).count, template.comments_path(:search => {:creator_id => user.id}, :group_by => "comment")) end + def commented_posts_count(template) + template.link_to(Post.fast_count("commenter:#{user.name}"), template.posts_path(:tags => "commenter:#{user.name}")) + end + def post_version_count(template) template.link_to(user.post_update_count, template.post_versions_path(:search => {:updater_id => user.id})) end @@ -91,6 +95,10 @@ class UserPresenter template.link_to(user.note_update_count, template.note_versions_path(:search => {:updater_id => user.id})) end + def noted_posts_count(template) + template.link_to(Post.fast_count("noter:#{user.name}"), template.posts_path(:tags => "noter:#{user.name}")) + end + def wiki_page_version_count(template) template.link_to(WikiPageVersion.for_user(user.id).count, template.wiki_page_versions_path(:search => {:updater_id => user.id})) end diff --git a/app/views/users/_statistics.html.erb b/app/views/users/_statistics.html.erb index a6106a76f..551365443 100644 --- a/app/views/users/_statistics.html.erb +++ b/app/views/users/_statistics.html.erb @@ -51,7 +51,11 @@ Note Changes - <%= presenter.note_version_count(self) %> + <%= presenter.note_version_count(self) %> + <% if CurrentUser.user.id == user.id %> + in <%= presenter.noted_posts_count(self) %> posts + <% end %> + @@ -81,7 +85,11 @@ Comments - <%= presenter.comment_count(self) %> + <%= presenter.comment_count(self) %> + <% if CurrentUser.user.id == user.id %> + in <%= presenter.commented_posts_count(self) %> posts + <% end %> +