<% @canonical_url = url_for(:controller => '/post', :action => :show, :id => @post.id, :only_path => false) %>
<% provide :title, "#{@post.title_tags.tr('_', ' ')} | ##{@post.id}" %>
<%- content_for :html_header do -%>
  <%= render 'social_meta' -%>
<%- end -%>
<div id="post-view">
  <% if @post.nil? %>
    <h2><%= t('.empty') %></h2>
  <% else %>
    <% if @post.can_be_seen_by?(@current_user) %>
      <script type="text/javascript"> Post.register_resp(<%= json_escape Post.batch_api_data([@post]).to_json.html_safe %>); </script>
    <% end %>

    <%= render :partial => "post/show_partials/status_notices" %>

    <div class="sidebar">
      <%= render :partial => "search" %>
      <%= render :partial => "tags" %>
      <%= render :partial => "post/show_partials/statistics_panel" %>
      <%= render :partial => "post/show_partials/options_panel" %>
      <%= render :partial => "post/show_partials/related_posts_panel" %>
 <br />
  <%= render :partial => 'layouts/twitter_link' %>
 <br />
  <% if CONFIG["can_see_ads"].call(@current_user) %>
  <%= render :partial => "vertical" %>
  <% end %>
    </div>
    <div class="content" id="right-col">
      <% if CONFIG["can_see_ads"].call(@current_user) %>
        <%= render :partial => "horizontal" %>
        <br />
        <br />
      <% end %>
      <%= render :partial => "post/show_partials/image" %>
      <%= render :partial => "post/show_partials/image_footer" %>
      <%= render :partial => "post/show_partials/edit" %>
      <%= render :partial => "post/show_partials/comments" %>
    </div>

    <% content_for :post_cookie_javascripts do %>
      <script type="text/javascript">

        if (Cookie.get('resize_image') == '1') {
          Post.resize_image()
        }

        <% browser_url = "/post/browse##{@post.id}" %>
        <% browser_url += "/pool:#{@following_pool_post.pool_id}" if not @following_pool_post.nil? %>
        OnKey(66, {}, function(e) { window.location.href = <%= json_escape browser_url.to_json.html_safe %>; });
      </script>
    <% end %>
  <% end %>
</div>

<script type="text/javascript">
  new TagCompletionBox($("post_tags"));
  if(TagCompletion)
    TagCompletion.observe_tag_changes_on_submit($("edit-form"), $("post_tags"), $("post_old_tags"));

</script>
<%= render :partial => "footer" %>
