<main>
  <div class="row proposals-summary">
    <div id="proposals" class="proposals-list small-12 medium-9 column">
      <%= back_link_to %>

      <% @proposals.each do |group_name, proposals| %>
        <div id="<%= group_name.parameterize %>">
          <h2 class="margin-top"><%= group_name %></h2>

          <% proposals[0..2].each do |proposal| %>
            <div class="proposal clear">
              <div class="panel">
                <div class="row">
                  <div class="small-12 medium-9 column">
                    <div class="proposal-contenta">
                      <h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>

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

                      <div class="proposal-description">
                        <p><%= proposal.summary %></p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          <% end %>
        </div>
      <% end %>
    </div>

    <div class="small-12 medium-3 column">
      <aside class="sidebar">
        <%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: "button radius expand" %>
        <%= render "shared/tag_cloud", taggable: "proposal" %>
        <%= render "categories" %>
        <%= render "geozones" %>
      </aside>
    </div>
  </div>
</main>
