<commit_before><%= profile_page 'Deck Statistics', json: true do %>
  <div class="row">
    <div class="col-sm-4">
      <h3>Deck Statistics</h3>
    </div>
    <div class="col-sm-8">
      <h2>
        <%= render partial: '/stats/toolbar', locals: { disable_arena_mode_selection: true } %>
      </h2>
    </div>
  </div>

  <table class="table table-hover table-condensed overall-stats">
    <thead>
      <tr>
        <th class="win-loss">Win - Loss</th>
        <th class="winrate">Winrate</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="win-loss"><%= @stats[:overall][:wins] %> - <%= @stats[:overall][:losses] %></td>
        <td class="winrate"><%= winrate(@stats[:overall][:wins], @stats[:overall][:losses]) %>
        </td>
      </tr>
    </tbody>
  </table>

  <%= render partial: '/layouts/notifications' %>

  <% if @as_deck %>
  <p>
    <strong>As:</strong> <%= label_for_deck(@as_deck) %> <%= link_to icon('times'), params.except(:as_deck) %>
  </p>
  <% end %>
  <% if @vs_deck %>
  <p>
    <strong>Versus:</strong> <%= label_for_deck(@vs_deck) %> <%= link_to icon('times'), params.except(:vs_deck) %>
  </p>
  <% end %>

  <% if current_user.decks.empty? %>
  <p class="alert alert-info">
    No decks defined. Define decks in the <%= link_to 'settings', profile_settings_decks_path %>.
  </p>
  <% else %>
  <%
    %i[as vs].each do |type| 
      key = "#{type}_deck".to_sym
  %>
      <table class="table table-hover table-condensed deck-stats">
        <thead>
          <tr>
            <th class="deck">Deck</th>
            <th class="share">Share</th>
            <th class="win-loss">Win/Loss</th>
            <th class="winrate">Winrate</th>
          </tr>
        </thead>
        <tbody>

        <% @stats[key].each do |deck, stats| %>
        <tr>
          <td class="deck"><%= type %> <%= link_to label_for_deck(deck), params.merge("#{type}_deck" => deck.id) %></td>
          <td class="share"><%= percentage(stats[:wins] + stats[:losses], @stats[:overall][:total]) %></td>
          <td class="win-loss"><%= stats[:wins] %>/<%= stats[:losses] %></td>
          <td class="winrate"><%= winrate(stats[:wins], stats[:losses]) %></td>
        </tr>
        <% end %>
      </table>
    <% end %>
  <% end %>
<% end %><commit_msg>add missing sort header links in decks<commit_after><%= profile_page 'Deck Statistics', json: true do %>
  <div class="row">
    <div class="col-sm-4">
      <h3>Deck Statistics</h3>
    </div>
    <div class="col-sm-8">
      <h2>
        <%= render partial: '/stats/toolbar', locals: { disable_arena_mode_selection: true } %>
      </h2>
    </div>
  </div>

  <table class="table table-hover table-condensed overall-stats">
    <thead>
      <tr>
        <th class="win-loss">Win - Loss</th>
        <th class="winrate">Winrate</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="win-loss"><%= @stats[:overall][:wins] %> - <%= @stats[:overall][:losses] %></td>
        <td class="winrate"><%= winrate(@stats[:overall][:wins], @stats[:overall][:losses]) %>
        </td>
      </tr>
    </tbody>
  </table>

  <%= render partial: '/layouts/notifications' %>

  <% if @as_deck %>
  <p>
    <strong>As:</strong> <%= label_for_deck(@as_deck) %> <%= link_to icon('times'), params.except(:as_deck) %>
  </p>
  <% end %>
  <% if @vs_deck %>
  <p>
    <strong>Versus:</strong> <%= label_for_deck(@vs_deck) %> <%= link_to icon('times'), params.except(:vs_deck) %>
  </p>
  <% end %>

  <% if current_user.decks.empty? %>
  <p class="alert alert-info">
    No decks defined. Define decks in the <%= link_to 'settings', profile_settings_decks_path %>.
  </p>
  <% else %>
  <%
    %i[as vs].each do |type| 
      key = "#{type}_deck".to_sym
  %>
      <table class="table table-hover table-condensed deck-stats">
        <thead>
          <tr>
            <th class="deck">Deck</th>
            <th class="share"><%= sortable_header_link('Share', :share) %></th>
            <th class="win-loss">Win/Loss</th>
            <th class="winrate"><%= sortable_header_link('Winrate', :winrate) %></th>
          </tr>
        </thead>
        <tbody>

        <% @stats[key].each do |deck, stats| %>
        <tr>
          <td class="deck"><%= type %> <%= link_to label_for_deck(deck), params.merge("#{type}_deck" => deck.id) %></td>
          <td class="share"><%= percentage(stats[:wins] + stats[:losses], @stats[:overall][:total]) %></td>
          <td class="win-loss"><%= stats[:wins] %>/<%= stats[:losses] %></td>
          <td class="winrate"><%= winrate(stats[:wins], stats[:losses]) %></td>
        </tr>
        <% end %>
      </table>
    <% end %>
  <% end %>
<% end %>
{'fraction_non_alphanumeric': 0.22650396060800684, 'fraction_numerical': 0.002569043031470777, 'mean_word_length': 2.6133023975251355, 'pattern_counts': {'":': 0, '<': 189, '<?xml version=': 0, '>': 191, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5919543', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1643, 'n_words': 320}