<commit_before><% @page_title = "Results: #{@racer.name}" %>

<% table :caption => @racer.name, :class => "racer_results" do %>
  <tr>
    <th>&nbsp;</th>
    <th>Race</th>
    <th>Category</th>
    <th>Date</th>
  </tr>
  <% @event_results.sort { |x, y| y.event.end_date <=> x.event.end_date }.each do |result| -%>
  <tr class="<%= cycle("even", "odd") %>">
    <td class="place right"><%= result.place %></td>
    <td class="standings"><%= link_to(result.event.full_name, :controller => 'results', :action => 'event', :id => result.event.id, :anchor => "race_#{result.race.id}") %></td>
    <td class="category"><%= result.race.name %></td>
    <td class="dates"><%= result.event.date_range_s(:long) %></td>
  </tr>
  <%- end -%>
<% end -%>

<% for result in @competition_results.sort {|x, y| y.event.end_date <=> x.event.end_date } %>
<br/><br/>
<% table :caption => "#{result.place.to_i.ordinalize} &mdash; #{result.race.full_name}" do %>
  <tr>
    <th>&nbsp;</th>
    <th>Race</th>
    <th>Category</th>
    <th>Date</th>
    <th class="right">Points</th>
  </tr>
  <% for score in result.scores.sort {|x, y| y.source_result.event.date <=> x.source_result.event.date } %>
  <tr class="<%= cycle("even", "odd") %>">
    <td class="place right" width="24"><%= score.source_result.place %></td>
    <td class="standings">
      <%= link_to(score.source_result.event.full_name, :controller => 'results', :action => 'event', :id => score.source_result.event.id, :anchor => "race_#{score.source_result.race.id}") unless score.source_result.event.is_a?(Competition) %>
      <%= link_to(score.source_result.race.full_name, :controller => 'results', :action => 'competition', :competition_id => score.source_result.event.id, :racer_id => @racer.id) if score.source_result.event.is_a?(Competition)%></td>
    <td class="category"><%= score.source_result.race.name %></td>
    <td class="dates"><%= score.source_result.event.date_range_s(:long) %></td>
    <td class="right"><%= number_with_precision(score.points, :precision => 1) %></td>
  </tr>
  <% end %>
  <tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td class="total_points"><span class="total">TOTAL</span><%= number_with_precision(result.points, :precision => 1) %></td><commit_msg>Link to competitions in racer results view<commit_after><% @page_title = "Results: #{@racer.name}" %>

<% table :caption => @racer.name, :class => "racer_results" do %>
  <tr>
    <th>&nbsp;</th>
    <th>Race</th>
    <th>Category</th>
    <th>Date</th>
  </tr>
  <% @event_results.sort { |x, y| y.event.end_date <=> x.event.end_date }.each do |result| -%>
  <tr class="<%= cycle("even", "odd") %>">
    <td class="place right"><%= result.place %></td>
    <td class="standings"><%= link_to(result.event.full_name, :controller => 'results', :action => 'event', :id => result.event.id, :anchor => "race_#{result.race.id}") %></td>
    <td class="category"><%= result.race.name %></td>
    <td class="dates"><%= result.event.date_range_s(:long) %></td>
  </tr>
  <%- end -%>
<% end -%>

<% for result in @competition_results.sort {|x, y| y.event.end_date <=> x.event.end_date } %>
<br/><br/>
<% table :caption => link_to("#{result.place.to_i.ordinalize} &mdash; #{result.race.full_name}", 
  :controller => 'results', :action => 'event', :id => result.event.id) do %>
  <tr>
    <th>&nbsp;</th>
    <th>Race</th>
    <th>Category</th>
    <th>Date</th>
    <th class="right">Points</th>
  </tr>
  <% for score in result.scores.sort {|x, y| y.source_result.event.date <=> x.source_result.event.date } %>
  <tr class="<%= cycle("even", "odd") %>">
    <td class="place right" width="24"><%= score.source_result.place %></td>
    <td class="standings">
      <%= link_to(score.source_result.event.full_name, :controller => 'results', :action => 'event', :id => score.source_result.event.id, :anchor => "race_#{score.source_result.race.id}") unless score.source_result.event.is_a?(Competition) %>
      <%= link_to(score.source_result.race.full_name, :controller => 'results', :action => 'competition', :competition_id => score.source_result.event.id, :racer_id => @racer.id) if score.source_result.event.is_a?(Competition)%></td>
    <td class="category"><%= score.source_result.race.name %></td>
    <td class="dates"><%= score.source_result.event.date_range_s(:long) %></td>
    <td class="right"><%= number_with_precision(score.points, :precision => 1) %></td>
  </tr>
  <% end %>
  <tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td class="total_points"><span class="total">TOTAL</span><%= number_with_precision(result.points, :precision => 1) %></td>
{'fraction_non_alphanumeric': 0.24172972972972973, 'fraction_numerical': 0.0017297297297297297, 'mean_word_length': 4.262798634812286, 'pattern_counts': {'":': 0, '<': 171, '<?xml version=': 0, '>': 208, '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': '2208488', 'n_tokens_mistral': 1819, 'n_tokens_neox': 1730, 'n_words': 309}