<commit_before><% @page_title = 'Admin: Racers' %>

<%= render "shared/admin/tabs" %>

<div style="margin-top: 16px; margin-bottom: 16px;">
<%= form_tag({}, {:method => 'get', :id => 'search_form'}) %>
	<span class="field_label">Name:</span> <%= text_field_tag 'name', @name, :size => 30 %>

	<%# Nasty code required to show consistent messages with and without AJAX. At least it could be in a helper. %>
	<p class="message" id="message">
		<%= image_tag('/images/icons/warn.gif', :height => 11, :width => 11, :id => 'warn_icon') %>
		<span id='warn_text'><%= flash[:warn] %></span>
		<%= image_tag('/images/icons/confirmed.gif', :height => 11, :width => 11, :id => 'message_icon') %>
		<span id='message_text'><%= flash[:notice] %></span>
	</p>
	<%= update_page_tag {|page| page.hide('message_icon')} unless flash[:notice] -%>
	<%= update_page_tag {|page| page.hide('warn_icon')} unless flash[:warn] -%>
</form>
</div>

<table>
	<tr>
		<td>
			<table class="base" style="margin-bottom: 2px;">
		        <tr>
					<th></th>
			        <th style="width: 200px;">Name</th>
		            <th>Team</th>
		            <th>Aliases</th>
		            <th align="right">Road</th>
		            <th align="right">MTB</th>
		            <th align="right">DH</th>
		            <th align="right">Cross</th>
					<th align="center">Member</th>
					<th></th>
					<th></th>
		        </tr>
				<%= render :partial => "racer", :collection => @racers %>
				<% if @racers.empty? %>
				<tr valign="top">
					<%- if @name.blank? -%>
					<td colspan="11" width="200" class="not_found">Enter part of a racer's name</td>
					<%- else -%>
					<td colspan="11" width="200" class="not_found">No racers found</td>
					<%- end -%>
				</tr>
				<% end %>
				<tr valign="top" id="new_row">
					<td colspan="11"></td>
				</tr>
			</table>
			<div><%= link_to(image_tag('/images/buttons/add.gif'), :action => 'new') %></div>
			
			<%= render :partial => 'import_export' %>

			<div class="tabs" style="margin-top: 24px;">
				<%= 
					link_to('Print Cards', :action => 'cards') 
				%> | <%= 
					link_to('Print Mailing Labels', :action => 'mailing_labels') 
				%>
			</div>
		</td>
	</tr>
</table>

<%- for racer in @racers -%>
	<%= draggable_element("racer_#{racer.id}", :revert => true) %>
	<%= drop_receiving_element("racer_#{racer.id}", 
		:url => { :action => "merge", :target_id => racer.id }, 
		:loading => "new Effect.Fade(element.id + '_row')") %>
	<%= drop_receiving_element("name_#{racer.id}", 
		:url => { :action => "merge", :target_id => racer.id }, 
		:onHover => "new Effect.Fade(element.id + '_row')",
		:loading => "new Effect.Fade(element.id + '_row')") %>
<%- end -%><commit_msg>De-tabbed<commit_after><% @page_title = 'Admin: Racers' %>

<%= render "shared/admin/tabs" %>

<div style="margin-top: 16px; margin-bottom: 16px;">
<%= form_tag({}, {:method => 'get', :id => 'search_form'}) %>
  <span class="field_label">Name:</span> <%= text_field_tag 'name', @name, :size => 30 %>

  <%# Nasty code required to show consistent messages with and without AJAX. At least it could be in a helper. %>
  <p class="message" id="message">
    <%= image_tag('/images/icons/warn.gif', :height => 11, :width => 11, :id => 'warn_icon') %>
    <span id='warn_text'><%= flash[:warn] %></span>
    <%= image_tag('/images/icons/confirmed.gif', :height => 11, :width => 11, :id => 'message_icon') %>
    <span id='message_text'><%= flash[:notice] %></span>
  </p>
  <%= update_page_tag {|page| page.hide('message_icon')} unless flash[:notice] -%>
  <%= update_page_tag {|page| page.hide('warn_icon')} unless flash[:warn] -%>
</form>
</div>

<table>
  <tr>
    <td>
      <table class="base" style="margin-bottom: 2px;">
        <tr>
          <th></th>
          <th style="width: 200px;">Name</th>
          <th>Team</th>
          <th>Aliases</th>
          <th align="right">Road</th>
          <th align="right">MTB</th>
          <th align="right">DH</th>
          <th align="right">Cross</th>
          <th align="center">Member</th>
          <th></th>
          <th></th>
        </tr>
        <%= render :partial => "racer", :collection => @racers %>
        <% if @racers.empty? %>
        <tr valign="top">
          <%- if @name.blank? -%>
          <td colspan="11" width="200" class="not_found">Enter part of a racer's name</td>
          <%- else -%>
          <td colspan="11" width="200" class="not_found">No racers found</td>
          <%- end -%>
        </tr>
        <% end %>
        <tr valign="top" id="new_row">
          <td colspan="11"></td>
        </tr>
      </table>
      <div><%= link_to(image_tag('/images/buttons/add.gif'), :action => 'new') %></div>
      
      <%= render :partial => 'import_export' %>

      <div class="tabs" style="margin-top: 24px;">
        <%= 
          link_to('Print Cards', :action => 'cards') 
        %> | <%= 
          link_to('Print Mailing Labels', :action => 'mailing_labels') 
        %>
      </div>
    </td>
  </tr>
</table>

<%- for racer in @racers -%>
  <%= draggable_element("racer_#{racer.id}", :revert => true) %>
  <%= drop_receiving_element("racer_#{racer.id}", 
    :url => { :action => "merge", :target_id => racer.id }, 
    :loading => "new Effect.Fade(element.id + '_row')") %>
  <%= drop_receiving_element("name_#{racer.id}", 
    :url => { :action => "merge", :target_id => racer.id }, 
    :onHover => "new Effect.Fade(element.id + '_row')",
    :loading => "new Effect.Fade(element.id + '_row')") %>
<%- end -%>
{'fraction_non_alphanumeric': 0.23421292083712467, 'fraction_numerical': 0.01164695177434031, 'mean_word_length': 2.911743772241993, 'pattern_counts': {'":': 0, '<': 169, '<?xml version=': 0, '>': 219, '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': '1993553', 'n_tokens_mistral': 2285, 'n_tokens_neox': 1977, 'n_words': 402}