<section class="debate-show">
  <div id="debate-<%= @debate.id %>" class="row">
    <div class="small-12 medium-9 column">
      <i class="icon-angle-left left"></i>&nbsp;<%= link_to t("debates.show.back_link"), debates_path, class: 'left back' %>
      <div class="debate-info">
        <%= image_tag('user_default.jpg', class: 'author-photo', size: '32x32') %>
        <span class="author"><%= @debate.author.name %></span><span class="bullet">&nbsp;&bullet;&nbsp;</span> <%= l @debate.created_at.to_date %> <span class="bullet">&nbsp;&bullet;&nbsp;</span><i class="icon-chat-bubble-two"></i>&nbsp;<%= pluralize(@debate.comment_threads.count, t("debates.show.comment"), t("debates.show.comments")) %>
      </div>
      <h1><%= @debate.title %></h1>
      <%= @debate.description %>
      <p><%= render 'shared/tags', debate: @debate %></p>
    </div>

    <div id="<%= dom_id(@debate) %>_votes" class="small-12 medium-3 column">
      <h3><%= t("votes.supports") %></h3>
      <div class="text-center">
        <%= render 'debates/votes', debate: @debate %>
        <% if user_signed_in? %>
          <%= link_to t("debates.show.leave_comment"), "#comments", class: "leave-comment" %>
        <% else %>
          <%= link_to t("debates.show.login_to_comment"), new_user_session_path, class: "leave-comment" %>
        <% end %>
      </div>
    </div>

  </div>
</section>

<section class="row-full comments">
  <div class="row">
    <div id="comments" class="small-12 column">
      <h2><%= t("debates.show.comments") %></h2>
      <% if user_signed_in? %>
        <div>
          <%= t("debates.show.leave_comment") %>
          <%= render 'comments/form', {parent: @debate, toggeable: false} %>
        </div>
      <% end %>
      <%= render @debate.root_comments %>
    </div>
    <% if current_user && @debate.editable_by?(current_user) %>
      <%= link_to t("debates.show.edit_debate_link"), edit_debate_path(@debate), :class => 'button radius right' %>
    <% end %>
  </div>
</section>
