/wiki_pages/show_or_new: show post count in navbar if tag exists (#3410).
649969156 hid the post count in the navbar on /wiki_pages/new, but that
also hid the count for /wiki_pages/show_or_new?title=medium_hair, which
was wrong. Show the count when the tag exists.
This commit is contained in:
@@ -10,7 +10,10 @@
|
||||
|
||||
<li><%= link_to "Help", wiki_pages_path(:search => {:title => "help:wiki"}) %></li>
|
||||
|
||||
<% if @wiki_page && !@wiki_page.new_record? %>
|
||||
<% if @wiki_page && @wiki_page.new_record? && @wiki_page.try(:tag).present? %>
|
||||
<li>|</li>
|
||||
<li><%= link_to "Posts (#{@wiki_page.tag.post_count})", posts_path(:tags => @wiki_page.title) %></li>
|
||||
<% elsif @wiki_page && !@wiki_page.new_record? %>
|
||||
<li>|</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>
|
||||
|
||||
Reference in New Issue
Block a user