<commit_before><% cache [@stats] do %>
  <% provide :title do %>
    <%= t("budgets.stats.page_title", budget: @budget.name) %>
  <% end %>
  <% provide :social_media_meta_tags do %>
  <%= render "shared/social_media_meta_tags",
              social_url: budget_url(@budget),
              social_title: @budget.name,
              social_description: @budget.description_finished %>
  <% end %>

  <div class="budgets-stats">
    <div class="expanded no-margin-top padding header">
      <div class="row">
        <div class="small-12 column text-center">
          <%= back_link_to budgets_path %>
          <h1 class="title"><%= t("budgets.stats.title") %><br><%= @budget.name %></h1>
        </div>
      </div>
    </div>

    <div class="row margin-top">
      <div class="small-12 column">
        <ul class="tabs">
          <!-- Pending results tab
            <li class="tabs-title">
            <%# link_to t("budget.results.link"), budget_results_path(@budget) %>
            </li>
          -->
          <li class="tabs-title is-active">
            <span class="show-for-sr"><%= t("shared.you_are_in") %></span>
            <%= link_to t("budgets.stats.link"), budget_stats_path(@budget), class: "is-active" %>
          </li>
        </ul>
      </div>
    </div>

    <div class="row">
      <div class="small-12 medium-6 column">
        <div class="callout">
          <span class="uppercase"><%= t("budgets.stats.total_participants") %></span>
          <p id="total_participants" class="big-number-stat budget">
            <%= @stats[:total_participants] %>
          </p>

          <span class="uppercase"><%= t("budgets.stats.total_budget_investments") %></span>
          <p class="big-number-stat budget">
            <%= @stats[:total_budget_investments] %>
          </p>
        </div>
      </div>

      <div class="small-12 medium-6 column">
        <p>
          <span class="label feasible"></span>&nbsp;
          <span id="total_selected_investments">
            <span class="uppercase"><strong><%= t("budgets.stats.total_selected_investments") %></strong></span>:
            <%= @stats[:total_selected_investments] %><br>
          </span>

          <span class="label unfeasible"></span>&nbsp;
          <span id="total_unfeasible_investments">
            <span class="uppercase"><strong><%= t("budgets.stats.total_unfeasible_investments") %></strong></span>:
            <%= @stats[:total_unfeasible_investments] %><br>
          </span>

          <br>

          <span class="label supports"></span>&nbsp;
          <span class="uppercase"><strong><%= t("budgets.stats.total_participants_support_phase") %></strong></span>:
          <span id="total_participants_support_phase">
            <%= @stats[:total_participants_support_phase] %> <em><%= t("budgets.stats.participants") %></em>,
            <%= @stats[:total_supports] %> <em><%= t("budgets.stats.supports") %></em><br>
          </span>

          <span class="label balloting"></span>&nbsp;
          <span class="uppercase"><strong><%= t("budgets.stats.total_participants_vote_phase") %></strong></span>:
          <span id="total_participants_vote_phase">
            <%= @stats[:total_participants_vote_phase] %> <em><%= t("budgets.stats.participants") %></em>,
            <%= @stats[:total_votes] %> <em><%= t("budgets.stats.votes") %></em><br>
          </span>
        </p>
      </div>
    </div>

    <div class="row margin">
      <div class="small-12 column">
        <h2 class="margin-bottom"><%= t("budgets.stats.by_gender") %></h2>
      </div>

      <div class="small-12 medium-6 column text-center">
        <%= image_tag ('budgets/stats/gender.png') %>
      </div>

      <div class="small-12 medium-6 column">
        <div class="small-12 medium-6 column text-left">
          <p id="female_percentage">
            <span class="label" style="background: #FF9E01"></span>
            &nbsp;<%= t("budgets.stats.total_female_participants").upcase %>
            (<%= number_to_percentage(@stats[:female_percentage],
                                      strip_insignificant_zeros: true,
                                      precision: 2) %>)
          </p>
          <p id="total_female_participants" class="big-number-stat">
            <%= @stats[:total_female_participants] %>
          </p>
        </div>

        <div class="small-12 medium-6 column text-right">
          <p id="male_percentage" ><commit_msg>changes text classes on gender stats<commit_after><% cache [@stats] do %>
  <% provide :title do %>
    <%= t("budgets.stats.page_title", budget: @budget.name) %>
  <% end %>
  <% provide :social_media_meta_tags do %>
  <%= render "shared/social_media_meta_tags",
              social_url: budget_url(@budget),
              social_title: @budget.name,
              social_description: @budget.description_finished %>
  <% end %>

  <div class="budgets-stats">
    <div class="expanded no-margin-top padding header">
      <div class="row">
        <div class="small-12 column text-center">
          <%= back_link_to budgets_path %>
          <h1 class="title"><%= t("budgets.stats.title") %><br><%= @budget.name %></h1>
        </div>
      </div>
    </div>

    <div class="row margin-top">
      <div class="small-12 column">
        <ul class="tabs">
          <!-- Pending results tab
            <li class="tabs-title">
            <%# link_to t("budget.results.link"), budget_results_path(@budget) %>
            </li>
          -->
          <li class="tabs-title is-active">
            <span class="show-for-sr"><%= t("shared.you_are_in") %></span>
            <%= link_to t("budgets.stats.link"), budget_stats_path(@budget), class: "is-active" %>
          </li>
        </ul>
      </div>
    </div>

    <div class="row">
      <div class="small-12 medium-6 column">
        <div class="callout">
          <span class="uppercase"><%= t("budgets.stats.total_participants") %></span>
          <p id="total_participants" class="big-number-stat budget">
            <%= @stats[:total_participants] %>
          </p>

          <span class="uppercase"><%= t("budgets.stats.total_budget_investments") %></span>
          <p class="big-number-stat budget">
            <%= @stats[:total_budget_investments] %>
          </p>
        </div>
      </div>

      <div class="small-12 medium-6 column">
        <p>
          <span class="label feasible"></span>&nbsp;
          <span id="total_selected_investments">
            <span class="uppercase"><strong><%= t("budgets.stats.total_selected_investments") %></strong></span>:
            <%= @stats[:total_selected_investments] %><br>
          </span>

          <span class="label unfeasible"></span>&nbsp;
          <span id="total_unfeasible_investments">
            <span class="uppercase"><strong><%= t("budgets.stats.total_unfeasible_investments") %></strong></span>:
            <%= @stats[:total_unfeasible_investments] %><br>
          </span>

          <br>

          <span class="label supports"></span>&nbsp;
          <span class="uppercase"><strong><%= t("budgets.stats.total_participants_support_phase") %></strong></span>:
          <span id="total_participants_support_phase">
            <%= @stats[:total_participants_support_phase] %> <em><%= t("budgets.stats.participants") %></em>,
            <%= @stats[:total_supports] %> <em><%= t("budgets.stats.supports") %></em><br>
          </span>

          <span class="label balloting"></span>&nbsp;
          <span class="uppercase"><strong><%= t("budgets.stats.total_participants_vote_phase") %></strong></span>:
          <span id="total_participants_vote_phase">
            <%= @stats[:total_participants_vote_phase] %> <em><%= t("budgets.stats.participants") %></em>,
            <%= @stats[:total_votes] %> <em><%= t("budgets.stats.votes") %></em><br>
          </span>
        </p>
      </div>
    </div>

    <div class="row margin">
      <div class="small-12 column">
        <h2 class="margin-bottom"><%= t("budgets.stats.by_gender") %></h2>
      </div>

      <div class="small-12 medium-6 column text-center">
        <%= image_tag ('budgets/stats/gender.png') %>
      </div>

      <div class="small-12 medium-6 column">
        <div class="small-12 medium-6 column text-right">
          <p id="female_percentage">
            <span class="label" style="background: #FF9E01"></span>
            &nbsp;<%= t("budgets.stats.total_female_participants").upcase %>
            (<%= number_to_percentage(@stats[:female_percentage],
                                      strip_insignificant_zeros: true,
                                      precision: 2) %>)
          </p>
          <p id="total_female_participants" class="big-number-stat">
            <%= @stats[:total_female_participants] %>
          </p>
        </div>

        <div class="small-12 medium-6 column text-left">
          <p id="male_percentage" >
{'fraction_non_alphanumeric': 0.18449107844237458, 'fraction_numerical': 0.00718213444057906, 'mean_word_length': 2.398932112890923, 'pattern_counts': {'":': 0, '<': 283, '<?xml version=': 0, '>': 283, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4894886', 'n_tokens_mistral': 2958, 'n_tokens_neox': 2721, 'n_words': 471}