<h4><%= t('.title') %></h4>

<% if CONFIG["can_see_post"].call(@current_user, @post) %>
  <%= image_tag @post.preview_url %>
<% end %>

<%= form_tag(:action => "destroy") do %>
  <%= hidden_field_tag "id", params[:id] %>
  <label><%= t('.reason') %></label> <%= text_field_tag "reason" %>
  <% if @post.is_deleted? %>
  <%= hidden_field_tag "destroy", "1" %>
  <% end %>

  <%= submit_tag @post.is_deleted? ? t('.permanent') : t('.delete') %> <%= submit_tag t('buttons.cancel') %>
<% end %>

<div class="deleting-post">
<% if !@post.is_deleted? %>
    <br>
    <p>
    <% if @post_parent %>
      <%= t('.parent_info') %><p>
    <% if CONFIG["can_see_post"].call(@current_user, @post_parent) %>
      <ul id="post-list-posts"> <%= print_preview(@post_parent, :hide_directlink=>true) %> </ul>
    <% else %>
      <%= t('.noaccess_info') %>
    <% end %>

    <% else %>
      <%= t('.noparent_info') %><p>
    <% end %>
<% else %>
  <%= t('.permanent_info') %>
<% end %>
</div>

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

<script type="text/javascript">$("reason").focus();</script>
