<commit_before><h1>Contestants</h1>

<table id="contestants">
  <% if @contestants.any? %>
    <thead>
      <tr>
        <th>Name</th>
        <% DerbyConfig.lane_count.times do |i| %>
          <th>Round <%= i+1 %></th>
        <% end %>
        <th></th>
      </tr>
    </thead>
  <% end %>

  <tbody>
    <%= content_tag_for(:tr, @contestants, class: "contestant") do |contestant| %>
      <td class="<%= 'retired' if contestant.retired %>">
        <% if admin? %>
          <%= link_to contestant.name, edit_contestant_path(contestant) %>
        <% else %>
          <%= contestant.name %>
        <% end %>
      </td>
      <% DerbyConfig.lane_count.times do |i| %>
        <td><%= contestant.runs.complete[i].try :time %></td>
      <% end %>
      <td>
        <% if contestant.retired %>
          <%= link_to 'reactivate', reactivate_contestant_path(contestant), method: :post, class: 'retire', style: 'display: none' %>
        <% else %>
          <%= link_to 'retire', contestant, method: :delete, data: { confirm: "Are you sure? #{j contestant.name} will be taken out of the race." }, class: 'retire', style: 'display: none' %>
        <% end %>
      </td>
    <% end %>
  </tbody>
</table>

<br>

<% if admin? %>
  <%= link_to 'Register contestants', new_contestant_path, class: 'btn btn-primary' %>
  <%= link_to 'Start a new derby', reset_derby_path, class: 'btn btn-danger pull-right', method: 'post', data: { confirm: 'Are you sure? This will clear out all data and start a new derby.' } %>
<% end %><commit_msg>Show each contestant's average time on the contestants page<commit_after><h1>Contestants</h1>

<table id="contestants">
  <% if @contestants.any? %>
    <thead>
      <tr>
        <th>Name</th>
        <th>Average</th>
        <% DerbyConfig.lane_count.times do |i| %>
          <th>Round <%= i+1 %></th>
        <% end %>
        <th></th>
      </tr>
    </thead>
  <% end %>

  <tbody>
    <%= content_tag_for(:tr, @contestants, class: "contestant") do |contestant| %>
      <td class="<%= 'retired' if contestant.retired %>">
        <% if admin? %>
          <%= link_to contestant.name, edit_contestant_path(contestant) %>
        <% else %>
          <%= contestant.name %>
        <% end %>
      </td>
      <td>
        <%= contestant.average_time %>
      </td>
      <% DerbyConfig.lane_count.times do |i| %>
        <td><%= contestant.runs.complete[i].try :time %></td>
      <% end %>
      <td>
        <% if contestant.retired %>
          <%= link_to 'reactivate', reactivate_contestant_path(contestant), method: :post, class: 'retire', style: 'display: none' %>
        <% else %>
          <%= link_to 'retire', contestant, method: :delete, data: { confirm: "Are you sure? #{j contestant.name} will be taken out of the race." }, class: 'retire', style: 'display: none' %>
        <% end %>
      </td>
    <% end %>
  </tbody>
</table>

<br>

<% if admin? %>
  <%= link_to 'Register contestants', new_contestant_path, class: 'btn btn-primary' %>
  <%= link_to 'Start a new derby', reset_derby_path, class: 'btn btn-danger pull-right', method: 'post', data: { confirm: 'Are you sure? This will clear out all data and start a new derby.' } %>
<% end %>
{'fraction_non_alphanumeric': 0.18689547581903276, 'fraction_numerical': 0.00187207488299532, 'mean_word_length': 2.5701559020044544, 'pattern_counts': {'":': 0, '<': 104, '<?xml version=': 0, '>': 104, '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': '4315274', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1093, 'n_words': 272}