<%= back_link_to @ballot_referer %>

<%= t("budgets.ballots.show.title") %>

<%= t("budgets.ballots.show.voted_html", count: @ballot.investments.count) %>

<%= t("budgets.ballots.show.voted_info_html") %>

<%= t("budgets.ballots.show.voted_info_2") %>

<% ballot_groups = @ballot.groups.sort_by_name %> <% ballot_groups.each do |group| %>

<%= group.name %> - <%= @ballot.heading_for_group(group).name %>

<%= link_to t("budgets.ballots.show.remaining", amount: @ballot.formatted_amount_available(@ballot.heading_for_group(group))).html_safe, budget_group_path(@budget, group) %>
<% if @ballot.has_lines_in_group?(group) %>

<%= t("budgets.ballots.show.amount_spent") %> <%= @ballot.formatted_amount_spent(@ballot.heading_for_group(group)) %>

<% else %>

<%= t("budgets.ballots.show.zero") %>

<% end %>
    <%= render partial: "budgets/ballot/investment", collection: @ballot.investments.by_group(group.id) %>
<% end %> <% no_balloted_groups = @budget.groups.sort_by_name - ballot_groups %> <% no_balloted_groups.each do |group| %>

<%= group.name %>

<%= link_to t("budgets.ballots.show.no_balloted_group_yet"), budget_group_path(@budget, group) %>
<% end %>