<% provide :title do %><%= t('spending_proposals.index.title') %><% end %>
<% content_for :header_addon do %>
  <%= render "shared/search_form",
             search_path: spending_proposals_path(page: 1),
             i18n_namespace: "spending_proposals.index.search_form" %>
<% end %>

<main>
  <div class="wrap row">
    <div id="investment-projects" class="investment-projects-list small-12 medium-9 column">

      <div class="small-12 search-results">
        <%= content_tag(:h2, t("spending_proposals.index.unfeasible")) if params[:unfeasible].present? %>
        <%= content_tag(:h2, t("spending_proposals.index.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
        <% if params[:search].present? %>
          <h2>
            <%= page_entries_info @spending_proposals %>
            <%= t("spending_proposals.index.search_results", count: @spending_proposals.size, search_term: params[:search]) %>
          </h2>
        <% end %>
      </div>

      <div class="show-for-small-only">
        <%= link_to t("spending_proposals.index.start_spending_proposal"), new_spending_proposal_path, class: 'button expanded' %>
      </div>
      <%= render partial: 'spending_proposals/spending_proposal', collection: @spending_proposals %>
      <%= paginate @spending_proposals %>
    </div>

    <div class="small-12 medium-3 column">
      <aside id="sidebar" class="margin-bottom">
        <%= render 'sidebar' %>
      </aside>
    </div>

  </div>
</main>
