<div id="<%= dom_id(proposal) %>"
     class="proposal clear <%= ("successful" if proposal.total_votes > Proposal.votes_needed_for_success) %>"
     data-type="proposal">
  <div class="panel <%= ('with-image' if feature?(:allow_images) && proposal.image.present?) %>">
    <div class="icon-successful"></div>

    <% if feature?(:allow_images) && proposal.image.present? %>
      <div class="row" data-equalizer>

        <div class="small-12 medium-3 large-2 column text-center">
          <div data-equalizer-watch>
            <%= image_tag proposal.image_url(:thumb), alt: proposal.image.title %>
          </div>
        </div>

        <div class="small-12 medium-6 large-7 column">
    <% else %>
      <div class="row">
        <div class="small-12 medium-9 column">
      <% end %>
        <div class="proposal-content">
          <% cache [locale_and_user_status(proposal), 'index', proposal, proposal.author] do %>
            <h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
            <p class="proposal-info">
              <span class="icon-comments"></span>&nbsp;
              <%= link_to t("proposals.proposal.comments", count: proposal.comments_count), namespaced_proposal_path(proposal, anchor: "comments") %>

              <span class="bullet">&nbsp;&bull;&nbsp;</span>
              <%= l proposal.created_at.to_date %>

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

              <% if proposal.author.verified_organization? %>
                <span class="bullet">&nbsp;&bull;&nbsp;</span>
                <span class="label round is-association">
                  <%= t("shared.collective") %>
                </span>
              <% end %>
            </p>
            <div class="proposal-description">
              <p><%= proposal.summary %></p>
              <div class="truncate"></div>
            </div>
            <%= render "shared/tags", taggable: proposal, limit: 5 %>
          <% end %>
        </div>
      </div>

      <div id="<%= dom_id(proposal) %>_votes"
           class="small-12 medium-3 column supports-container"
           <%= 'data-equalizer-watch' if feature?(:allow_images) && proposal.image.present? %>>
        <% if proposal.successful? %>
          <div class="padding text-center">

            <p>
              <%= t("proposals.proposal.successful",
                  voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
            </p>
          </div>
          <% if can? :create, Poll::Question %>
            <p class="text-center">
              <%= link_to t('poll_questions.create_question'),
                          new_admin_question_path(proposal_id: proposal.id),
                          class: "button hollow" %>
            </p>
          <% end %>
        <% elsif proposal.archived? %>
          <div class="padding text-center">
            <strong><%= t("proposals.proposal.supports", count: proposal.total_votes) %></strong>
            <p><%= t("proposals.proposal.archived") %></p>
          </div>
        <% else %>
          <%= render 'votes',
                    { proposal: proposal, vote_url: vote_proposal_path(proposal, value: 'yes') } %>
        <% end %>
      </div>
    </div>
  </div>
</div>
