1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-07 23:17:25 +00:00

A ton of stuff was done to finalize the app for use

This commit is contained in:
Jacob Cody Wimer
2014-01-25 05:28:42 -05:00
parent 7f8718af35
commit c5a7bc3815
45 changed files with 889 additions and 22 deletions

View File

@@ -7,7 +7,8 @@
<li><%= link_to "Home", root_path %></li>
<% if @tournament %>
<li><%= link_to "Brackets" , "/static_pages/weights?tournament=#{@tournament.id}" %></li>
<li><%= link_to "Bout Board" , '#' %></li>
<li><%= link_to "Upcoming Matches" , "/static_pages/up_matches?tournament=#{@tournament.id}" %></li>
<li><%= link_to "Results" , "/static_pages/results?tournament=#{@tournament.id}" %></li>
<% end %>
<% if user_signed_in? %>
<li><%= link_to "Log Out", destroy_user_session_path, method: :delete %></li>

View File

@@ -0,0 +1,36 @@
<%= form_for(@match) do |f| %>
<% if @match.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@match.errors.count, "error") %> prohibited this match from being saved:</h2>
<ul>
<% @match.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label "Win Type" %><br>
<%= f.select(:win_type, Match::WIN_TYPES) %>
</div>
<div class="field">
<%= f.label "Winner" %> Please put in the id of the winner<br>
<%= @w1.name %> ID: <%= @w1.id %><br>
<%= @w2.name %> ID: <%= @w2.id %><br>
<%= f.number_field :winner_id %>
</div>
<div class="field">
<%= f.label "Score" %> Also put pin time here if applicable. If default or forfeit, leave blank<br>
<%= f.text_field :score %>
</div>
<%= f.hidden_field :finished, :value => 1 %>
<%= f.hidden_field :round, :value => @match.round %>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

@@ -1,6 +1,5 @@
<h1>Editing match</h1>
<h1><%= @w1.name %> VS. <%= @w2.name %></h1>
<%= render 'form' %>
<%= render 'edit_form' %>
<%= link_to 'Show', @match %> |
<%= link_to 'Back', matches_path %>
<%= link_to 'Back', root_path %>

View File

@@ -0,0 +1,31 @@
<%= form_for(@mat) do |f| %>
<% if @mat.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@mat.errors.count, "error") %> prohibited this mat from being saved:</h2>
<ul>
<% @mat.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br>
<%= f.text_field :name %>
</div>
<% if @tournament_field %>
<%= f.hidden_field :tournament_id, :value => @tournament_field %>
<% else %>
<div class="field">
<%= f.label 'Tournament' %><br>
<%= f.collection_select :tournament_id, Tournament.all, :id, :name %>
</div>
<% end %>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing mat</h1>
<%= render 'form' %>
<%= link_to 'Show', @mat %> |
<%= link_to 'Back', mats_path %>

View File

@@ -0,0 +1,29 @@
<h1>Listing mats</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Tournament</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @mats.each do |mat| %>
<tr>
<td><%= mat.name %></td>
<td><%= mat.tournament_id %></td>
<td><%= link_to 'Show', mat %></td>
<td><%= link_to 'Edit', edit_mat_path(mat) %></td>
<td><%= link_to 'Destroy', mat, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Mat', new_mat_path %>

View File

@@ -0,0 +1,4 @@
json.array!(@mats) do |mat|
json.extract! mat, :id, :name, :tournament_id
json.url mat_url(mat, format: :json)
end

View File

@@ -0,0 +1,5 @@
<h1>New mat</h1>
<%= render 'form' %>
<%= link_to 'Back', mats_path %>

View File

@@ -0,0 +1,13 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Name:</strong>
<%= @mat.name %>
</p>
<p>
<strong>Tournament:</strong>
<%= @mat.tournament_id %>
</p>
<%= link_to 'Edit', edit_mat_path(@mat) %> |

View File

@@ -0,0 +1 @@
json.extract! @mat, :id, :name, :tournament_id, :created_at, :updated_at

View File

@@ -1,4 +1,4 @@
<h1><%= @weight.max %> lbs Bracket</h1>
<h3>Pool 1</h3>
<table class="table table-striped table-bordered">
<thead>

View File

@@ -1,4 +1,3 @@
<h1><%= @weight.max %> lbs Bracket</h1>
<h3>Pool 1</h3>
<table class="table table-striped table-bordered">
<thead>

View File

@@ -1,4 +1,3 @@
<h1><%= @weight.max %> lbs Bracket</h1>
<h3>Pool 1</h3>
<table class="table table-striped table-bordered">
<thead>

View File

@@ -1,4 +1,3 @@
<h1><%= @weight.max %> lbs Bracket</h1>
<h3>Pool 1</h3>
<table class="table table-striped table-bordered">
<thead>

View File

@@ -1,6 +1,7 @@
<%= link_to "Back to #{@tournament.name} weights", "/static_pages/weights?tournament=#{@tournament.id}" %>
<br>
<br>
<h1><%= @weight.max %> lbs Bracket <%= Mat.find(@weight.mat_id).name %></h1>
<% if @bracket_size == 10 %>
<%= render 'man10' %>
<% elsif @bracket_size == 9 %>

View File

@@ -0,0 +1,3 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %>
<br>
Done!

View File

@@ -0,0 +1,105 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %>
<br>
<br>
<h3>Round 1</h3>
<% @matches.each do |m| %>
<% if m.round == 1 %>
<% if Wrestler.find(m.g_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.g_id) %>
<% else %>
<% @loser = Wrestler.find(m.g_id) %>
<% end %>
<% if Wrestler.find(m.r_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.r_id) %>
<% else %>
<% @loser = Wrestler.find(m.r_id) %>
<% end %>
<%= @winner.weight.max %> Lbs <%= @winner.name %> <%= m.win_type %> <%= m.score %> <%= @loser.name %>
<br>
<% end %>
<% end %>
<h3>Round 2</h3>
<% @matches.each do |m| %>
<% if m.round == 2 %>
<% if Wrestler.find(m.g_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.g_id) %>
<% else %>
<% @loser = Wrestler.find(m.g_id) %>
<% end %>
<% if Wrestler.find(m.r_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.r_id) %>
<% else %>
<% @loser = Wrestler.find(m.r_id) %>
<% end %>
<%= @winner.weight.max %> Lbs <%= @winner.name %> <%= m.win_type %> <%= m.score %> <%= @loser.name %>
<br>
<% end %>
<% end %>
<h3>Round 3</h3>
<% @matches.each do |m| %>
<% if m.round == 3 %>
<% if Wrestler.find(m.g_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.g_id) %>
<% else %>
<% @loser = Wrestler.find(m.g_id) %>
<% end %>
<% if Wrestler.find(m.r_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.r_id) %>
<% else %>
<% @loser = Wrestler.find(m.r_id) %>
<% end %>
<%= @winner.weight.max %> Lbs <%= @winner.name %> <%= m.win_type %> <%= m.score %> <%= @loser.name %>
<br>
<% end %>
<% end %>
<h3>Round 4</h3>
<% @matches.each do |m| %>
<% if m.round == 4 %>
<% if Wrestler.find(m.g_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.g_id) %>
<% else %>
<% @loser = Wrestler.find(m.g_id) %>
<% end %>
<% if Wrestler.find(m.r_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.r_id) %>
<% else %>
<% @loser = Wrestler.find(m.r_id) %>
<% end %>
<%= @winner.weight.max %> Lbs <%= @winner.name %> <%= m.win_type %> <%= m.score %> <%= @loser.name %>
<br>
<% end %>
<% end %>
<h3>Round 5</h3>
<% @matches.each do |m| %>
<% if m.round == 5 %>
<% if Wrestler.find(m.g_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.g_id) %>
<% else %>
<% @loser = Wrestler.find(m.g_id) %>
<% end %>
<% if Wrestler.find(m.r_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.r_id) %>
<% else %>
<% @loser = Wrestler.find(m.r_id) %>
<% end %>
<%= @winner.weight.max %> Lbs <%= @winner.name %> <%= m.win_type %> <%= m.score %> <%= @loser.name %>
<br>
<% end %>
<% end %>
<h3>Round 6</h3>
<% @matches.each do |m| %>
<% if m.round == 6 %>
<% if Wrestler.find(m.g_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.g_id) %>
<% else %>
<% @loser = Wrestler.find(m.g_id) %>
<% end %>
<% if Wrestler.find(m.r_id).id == m.winner_id %>
<% @winner = Wrestler.find(m.r_id) %>
<% else %>
<% @loser = Wrestler.find(m.r_id) %>
<% end %>
<%= @winner.weight.max %> Lbs <%= @winner.name %> <%= m.win_type %> <%= m.score %> <%= @loser.name %>
<br>
<% end %>
<% end %>

View File

@@ -0,0 +1,45 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %>
<br>
<br>
<h3>Round 1</h3>
<% @matches.each do |m| %>
<% if m.round == 1 %>
<%= Wrestler.find(m.r_id).weight.max %> Lbs <%= Wrestler.find(m.r_id).name %> vs. <%= Wrestler.find(m.g_id).name %> <%= link_to "Control Match", "/matches/#{m.id}/edit" %>
<br>
<% end %>
<% end %>
<h3>Round 2</h3>
<% @matches.each do |m| %>
<% if m.round == 2 %>
<%= Wrestler.find(m.r_id).weight.max %> Lbs <%= Wrestler.find(m.r_id).name %> vs. <%= Wrestler.find(m.g_id).name %> <%= link_to "Control Match", "/matches/#{m.id}/edit" %>
<br>
<% end %>
<% end %>
<h3>Round 3</h3>
<% @matches.each do |m| %>
<% if m.round == 3 %>
<%= Wrestler.find(m.r_id).weight.max %> Lbs <%= Wrestler.find(m.r_id).name %> vs. <%= Wrestler.find(m.g_id).name %> <%= link_to "Control Match", "/matches/#{m.id}/edit" %>
<br>
<% end %>
<% end %>
<h3>Round 4</h3>
<% @matches.each do |m| %>
<% if m.round == 4 %>
<%= Wrestler.find(m.r_id).weight.max %> Lbs <%= Wrestler.find(m.r_id).name %> vs. <%= Wrestler.find(m.g_id).name %> <%= link_to "Control Match", "/matches/#{m.id}/edit" %>
<br>
<% end %>
<% end %>
<h3>Round 5</h3>
<% @matches.each do |m| %>
<% if m.round == 5 %>
<%= Wrestler.find(m.r_id).weight.max %> Lbs <%= Wrestler.find(m.r_id).name %> vs. <%= Wrestler.find(m.g_id).name %> <%= link_to "Control Match", "/matches/#{m.id}/edit" %>
<br>
<% end %>
<% end %>
<h3>Round 6</h3>
<% @matches.each do |m| %>
<% if m.round == 6 %>
<%= Wrestler.find(m.r_id).weight.max %> Lbs <%= @weight_class %> LBS <%= Wrestler.find(m.r_id).name %> vs. <%= Wrestler.find(m.g_id).name %> <%= link_to "Control Match", "/matches/#{m.id}/edit" %>
<br>
<% end %>
<% end %>

View File

@@ -22,10 +22,13 @@
<strong>Director email:</strong>
<%= @tournament.director_email %>
</p>
<br>
<br>
<% if user_signed_in? %>
<%= link_to "New #{@tournament.name} School" , "/schools/new?tournament=#{@tournament.id}" %>
<br>
BE CAREFUL <%= link_to "Generate Matches" , "/static_pages/generate_matches?tournament=#{@tournament.id}" %>
<% end %>
<br>
<br>
@@ -86,5 +89,35 @@
</table>
<br>
<br>
<% if user_signed_in? %>
<%= link_to "New #{@tournament.name} Mat" , "/mats/new?tournament=#{@tournament.id}" %>
<% end %>
<br>
<br>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
<% @mats.each do |mat| %>
<tr>
<td><%= mat.name %></td>
<td>
<% if user_signed_in? %>
<%= link_to 'Destroy', mat, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

@@ -24,6 +24,13 @@
<%= f.collection_select :tournament_id, Tournament.all, :id, :name %>
</div>
<% end %>
<div class="field">
<%= f.label 'Assigned Mat' %><br>
<%= f.collection_select :mat_id, @mats, :id, :name %>
</div>
<div class="actions">
<%= f.submit %>