<h2><%= t("valuation.spending_proposals.index.title") %></h2>

<div class="row collapse">
  <% @geozone_filters.each_slice(8) do |slice| %>
    <div class="small-12 medium-4 column select-geozone">
      <% slice.each do |filter| %>
        <%= link_to valuation_spending_proposals_path(geozone_id: filter[:id]),
                    class: "#{'active' if params[:geozone_id].to_s == filter[:id].to_s}" do %>
          <%= filter[:name] %>&nbsp;(<%= filter[:pending_count] %>)
        <% end %>
      <% end %>
    </div>
  <% end %>
</div>

<%= render 'shared/filter_subnav', i18n_namespace: "valuation.spending_proposals.index" %>

<h3><%= page_entries_info @spending_proposals %></h3>

<table>
  <% @spending_proposals.each do |spending_proposal| %>
    <tr id="<%= dom_id(spending_proposal) %>">
      <td>
        <strong><%= spending_proposal.id %></strong>
      </td>
      <td>
        <%= link_to spending_proposal.title, valuation_spending_proposal_path(spending_proposal) %>
      </td>
      <td class="small">
        <%= link_to t("valuation.spending_proposals.index.edit"), edit_valuation_spending_proposal_path(spending_proposal) %>
      </td>
      <td class="small">
        <%= assigned_valuators_info(spending_proposal.valuators) %>
      </td>
      <td class="small">
        <%= geozone_name(spending_proposal) %>
      </td>
    </tr>
  <% end %>
</table>

<%= paginate @spending_proposals %>
