This commit is contained in:
Toks
2013-04-20 18:12:41 -04:00
parent b6af6db130
commit 4114a18925
2 changed files with 18 additions and 2 deletions

View File

@@ -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

View File

@@ -51,7 +51,11 @@
<tr>
<th>Note Changes</th>
<td><%= presenter.note_version_count(self) %></td>
<td><%= presenter.note_version_count(self) %>
<% if CurrentUser.user.id == user.id %>
in <%= presenter.noted_posts_count(self) %> posts
<% end %>
</td>
</tr>
<tr>
@@ -81,7 +85,11 @@
<tr>
<th>Comments</th>
<td><%= presenter.comment_count(self) %></td>
<td><%= presenter.comment_count(self) %>
<% if CurrentUser.user.id == user.id %>
in <%= presenter.commented_posts_count(self) %> posts
<% end %>
</td>
</tr>
<tr>