<% cache [locale_and_user_status, debate, @debate_votes[debate.id]] do %>
  <div id="<%= dom_id(debate) %>" class="debate clear" data-type="debate">
    <div class="panel">
      <div class="row">

        <div class="small-12 medium-9 column">
          <div class="debate-content">
            <span class="label-debate float-left"><%= t("debates.debate.debate") %></span>
            <span class="icon-debates"></span>
            <h3><%= link_to debate.title, debate %></h3>
            <p class="debate-info">
              <span class="icon-comments"></span>&nbsp;
              <%= link_to t("debates.debate.comments", count: debate.comments_count), debate_path(debate, anchor: "comments") %>
              <span class="bullet">&nbsp;&bull;&nbsp;</span>
              <%= l debate.created_at.to_date %>

              <% if debate.author.hidden? || debate.author.erased? %>
                <span class="bullet">&nbsp;&bull;&nbsp;</span>
                <span class="author">
                  <%= t("debates.show.author_deleted") %>
                </span>
              <% else %>
                <span class="bullet">&nbsp;&bull;&nbsp;</span>
                <span class="author">
                  <%= debate.author.name %>
                </span>
                <% if debate.author.official? %>
                  <span class="bullet">&nbsp;&bull;&nbsp;</span>
                  <span class="label round level-<%= debate.author.official_level %>">
                    <%= debate.author.official_position %>
                  </span>
                <% end %>
              <% end %>

              <% if debate.author.verified_organization? %>
                <span class="bullet">&nbsp;&bull;&nbsp;</span>
                <span class="label round is-association">
                  <%= t("shared.collective") %>
                </span>
              <% end %>

            </p>
            <div class="debate-description">
              <%= link_to debate.description, debate %>
              <div class="truncate"></div>
            </div>
            <%= render "shared/tags", taggable: debate, limit: 5 %>
          </div>
        </div>

        <div id="<%= dom_id(debate) %>_votes" class="small-12 medium-3 column text-center">
            <%= render 'debates/votes', debate: debate %>
        </div>

      </div>
    </div>
  </div>
<% end %>
