<commit_before><% content_for :title do %>
    <% "OpenSplitTime: Stage/administer event - #{@event_stage.name}" %>
<% end %>
<div class="row header">
  <div class="col-xs-5">
    <%= render 'event_info', view_object: @event_stage, title: 'Admin' %>
  </div>
  <div id='<%= "event_#{@event_stage.id}" %>' class="col-xs-7 page-navigation">
    <div class="row">
      <%= link_to_enter_live_entry(@event_stage, @current_user) %>
      <%= render 'view_buttons', view_object: @event_stage %>
    </div>
    <div class="row">
      <% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
          <% if @current_user && @current_user.authorized_fully?(@event_stage.event) %>
              <%= link_to_toggle_live_entry(@event_stage) %>
              <%= link_to_stewards(@event_stage) %>
          <% end %>
          <%= link_to_edit_event(@event_stage) %>
          <% if @event_stage.started? %>
              <%= link_to_set_data_status(@event_stage) %>
              <% unless @event_stage.available_live %>
                  <%= link_to_set_dropped_attributes(@event_stage) %>
                  <%= link_to_ultrasignup_export(@event_stage) %>
              <% end %>
          <% end %>
          <%= link_to_start_ready_efforts(@event_stage) %>
          <%= link_to_podium(@event_stage) %>
          <% if @current_user && @current_user.authorized_fully?(@event_stage.event) %>
              <%= link_to_delete_event(@event_stage) %>
          <% end %>
      <% end %>
    </div>
  </div>
</div>

<% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
    <div class="article-actions">
      <div class="row">
        <div class="col-xs-4">
          <%= link_to 'Create split', new_split_path(event_id: @event_stage.id), class: 'btn btn-sm btn-success' %>
          <% unless @event_stage.course.simple? %>
              <%= link_to 'Associate or remove splits', splits_event_path, class: 'btn btn-sm btn-success' %>
          <% end %>
        </div>
        <div class="col-xs-4">
          <%= link_to 'Create effort', new_effort_path(event_id: @event_stage.id), class: 'btn btn-sm btn-success' %>
          <% if @event_stage.unreconciled_efforts? %>
              <%= link_to 'Reconcile with people', reconcile_event_path, class: 'btn btn-sm btn-success' %>
          <% end %>
          <% if @event_stage.efforts_count > 0 && @current_user.authorized_fully?(@event_stage.event) %>
              <%= link_to 'Delete all efforts', delete_all_efforts_event_path,
                          method: :delete,
                          data: {confirm: 'NOTE: This will delete all efforts and split times for this event. ' +
                              'This action cannot be undone. Are you sure you want to go ahead?'},
                          class: 'btn btn-sm btn-danger' %>
          <% end %>
        </div>
        <div class="col-xs-4">
          <div class="text-right">
            <% if @event_stage.available_live %>
                <strong><%= @event_stage.beacon_url ? 'Modify event locator beacon link: ' : 'Add link to event locator beacon:' %></strong>
                <a href="#" id="beacon-link" data-type="text" data-pk="1" data-placement="left" data-title="Paste a link to TrackLeaders or other event locator site here:"><%= "#{@event_stage.beacon_url}" %></a>
            <% end %>
          </div>
        </div>
      </div>
    </div>
<% end %>
<hr>
<div class="row">
  <div class="col-xs-4">
    <strong>Splits associated with event / on this course:</strong>
    <%= link_to @event_stage.event_splits_count, splits_event_path(@event_stage.event) %>
    / <%= link_to @event_stage.course_splits_count, course_path(@event_stage.course) %><br/>
    <% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
        <strong>Import Splits for this Event</strong>
        <%= form_tag({action: :import_splits}, multipart: true) do %>
            <%= file_field_tag :file, id: 'file-splits' %>
            <%= submit_tag 'Import Splits', id: 'submit-splits', disabled: true, class: 'btn btn-xs btn-success' %>
        <% end %>
    <% end %>
  </div>
  <div class="col-xs-4">
    <strong>Associated Efforts:</strong>
    <%= @event_stage.efforts_count %>
    <% if @event_stage.unreconciled_efforts? %>
        <%= "(#{@event_stage.unreconciled_efforts.size} unreconciled)" %>
    <% elsif @event_stage.efforts_count > 0 %>
        (All reconciled)
    <% end %>
    <br/>
    <% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
        <strong>Import Efforts With Time Data</strong>
        <%= form_tag({action: :import_efforts}, multipart: true) do %>
            <%= hidden_field_tag 'time_format', 'elapsed' %>
            <%= hidden_field_tag 'with_status', true %>
            <%= hidden_field_tag 'with_times', true %>
            <%= file_field_tag :file, id: 'file-efforts-with-times' %>
            <%= submit_tag 'Import efforts and elapsed times', id: 'submit-efforts-with-times', disabled: true, class: 'btn btn-xs btn-success' %>
        <% end %>
        <%= form_tag({action: :import_efforts}, multipart: true) do %>
            <%= hidden_field_tag 'time_format', 'military' %>
            <%= hidden_field_tag 'with_status', true %>
            <%= hidden_field_tag 'with_times', true %>
            <%= file_field_tag :file, id: 'file-efforts-with-military-times' %>
            <%= submit_tag 'Import efforts and military times', id: 'submit-efforts-with-military-times', disabled: true, class: 'btn btn-xs btn-success' %>
        <% end %>
    <% end %>
  </div>
  <div class="col-xs-4">
    <% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
        <strong>Import Efforts Without Time Data</strong>
        <%= form_tag({action: :import_efforts}, multipart: true) do %>
            <%= hidden_field_tag 'with_status', true %>
            <%= hidden_field_tag 'with_times', false %>
            <%= file_field_tag :file, id: 'file-efforts-without-times' %>
            <%= submit_tag 'Import efforts (no times)', id: 'submit-efforts-without-times', disabled: true, class: 'btn btn-xs btn-success' %>
        <% end %>
    <% end %>
  </div>
</div>
<div class="row header">
  <div class="col-xs-5 page-navigation-left">
    <% if @event_stage.prior_event_within_group %>
        <%= link_to "<< #{@event_stage.prior_event_within_group.name}",
                    stage_event_path(@event_stage.prior_event_within_group,
                                     view: @event_stage.view_text),
                    class: 'btn btn-sm btn-default' %>
    <% end %>
    <% if @event_stage.next_event_within_group %>
        <%= link_to "#{@event_stage.next_event_within_group.name} >>",
                    stage_event_path(@event_stage.next_event_within_group,
                                     view: @event_stage.view_text),
                    class: 'btn btn-sm btn-default' %>
    <% end %>
  </div>
  <div class="col-xs-7 page-navigation">
    <div class="row">
      <div class="btn-group">
        <%= link_to 'Splits',
                    stage_event_path(@event_stage, view: 'splits'),
                    disabled: @event_stage.view_text == 'splits',
                    class: 'btn btn-sm btn-primary' %><commit_msg>Change inter-group navigation buttons in event stage view to button group with current event disabled.<commit_after><% content_for :title do %>
    <% "OpenSplitTime: Stage/administer event - #{@event_stage.name}" %>
<% end %>
<div class="row header">
  <div class="col-xs-5">
    <%= render 'event_info', view_object: @event_stage, title: 'Admin' %>
  </div>
  <div id='<%= "event_#{@event_stage.id}" %>' class="col-xs-7 page-navigation">
    <div class="row">
      <%= link_to_enter_live_entry(@event_stage, @current_user) %>
      <%= render 'view_buttons', view_object: @event_stage %>
    </div>
    <div class="row">
      <% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
          <% if @current_user && @current_user.authorized_fully?(@event_stage.event) %>
              <%= link_to_toggle_live_entry(@event_stage) %>
              <%= link_to_stewards(@event_stage) %>
          <% end %>
          <%= link_to_edit_event(@event_stage) %>
          <% if @event_stage.started? %>
              <%= link_to_set_data_status(@event_stage) %>
              <% unless @event_stage.available_live %>
                  <%= link_to_set_dropped_attributes(@event_stage) %>
                  <%= link_to_ultrasignup_export(@event_stage) %>
              <% end %>
          <% end %>
          <%= link_to_start_ready_efforts(@event_stage) %>
          <%= link_to_podium(@event_stage) %>
          <% if @current_user && @current_user.authorized_fully?(@event_stage.event) %>
              <%= link_to_delete_event(@event_stage) %>
          <% end %>
      <% end %>
    </div>
  </div>
</div>

<% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
    <div class="article-actions">
      <div class="row">
        <div class="col-xs-4">
          <%= link_to 'Create split', new_split_path(event_id: @event_stage.id), class: 'btn btn-sm btn-success' %>
          <% unless @event_stage.course.simple? %>
              <%= link_to 'Associate or remove splits', splits_event_path, class: 'btn btn-sm btn-success' %>
          <% end %>
        </div>
        <div class="col-xs-4">
          <%= link_to 'Create effort', new_effort_path(event_id: @event_stage.id), class: 'btn btn-sm btn-success' %>
          <% if @event_stage.unreconciled_efforts? %>
              <%= link_to 'Reconcile with people', reconcile_event_path, class: 'btn btn-sm btn-success' %>
          <% end %>
          <% if @event_stage.efforts_count > 0 && @current_user.authorized_fully?(@event_stage.event) %>
              <%= link_to 'Delete all efforts', delete_all_efforts_event_path,
                          method: :delete,
                          data: {confirm: 'NOTE: This will delete all efforts and split times for this event. ' +
                              'This action cannot be undone. Are you sure you want to go ahead?'},
                          class: 'btn btn-sm btn-danger' %>
          <% end %>
        </div>
        <div class="col-xs-4">
          <div class="text-right">
            <% if @event_stage.available_live %>
                <strong><%= @event_stage.beacon_url ? 'Modify event locator beacon link: ' : 'Add link to event locator beacon:' %></strong>
                <a href="#" id="beacon-link" data-type="text" data-pk="1" data-placement="left" data-title="Paste a link to TrackLeaders or other event locator site here:"><%= "#{@event_stage.beacon_url}" %></a>
            <% end %>
          </div>
        </div>
      </div>
    </div>
<% end %>
<hr>
<div class="row">
  <div class="col-xs-4">
    <strong>Splits associated with event / on this course:</strong>
    <%= link_to @event_stage.event_splits_count, splits_event_path(@event_stage.event) %>
    / <%= link_to @event_stage.course_splits_count, course_path(@event_stage.course) %><br/>
    <% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
        <strong>Import Splits for this Event</strong>
        <%= form_tag({action: :import_splits}, multipart: true) do %>
            <%= file_field_tag :file, id: 'file-splits' %>
            <%= submit_tag 'Import Splits', id: 'submit-splits', disabled: true, class: 'btn btn-xs btn-success' %>
        <% end %>
    <% end %>
  </div>
  <div class="col-xs-4">
    <strong>Associated Efforts:</strong>
    <%= @event_stage.efforts_count %>
    <% if @event_stage.unreconciled_efforts? %>
        <%= "(#{@event_stage.unreconciled_efforts.size} unreconciled)" %>
    <% elsif @event_stage.efforts_count > 0 %>
        (All reconciled)
    <% end %>
    <br/>
    <% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
        <strong>Import Efforts With Time Data</strong>
        <%= form_tag({action: :import_efforts}, multipart: true) do %>
            <%= hidden_field_tag 'time_format', 'elapsed' %>
            <%= hidden_field_tag 'with_status', true %>
            <%= hidden_field_tag 'with_times', true %>
            <%= file_field_tag :file, id: 'file-efforts-with-times' %>
            <%= submit_tag 'Import efforts and elapsed times', id: 'submit-efforts-with-times', disabled: true, class: 'btn btn-xs btn-success' %>
        <% end %>
        <%= form_tag({action: :import_efforts}, multipart: true) do %>
            <%= hidden_field_tag 'time_format', 'military' %>
            <%= hidden_field_tag 'with_status', true %>
            <%= hidden_field_tag 'with_times', true %>
            <%= file_field_tag :file, id: 'file-efforts-with-military-times' %>
            <%= submit_tag 'Import efforts and military times', id: 'submit-efforts-with-military-times', disabled: true, class: 'btn btn-xs btn-success' %>
        <% end %>
    <% end %>
  </div>
  <div class="col-xs-4">
    <% if @current_user && @current_user.authorized_to_edit?(@event_stage.event) %>
        <strong>Import Efforts Without Time Data</strong>
        <%= form_tag({action: :import_efforts}, multipart: true) do %>
            <%= hidden_field_tag 'with_status', true %>
            <%= hidden_field_tag 'with_times', false %>
            <%= file_field_tag :file, id: 'file-efforts-without-times' %>
            <%= submit_tag 'Import efforts (no times)', id: 'submit-efforts-without-times', disabled: true, class: 'btn btn-xs btn-success' %>
        <% end %>
    <% end %>
  </div>
</div>
<div class="row header">
  <div class="col-xs-5 page-navigation-left">
    <% if @event_stage.ordered_events_within_group.many? %>
        <div class="btn-group">
          <% @event_stage.ordered_events_within_group.each do |event| %>
              <%= link_to "#{event.name}",
                          stage_event_path(event,
                                           view: @event_stage.view_text),
                          class: 'btn btn-sm btn-primary',
                          disabled: event == @event_stage.event %>
          <% end %>
        </div>
    <% end %>
  </div>
  <div class="col-xs-7 page-navigation">
    <div class="row">
      <div class="btn-group">
        <%= link_to 'Splits',
                    stage_event_path(@event_stage, view: 'splits'),
                    disabled: @event_stage.view_text == 'splits',
                    class: 'btn btn-sm btn-primary' %>
{'fraction_non_alphanumeric': 0.15991192458542627, 'fraction_numerical': 0.0017890318585288654, 'mean_word_length': 2.5106280193236716, 'pattern_counts': {'":': 0, '<': 286, '<?xml version=': 0, '>': 290, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5605548', 'n_tokens_mistral': 4929, 'n_tokens_neox': 4530, 'n_words': 904}