<div id="c-posts">
  <div id="a-index">
    <aside id="sidebar">
      <%= render "posts/partials/common/search", :path => posts_path, :tags => params[:tags], :tags_dom_id => "tags" %>

      <%= render "posts/partials/index/mode_menu" %>

      <%= render "posts/partials/index/blacklist" %>

      <%= raw common_searches_html(CurrentUser.user) %>

      <section id="tag-box">
        <h1>Tags</h1>
        <%= @post_set.presenter.tag_list_html(self) %>
      </section>

      <%= render "posts/partials/index/related" %>
    </aside>

    <section id="content">
      <menu id="post-sections">
        <li class="active"><a href="#" id="show-posts-link">Posts</a></li>

        <% if @post_set.has_artist? %>
          <li><%= link_to "Artist", artist_path(@post_set.artist), :id => "show-excerpt-link" %></li>
        <% elsif @post_set.has_wiki? %>
          <li><%= link_to "Wiki", wiki_page_path(@post_set.wiki_page), :id => "show-excerpt-link" %></li>
        <% elsif @post_set.has_pool? %>
          <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>
        <% end %>
      </menu>

      <%= render "posts/partials/index/edit" %>
      <%= render "posts/partials/index/excerpt", :post_set => @post_set %>
      <%= render "posts/partials/index/posts", :post_set => @post_set %>
    </section>
    
    <% content_for(:page_title) do %>
      <% if @post_set.tag_string.present? %>
        <%= @post_set.humanized_tag_string %> - <%= Danbooru.config.app_name %>
      <% else %>
        <%= Danbooru.config.app_name %>
      <% end %>
    <% end %>

    <% if params[:tags] =~ /search:/ %>
      <%= render "saved_searches/secondary_links" %>
    <% else %>
      <%= render "posts/partials/common/secondary_links" %>
    <% end %>

    <%= post_search_count_js %>

    <div id="saved-searches-nav">
      <%= render "saved_searches/interface" %>
    </div>
  </div>
</div>

<%= content_for(:html_header) do %>
  <link href="<%= posts_path(:format => 'atom', :tags => params[:tags]) %>" rel="alternate" title="ATOM" type="application/atom+xml" />
  <% if @post_set.has_wiki? %>
    <meta name="description" content="<%= @post_set.wiki_page.presenter.blurb %>">
  <% else %>
    <meta name="description" content="<%= Danbooru.config.description %>">
  <% end %>
  <%= missed_post_search_count_js %>
  <% if @post_set.hide_from_crawler? %>
    <meta name="robots" content="nofollow,noindex">
  <% end %>
<% end %>
