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.
35 lines
1.8 KiB
Plaintext
35 lines
1.8 KiB
Plaintext
<% content_for(:secondary_links) do %>
|
|
<menu>
|
|
<li><%= render "wiki_pages/quick_search" %></li>
|
|
<li><%= link_to "Listing", wiki_pages_path %></li>
|
|
<li><%= link_to "Search", search_wiki_pages_path %></li>
|
|
|
|
<% if CurrentUser.is_member? %>
|
|
<li><%= link_to "New", new_wiki_page_path %></li>
|
|
<% end %>
|
|
|
|
<li><%= link_to "Help", wiki_pages_path(:search => {:title => "help:wiki"}) %></li>
|
|
|
|
<% 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>
|
|
<% if CurrentUser.is_member? %>
|
|
<li id="wiki-page-edit"><%= link_to "Edit", edit_wiki_page_path(@wiki_page) %></li>
|
|
<% end %>
|
|
<% if CurrentUser.is_builder? && !@wiki_page.is_deleted? %>
|
|
<li id="wiki-page-delete"><%= link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :data => {:confirm => "Are you sure you want to delete this wiki page?"} %></li>
|
|
<% end %>
|
|
<% elsif @wiki_page_version %>
|
|
<li>|</li>
|
|
<li><%= link_to "Newest", wiki_page_path(@wiki_page_version.wiki_page_id) %></li>
|
|
<% if CurrentUser.is_member? %>
|
|
<li><%= link_to "Revert to", revert_wiki_page_path(@wiki_page_version.wiki_page_id, :version_id => @wiki_page_version.id), :method => :put, :data => {:confirm => "Are you sure you want to revert to this version?"} %></li>
|
|
<% end %>
|
|
<% end %>
|
|
</menu>
|
|
<% end %>
|