<%= 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", data: { match_data_target: "w1Stat" } %>
<%= @wrestler2_name %> Stats:
<%= f.text_area :w2_stat, cols: "30", rows: "10", data: { match_data_target: "w2Stat" } %>
<%= @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, { include_blank: false }, { data: { match_score_target: "winType", action: "change->match-score#winTypeChanged" } } %>

<%= 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 }, { data: { match_score_target: "winnerSelect", action: "change->match-score#winnerChanged" } } %>

<%= f.label "Final Score" %>
The input will adjust based on the selected win type.
<%= f.hidden_field :score, id: "final-score-field", data: { match_score_target: "finalScoreField" } %>
<%= f.submit "Update Match", id: "update-match-btn", data: { match_score_target: "submitButton", action: "click->match-score#confirmWinner" }, class: "btn btn-success" %>

<%= f.hidden_field :finished, :value => 1 %> <%= f.hidden_field :round, :value => @match.round %> <% end %>