Fix #3484: /posts: don't show wiki tab for metatags.

This commit is contained in:
evazion
2017-12-31 12:25:17 -06:00
parent c3aff42458
commit f9ffa2b47a
2 changed files with 10 additions and 2 deletions

View File

@@ -29,6 +29,10 @@ module PostSets
is_single_tag? && ::WikiPage.titled(tag_string).exists? && wiki_page.visible?
end
def has_blank_wiki?
is_simple_tag? && !has_wiki?
end
def wiki_page
if is_single_tag?
::WikiPage.titled(tag_string).first
@@ -158,6 +162,10 @@ module PostSets
tag_array.size == 1
end
def is_simple_tag?
Tag.is_simple_tag?(tag_string)
end
def is_empty_tag?
tag_array.size == 0
end

View File

@@ -29,8 +29,8 @@
<li><%= link_to "Pool", pool_path(@post_set.pool), :id => "show-excerpt-link" %></li>
<% elsif @post_set.has_favgroup? %>
<li><%= link_to "Favorite Group", favorite_group_path(@post_set.favgroup), :id => "show-excerpt-link" %></li>
<% elsif @post_set.is_single_tag? && !@post_set.is_metatag_search? %>
<li><%= link_to "Wiki", "#", :id => "show-excerpt-link" %></li>
<% elsif @post_set.has_blank_wiki? %>
<li><%= link_to "Wiki", new_wiki_page_path(wiki_page: { title: @post_set.tag_string }), id: "show-excerpt-link" %></li>
<% end %>
<li id="searchbox-redirect-link"><a href="#search-box">Search&raquo;</a></li>