<% include_stat_graphs_javascript %>

<%= back_link_to budgets_admin_stats_path %>

<h2><%= budget.name %> - <%= t("admin.stats.budget_supporting.title") %></h2>

<div class="stats">
  <div class="row stats-numbers">
    <div class="small-12 medium-3 column">
      <p class="featured">
        <%= t("admin.stats.budget_supporting.vote_count") %>
        <br>
        <span id="total_votes_count" class="number">
          <%= vote_count %>
        </span>
      </p>
    </div>

    <div class="small-12 medium-6 column end">
      <p>
        <%= t("admin.stats.budget_supporting.participant_count") %>
        <br>
        <span id="total_participants_count" class="number">
          <%= user_count %>
        </span>
      </p>
    </div>
  </div>
</div>

<%= render Admin::Stats::ChartComponent.new(chart) %>

<table class="investment-projects-summary user-count-by-heading">
  <thead>
    <tr>
      <th><%= t("admin.stats.budget_supporting.headings") %></th>
      <th><%= t("admin.stats.budget_supporting.users") %></th>
    </tr>
  </thead>

  <tbody>
    <% user_count_by_heading.each do |heading, count| %>
      <tr id="<%= dom_id(heading) %>">
        <td class="name">
          <%= heading.name %>
        </td>
        <td class="name">
          <%= number_with_delimiter count %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
