<commit_before><% @page_title = "Admin: Events: #{@event.name}" %>

<%= error_messages_for "event" %>

<h2><%= link_to_parents(@event) %><%= @event.name %></h2>

<div class="column_grid_container">
  <div class="box-3">
    <%= render :partial => "parent", :object => @event %>
    <%= render :partial => "events", :object => @event %>
    <%= render :partial => "races", :object => @event %>
  </div>
  <div class="span-3 last">
     <% form_for(:event, 
                 @event, 
                 :url => @event.new_record? ? admin_events_path : admin_event_path(@event), 
                 :html => { :method => form_method_for(@event) }) do |f| -%>
      <div class="span-3 last no_top_margin">
        <%= f.hidden_field :parent_id %>
        <%= f.labelled_text_field :name %>

        <%= f.label :type %>
        <%= f.select(:type, [['Event', nil],
                             ['Single Day Event', 'SingleDayEvent'],
                             ['Multi Day Event', 'MultiDayEvent'], 
                             ['Series', 'Series'], 
                             ['Weekly Series', 'WeeklySeries']], {}, 
           { :title => "Event: placeholder hidden from schedule (combined TT results). 
    \nSingle day event: most events. 
    \nMulti day event: event over consecutive days (stage races, AVC). 
    \nSeries: weekend events with full BAR points (Cross Crusade). 
    \nWeekly series: weeknight, BAR points only for overall (PIR)" }) %><br/>

        <% case @event
           when SingleDayEvent -%>
          <%= f.label :date_1i, "Date" %>
          <%= f.date_select :date, :order => [:month, :day, :year] %>
        <% when MultiDayEvent -%>
          <%- if @event.start_date == @event.end_date -%>
            <%= f.labelled_text(:date, @event.start_date ? @event.start_date.strftime('%A, %B %d, %Y') : "") %>
          <%- else -%>
            <%= f.labelled_text(:date, (@event.start_date && @event.end_date) ? "#{@event.start_date.strftime('%a %m/%d/%Y')} to #{@event.end_date.strftime('%a %m/%d/%Y')}" : "") %>
          <%- end -%>
        <% else -%>
            <%= f.labelled_text(:date, @event.date ? @event.date.strftime('%A, %B %d, %Y') : "") %>
        <% end -%>

        <%= f.label :discipline %>
        <%= f.select :discipline, @disciplines.sort %><br/>

        <%= f.label :city, "City, State" %>
        <%= f.text_field :city, :class => "city_no_zip" %> <%= f.text_field :state, :class => "state_no_zip" %>

        <% if ASSOCIATION.show_events_velodrome? -%>
        <%= f.label :velodrome_id, "Velodrome" %>
        <%= f.select(:velodrome_id, 
                 Velodrome.find(:all).sort_by(&:name).collect {|v| [ v.name, v.id ] }, 
                 { :include_blank => true }) %>
        <% end -%>
        
        <%= f.labelled_text_field :time %>
        <%= f.labelled_check_box :cancelled %>
        <%= f.labelled_check_box :instructional %>
        <%= f.labelled_check_box :practice %>
      </div>

      <div class="span-3 last top_margin">
        <%= auto_complete f, :event, :promoter, admin_people_path %>
      </div>
       
      <div class="prepend-1 span-2 last" id="promoter_links">
        <%= link_to_function("Edit", nil, :class => "obvious", :id => "edit_promoter_link") do |page|
          page << "window.location.href = '/admin/people/' + $F('event_promoter_id') + '/edit?event_id=#{@event.id}'; return false;"
        end %>
        <%= link_to("New", new_admin_event_person_path(@event), :class => "obvious") %>
        <%= link_to_function("Remove", nil, :class => "obvious", :id => "remove_promoter_link") do |page|
          page[:event_promoter_id].set_value ""
          page[:edit_promoter_link].replace_html "None"
        end if @event.promoter %>
      </div>

      <div class="span-3 last top_margin">
        <%= auto_complete f, :event, :team, admin_teams_path, "Sponsoring Team" %>
      </div>
      
      <div class="prepend-1 span-2 last" id="team_links">
        <%= link_to_function("Remove", nil, :class => "obvious #{'invisible' unless @event.team}", :id => "remove_team_link") do |page|
          page[:event_team_id].set_value ""
          page[:edit_team_link].replace_html "None"
        end %>
      </div>

      <div class="span-3 last top_margin">
        <% if SANCTIONING_ORGANIZATIONS.size > 1 -%>
        <%= f.label :sanctioned_by %>
        <%= f.select :sanctioned_by, SANCTIONING_ORGANIZATIONS %>
        <%- end %>

        <% if ASSOCIATION.show_events_sanctioning_org_event_id? -%>
          <%= f.labelled_text_field :sanctioning_org_event_id, "Sanctioning Org Event ID" %>
        <% end -%>

        <%= f.label :number_issuer_id, "Number Issuer" %>
        <%= f.select(:number_issuer_id, NumberIssuer.find(:all, :order => 'name').collect {|i| [i.name, i.id]})  %>
        
        <%= f.labelled_check_box :atra_points_series, "ATRA Points Series" if ASSOCIATION.competitions.include?(:atra_points_series) %>
<commit_msg>Fix wrong link in JS<commit_after><% @page_title = "Admin: Events: #{@event.name}" %>

<%= error_messages_for "event" %>

<h2><%= link_to_parents(@event) %><%= @event.name %></h2>

<div class="column_grid_container">
  <div class="box-3">
    <%= render :partial => "parent", :object => @event %>
    <%= render :partial => "events", :object => @event %>
    <%= render :partial => "races", :object => @event %>
  </div>
  <div class="span-3 last">
     <% form_for(:event, 
                 @event, 
                 :url => @event.new_record? ? admin_events_path : admin_event_path(@event), 
                 :html => { :method => form_method_for(@event) }) do |f| -%>
      <div class="span-3 last no_top_margin">
        <%= f.hidden_field :parent_id %>
        <%= f.labelled_text_field :name %>

        <%= f.label :type %>
        <%= f.select(:type, [['Event', nil],
                             ['Single Day Event', 'SingleDayEvent'],
                             ['Multi Day Event', 'MultiDayEvent'], 
                             ['Series', 'Series'], 
                             ['Weekly Series', 'WeeklySeries']], {}, 
           { :title => "Event: placeholder hidden from schedule (combined TT results). 
    \nSingle day event: most events. 
    \nMulti day event: event over consecutive days (stage races, AVC). 
    \nSeries: weekend events with full BAR points (Cross Crusade). 
    \nWeekly series: weeknight, BAR points only for overall (PIR)" }) %><br/>

        <% case @event
           when SingleDayEvent -%>
          <%= f.label :date_1i, "Date" %>
          <%= f.date_select :date, :order => [:month, :day, :year] %>
        <% when MultiDayEvent -%>
          <%- if @event.start_date == @event.end_date -%>
            <%= f.labelled_text(:date, @event.start_date ? @event.start_date.strftime('%A, %B %d, %Y') : "") %>
          <%- else -%>
            <%= f.labelled_text(:date, (@event.start_date && @event.end_date) ? "#{@event.start_date.strftime('%a %m/%d/%Y')} to #{@event.end_date.strftime('%a %m/%d/%Y')}" : "") %>
          <%- end -%>
        <% else -%>
            <%= f.labelled_text(:date, @event.date ? @event.date.strftime('%A, %B %d, %Y') : "") %>
        <% end -%>

        <%= f.label :discipline %>
        <%= f.select :discipline, @disciplines.sort %><br/>

        <%= f.label :city, "City, State" %>
        <%= f.text_field :city, :class => "city_no_zip" %> <%= f.text_field :state, :class => "state_no_zip" %>

        <% if ASSOCIATION.show_events_velodrome? -%>
        <%= f.label :velodrome_id, "Velodrome" %>
        <%= f.select(:velodrome_id, 
                 Velodrome.find(:all).sort_by(&:name).collect {|v| [ v.name, v.id ] }, 
                 { :include_blank => true }) %>
        <% end -%>
        
        <%= f.labelled_text_field :time %>
        <%= f.labelled_check_box :cancelled %>
        <%= f.labelled_check_box :instructional %>
        <%= f.labelled_check_box :practice %>
      </div>

      <div class="span-3 last top_margin">
        <%= auto_complete f, :event, :promoter, admin_people_path %>
      </div>
       
      <div class="prepend-1 span-2 last" id="promoter_links">
        <%= link_to_function("Edit", nil, :class => "obvious", :id => "edit_promoter_link") do |page|
          page << "window.location.href = '/admin/people/' + $F('event_promoter_id') + '/edit?event_id=#{@event.id}'; return false;"
        end %>
        <%= link_to("New", new_admin_event_person_path(@event), :class => "obvious") %>
        <%= link_to_function("Remove", nil, :class => "obvious", :id => "remove_promoter_link") do |page|
          page[:event_promoter_id].set_value ""
          page[:promoter_auto_complete_link].replace_html "None"
        end if @event.promoter %>
      </div>

      <div class="span-3 last top_margin">
        <%= auto_complete f, :event, :team, admin_teams_path, "Sponsoring Team" %>
      </div>
      
      <div class="prepend-1 span-2 last" id="team_links">
        <%= link_to_function("Remove", nil, :class => "obvious #{'invisible' unless @event.team}", :id => "remove_team_link") do |page|
          page[:event_team_id].set_value ""
          page[:team_auto_complete_link].replace_html "None"
        end %>
      </div>

      <div class="span-3 last top_margin">
        <% if SANCTIONING_ORGANIZATIONS.size > 1 -%>
        <%= f.label :sanctioned_by %>
        <%= f.select :sanctioned_by, SANCTIONING_ORGANIZATIONS %>
        <%- end %>

        <% if ASSOCIATION.show_events_sanctioning_org_event_id? -%>
          <%= f.labelled_text_field :sanctioning_org_event_id, "Sanctioning Org Event ID" %>
        <% end -%>

        <%= f.label :number_issuer_id, "Number Issuer" %>
        <%= f.select(:number_issuer_id, NumberIssuer.find(:all, :order => 'name').collect {|i| [i.name, i.id]})  %>
        
        <%= f.labelled_check_box :atra_points_series, "ATRA Points Series" if ASSOCIATION.competitions.include?(:atra_points_series) %>

{'fraction_non_alphanumeric': 0.18627154520713637, 'fraction_numerical': 0.0028222961395020663, 'mean_word_length': 2.4680181754631247, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 0, '>': 193, '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': '4106319', 'n_tokens_mistral': 3573, 'n_tokens_neox': 3296, 'n_words': 642}