<%= form_for(@match) do |f| %> <% if @match.errors.any? %>

<%= pluralize(@match.errors.count, "error") %> prohibited this match from being saved:

<% end %>

Bout <%= @match.bout_number %>

<% if @show_next_bout_button && @next_match %> <%= link_to "Skip to Next Match for Mat #{@mat.name}", mat_path(@mat, bout_number: @next_match.bout_number), class: "btn btn-primary" %> <% end %>

Bracket Position: <%= @match.bracket_position %>

Name: <%= @wrestler1_name %>
School: <%= @wrestler1_school_name %>
Last Match: <%= @wrestler1_last_match && @wrestler1_last_match.finished_at ? time_ago_in_words(@wrestler1_last_match.finished_at) : "N/A" %>
Name: <%= @wrestler2_name %>
School: <%= @wrestler2_school_name %>
Last Match: <%= @wrestler2_last_match && @wrestler2_last_match.finished_at ? time_ago_in_words(@wrestler2_last_match.finished_at) : "N/A" %>
<%= @wrestler1_name %> Stats:
<%= f.text_area :w1_stat, cols: "30", rows: "10" %>
<%= @wrestler2_name %> Stats:
<%= f.text_area :w2_stat, cols: "30", rows: "10" %>
<%= @wrestler1_name %> Scoring
<%= @wrestler2_name %> Scoring
<%= @wrestler1_name %> Choice
<%= @wrestler2_name %> Choice
<%= @wrestler1_name %> Warnings
<%= @wrestler2_name %> Warnings
Match Options
<%= @wrestler1_name %> Timer Controls
Injury Time (90 second max): 0 sec

Blood Time (600 second max): 0 sec
<%= @wrestler2_name %> Timer Controls
Injury Time (90 second max): 0 sec

Blood Time (600 second max): 0 sec



Match Results


<%= f.label "Win Type" %>
<%= f.select(:win_type, Match::WIN_TYPES) %>

<%= f.label "Overtime Type" %> Leave blank if not overtime. For High School the 1st overtime is SV-1, second overtime is TB-1, third overtime is UTB.
<%= f.select(:overtime_type, Match::OVERTIME_TYPES) %>

<%= f.label "Winner" %> Please choose the winner
<%= f.collection_select :winner_id, @wrestlers, :id, :name_with_school, include_blank: true %>

<% if @match.finished && @match.finished == 1 %>
<%= f.label "Final Score" %> For decision, major, or tech fall put the score here in Number-Number format. If pin, put the accumulated pin time in the format MM:SS. If default, injury default, dq, bye, or forfeit, leave blank. Examples: 7-2, 17-2, 0:30, or 2:34.
<%= f.text_field :score %>
<% else %>
<%= f.label "Final Score" %>
The input will adjust based on the selected win type.
<%= f.hidden_field :score, id: "final-score-field" %>
<%= render 'matches/matchstats_variable_score_input' %> <% end %>
<%= f.hidden_field :finished, :value => 1 %> <%= f.hidden_field :round, :value => @match.round %>
<%= f.submit "Update Match", id: "update-match-btn", onclick: "return confirm('Is the name of the winner ' + document.getElementById('match_winner_id').options[document.getElementById('match_winner_id').selectedIndex].text + '?')", class: "btn btn-success" %>
<% end %> <%= render 'matches/matchstats_color_change' %>