/wiki_pages: get navbar post count from tags table.

Post.fast_count is dependent on the current user's settings. This meant
that tag counts in wiki pages could be different from the tag counts
displayed in tag lists.
This commit is contained in:
evazion
2017-11-29 13:12:53 -06:00
parent 649969156e
commit 2000719227

View File

@@ -12,7 +12,7 @@
<% if @wiki_page && !@wiki_page.new_record? %>
<li>|</li>
<li><%= link_to "Posts (#{Post.fast_count(@wiki_page.title)})", posts_path(:tags => @wiki_page.title) %></li>
<li><%= link_to "Posts (#{@wiki_page.tag.try(:post_count) || 0})", posts_path(:tags => @wiki_page.title) %></li>
<li><%= link_to "History", wiki_page_versions_path(:search => {:wiki_page_id => @wiki_page.id}) %></li>
<% if CurrentUser.is_member? %>
<li id="wiki-page-edit"><%= link_to "Edit", edit_wiki_page_path(@wiki_page) %></li>