<commit_before><% competition = @competition%>
<h1 class="white"><%= competition.name %></h1>
<strong>When:</strong> <%= competition.when %><br/>
<strong>where:</strong> <%= competition.where %><br/><br/>
<p><%= competition.description %></p>


<div class="event-list-header">Skip to Event:</div>
<small>(These are not in order)</small>
<% competition.events.each do |event| %>
 <div class="event-link"><%= link_to event.name, "##{event.name}" %></div>
<% end %>

<a name="top"></a>
<h2 class="tightbottom">Current Leader Board:</h2>

<% if updated = competition.most_recent_stat_update %>
  <div class="greenish blocky">
    <%= link_to competition_url(competition), :class => 'refresh button' do %>
      <%= image_tag "reload.png", :width => '30' %>
    <% end %>
    <span class="updated">Stats updated <%= time_ago_in_words(updated) %> ago</span>
  </div>
<% end %>

<% competition.leader_board.sort.each do |category, athletes| %>
  <h4><%= category %></h4>
  <% leaderboard_ranking(athletes).each do |athlete, ranking| %>
    <div class="athlete">
      <span class="rank">#<%= ranking %></span>
      <span class="athlete-info"><%= "#{athlete.name}" %></span>
      <br/>
      <% max    = athlete.max_competition_ranking
         mine   = athlete.competition_rank_total
         points = (max.eql?(mine) ? "0" : mine)
      %>
      <span class="pts"><%= "#{points}" %>pts <span class="info"><%= " (##{athlete.number})" if athlete.number %><%= " from #{athlete.affiliation}" if athlete.affiliation %></span></span>
    </div>
  <% end %>
<% end %>
<br/>
<h2>Events:</h2>
<% competition.events.sort.each do |event| %>
 <a name="<%= event.name %>"></a>
  <h3><%= event.name %></h3>
  <small>[<a href="#top">Back to Leaderboard</a>]</small>
  <p><pre class="orange"><%= event.description %></pre></p>
  <% if !([1.0, 1, nil].include?(event.event_weight)) %>
    <p class="orange">This event is worth <%= (event.event_weight * 100).to_i %>%</p>
  <% end %>
    <% event.ranked_results.sort.each do |category, results| %>
      <h4><%= category %></h4>
      <% results.each do |result| %>
        <div class="athlete">
          <span class="rank">#<%= result.event_rank || 'X' %></span>
          <span class="athlete-info"><%= "#{result.athlete.name}" %></span>
          <br/>
          <span class="pts"><%= result.result %> <span class="info"><%= " (##{result.athlete.number})" if result.athlete.number %><%= " from #{result.athlete.affiliation}" if result.athlete.affiliation %></span></span>
        </div>
      <% end %>
    <% end %>
  <br/><br/>
<% end %><commit_msg>do not display results in events to avoid gaming<commit_after><% competition = @competition%>
<h1 class="white"><%= competition.name %></h1>
<strong>When:</strong> <%= competition.when %><br/>
<strong>where:</strong> <%= competition.where %><br/><br/>
<p><%= competition.description %></p>


<div class="event-list-header">Skip to Event:</div>
<small>(These are not in order)</small>
<% competition.events.each do |event| %>
 <div class="event-link"><%= link_to event.name, "##{event.name}" %></div>
<% end %>

<a name="top"></a>
<h2 class="tightbottom">Current Leader Board:</h2>

<% if updated = competition.most_recent_stat_update %>
  <div class="greenish blocky">
    <%= link_to competition_url(competition), :class => 'refresh button' do %>
      <%= image_tag "reload.png", :width => '30' %>
    <% end %>
    <span class="updated">Stats updated <%= time_ago_in_words(updated) %> ago</span>
  </div>
<% end %>

<% competition.leader_board.sort.each do |category, athletes| %>
  <h4><%= category %></h4>
  <% leaderboard_ranking(athletes).each do |athlete, ranking| %>
    <div class="athlete">
      <span class="rank">#<%= ranking %></span>
      <span class="athlete-info"><%= "#{athlete.name}" %></span>
      <br/>
      <% max    = athlete.max_competition_ranking
         mine   = athlete.competition_rank_total
         points = (max.eql?(mine) ? "0" : mine)
      %>
      <span class="pts"><%= "#{points}" %>pts <span class="info"><%= " (##{athlete.number})" if athlete.number %><%= " from #{athlete.affiliation}" if athlete.affiliation %></span></span>
    </div>
  <% end %>
<% end %>
<br/>
<h2>Events:</h2>
<% competition.events.sort.each do |event| %>
 <a name="<%= event.name %>"></a>
  <h3><%= event.name %></h3>
  <small>[<a href="#top">Back to Leaderboard</a>]</small>
  <p><pre class="orange"><%= event.description %></pre></p>
  <% if !([1.0, 1, nil].include?(event.event_weight)) %>
    <p class="orange">This event is worth <%= (event.event_weight * 100).to_i %>%</p>
  <% end %>
    <% event.ranked_results.sort.each do |category, results| %>
      <h4><%= category %></h4>
      <% results.each do |result| %>
        <div class="athlete">
          <span class="rank">#<%= result.event_rank || 'X' %></span>
          <span class="athlete-info"><%= "#{result.athlete.name}" %></span>
          <br/>
          <span class="pts"><%# result.result %> <span class="info"><%= " (##{result.athlete.number})" if result.athlete.number %><%= " from #{result.athlete.affiliation}" if result.athlete.affiliation %></span></span>
        </div>
      <% end %>
    <% end %>
  <br/><br/>
<% end %>
{'fraction_non_alphanumeric': 0.2395693135935397, 'fraction_numerical': 0.008075370121130552, 'mean_word_length': 3.7768595041322315, 'pattern_counts': {'":': 0, '<': 229, '<?xml version=': 0, '>': 233, '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': '803976', 'n_tokens_mistral': 1932, 'n_tokens_neox': 1759, 'n_words': 378}