<ul class="tag-list search-tag-list">
  <% tags.each do |t| %>
    <li class="tag-type-<%= t.category %>" data-tag-name="<%= t.name %>">
      <%# ignore search:foo metatags %>
      <% if t.artist? %>
        <%= link_to "?", show_or_new_artists_path(name: t.name), class: "wiki-link" %>
      <% elsif t.name =~ /\A\d+\z/ %>
        <%= link_to "?", wiki_page_path("~#{t.name}"), class: "wiki-link" %>
      <% else %>
        <%= link_to "?", wiki_page_path(t.name), class: "wiki-link" %>
      <% end %>

      <% if show_extra_links && current_query.present? %>
        <%= link_to "+", posts_path(tags: "#{current_query} #{t.name}"), class: "search-inc-tag" %>
        <%= link_to "-", posts_path(tags: "#{current_query} -#{t.name}"), class: "search-exl-tag" %>
      <% end %>

      <%= link_to t.pretty_name, posts_path(tags: t.name), class: "search-tag" %>
      <%= tag.span humanized_number(t.post_count), class: "post-count", title: t.post_count %>
    </li>
  <% end %>
</ul>
