1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-06 06:28:33 +00:00

Refactored names of methods and some db column

This commit is contained in:
2018-11-13 14:14:48 +00:00
parent 93be525832
commit d67a8f2b42
44 changed files with 350 additions and 350 deletions

View File

@@ -20,7 +20,7 @@ json.cache! ["api_tournament", @tournament] do
json.original_seed wrestler.original_seed
json.criteria wrestler.criteria
json.extra wrestler.extra
json.seasonWinPercentage wrestler.seasonWinPercentage
json.season_win_percentage wrestler.season_win_percentage
json.season_win wrestler.season_win
json.season_loss wrestler.season_loss
end
@@ -28,7 +28,7 @@ json.cache! ["api_tournament", @tournament] do
json.mats @tournament.mats do |mat|
json.name mat.name
json.unfinishedMatches mat.unfinishedMatches do |match|
json.unfinished_matches mat.unfinished_matches do |match|
json.bout_number match.bout_number
json.w1_name match.w1_name
json.w2_name match.w2_name

View File

@@ -17,11 +17,11 @@
<th><%= @w1.name %> <select id="w1-color" onchange="changeW1Color(this)">
<option value="green">Green</option>
<option value="red">Red</option>
</select><br>Last Match: <%= if @w1.lastMatch != nil then time_ago_in_words(@w1.lastMatch.updated_at) end%></th>
</select><br>Last Match: <%= if @w1.last_match != nil then time_ago_in_words(@w1.last_match.updated_at) end%></th>
<th><%= @w2.name %> <select id="w2-color" onchange="changeW2Color(this)">
<option value="red">Red</option>
<option value="green">Green</option>
</select><br>Last Match: <%= if @w2.lastMatch != nil then time_ago_in_words(@w2.lastMatch.updated_at) end%></th>
</select><br>Last Match: <%= if @w2.last_match != nil then time_ago_in_words(@w2.last_match.updated_at) end%></th>
</tr>
</thead>
<tbody>

View File

@@ -17,11 +17,11 @@
<th><%= @w1.name %> - <%= @w1.school.name %> <select id="w1-color" onchange="changeW1Color(this)">
<option value="green">Green</option>
<option value="red">Red</option>
</select><br>Last Match: <%= if @w1.lastMatch != nil then time_ago_in_words(@w1.lastMatch.updated_at) end%></th>
</select><br>Last Match: <%= if @w1.last_match != nil then time_ago_in_words(@w1.last_match.updated_at) end%></th>
<th><%= @w2.name %> - <%= @w2.school.name %> <select id="w2-color" onchange="changeW2Color(this)">
<option value="red">Red</option>
<option value="green">Green</option>
</select><br>Last Match: <%= if @w2.lastMatch != nil then time_ago_in_words(@w2.lastMatch.updated_at) end%></th>
</select><br>Last Match: <%= if @w2.last_match != nil then time_ago_in_words(@w2.last_match.updated_at) end%></th>
</tr>
</thead>
<tbody>

View File

@@ -13,7 +13,7 @@
<p>
<strong>Team Points Deducted:</strong>
<%= @school.totalDeductedPoints %>
<%= @school.total_points_deducted %>
</p>
<p>
<strong>Score:</strong>
@@ -57,11 +57,11 @@
<td>
<%= wrestler.original_seed %>
</td>
<td><%= wrestler.totalTeamPoints - wrestler.totalDeductedPoints %></td>
<td><%= wrestler.total_team_points - wrestler.total_points_deducted %></td>
<td><% if wrestler.extra? == true %>
Yes
<% end %></td>
<td><%= wrestler.nextMatchBoutNumber %> <%= wrestler.nextMatchMatName %></td>
<td><%= wrestler.next_match_bout_number %> <%= wrestler.next_match_mat_name %></td>
<td>
<%= link_to 'Show', wrestler , :class=>"btn btn-default btn-sm" %>
<% if can? :manage, wrestler.school %>

View File

@@ -18,13 +18,13 @@
</thead>
<tbody>
<% @school.wrestlers.each do |wrestler| %>
<% wrestler.allMatches.each do |m| %>
<% wrestler.all_matches.each do |m| %>
<tr>
<td> <%= wrestler.name %>
<td><%= m.bout_number %></td>
<td><%= m.bracket_position %></td>
<td><%= m.list_w1_stats %><br><%= m.list_w2_stats %></td>
<td><%= wrestler.resultByBout(m.bout_number) %>
<td><%= wrestler.result_by_bout(m.bout_number) %>
</tr>
<% end %>
<% end %>

View File

@@ -5,7 +5,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -17,7 +17,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -28,7 +28,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -37,7 +37,7 @@
<ul class="round round-4">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %> <span></span></li>
<li class="bracket-winner"><%= match.winner_name %> <span></span></li>
1st
<li>&nbsp;</li>
@@ -51,7 +51,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -60,7 +60,7 @@
<ul class="round round-2">
<li>&nbsp;</li>
<li class="bracket-winner"> <%= match.winnerName %><span></span></li>
<li class="bracket-winner"> <%= match.winner_name %><span></span></li>
3rd
<li>&nbsp;</li>
@@ -74,7 +74,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -86,7 +86,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -95,7 +95,7 @@
<ul class="round round-3">
<li>&nbsp;</li>
<li class="bracket-winner"> <%= match.winnerName %><span></span></li>
<li class="bracket-winner"> <%= match.winner_name %><span></span></li>
5th
<li>&nbsp;</li>
@@ -109,7 +109,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -118,7 +118,7 @@
<ul class="round round-2">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %> <span></span></li>
<li class="bracket-winner"><%= match.winner_name %> <span></span></li>
7th
<li>&nbsp;</li>

View File

@@ -5,7 +5,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -17,7 +17,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -26,7 +26,7 @@
<ul class="round round-3">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %><span></span></li>
<li class="bracket-winner"><%= match.winner_name %><span></span></li>
1st
<li>&nbsp;</li>
@@ -41,7 +41,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -50,7 +50,7 @@
<ul class="round round-2">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %><span></span></li>
<li class="bracket-winner"><%= match.winner_name %><span></span></li>
3rd
<li>&nbsp;</li>
@@ -66,7 +66,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -78,7 +78,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -87,7 +87,7 @@
<ul class="round round-3">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %><span></span></li>
<li class="bracket-winner"><%= match.winner_name %><span></span></li>
5th
<li>&nbsp;</li>
@@ -101,7 +101,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -110,7 +110,7 @@
<ul class="round round-2">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %><span></span></li>
<li class="bracket-winner"><%= match.winner_name %><span></span></li>
7th
<li>&nbsp;</li>

View File

@@ -1,8 +1,8 @@
<h5>Results</h5>
<br>
<ol>
<li><%= @weight.poolOrder(1).first.name %></li>
<li><%= @weight.poolOrder(1).second.name %></li>
<li><%= @weight.poolOrder(1).third.name %></li>
<li><%= @weight.poolOrder(1).fourth.name %></li>
<li><%= @weight.pool_placement_order(1).first.name %></li>
<li><%= @weight.pool_placement_order(1).second.name %></li>
<li><%= @weight.pool_placement_order(1).third.name %></li>
<li><%= @weight.pool_placement_order(1).fourth.name %></li>
</ol>

View File

@@ -21,7 +21,7 @@
<% @round = 1 %>
<% until @matches.select{|m| m.round == @round}.blank? %>
<% if @round <= @pools %>
<td><%= w.boutByRound(@round) %><br><%= w.resultByBout(w.boutByRound(@round)) %></td>
<td><%= w.bout_by_round(@round) %><br><%= w.result_by_bout(w.bout_by_round(@round)) %></td>
<% end %>
<% @round = @round + 1 %>
<% end %>

View File

@@ -5,7 +5,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -14,7 +14,7 @@
<ul class="round round-2">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %><span></span></li>
<li class="bracket-winner"><%= match.winner_name %><span></span></li>
1st
<li>&nbsp;</li>
@@ -28,7 +28,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -37,7 +37,7 @@
<ul class="round round-2">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %> <span></span></li>
<li class="bracket-winner"><%= match.winner_name %> <span></span></li>
3rd
<li>&nbsp;</li>

View File

@@ -5,7 +5,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -17,7 +17,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -26,7 +26,7 @@
<ul class="round round-3">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %><span></span></li>
<li class="bracket-winner"><%= match.winner_name %><span></span></li>
1st
<li>&nbsp;</li>
@@ -41,7 +41,7 @@
<li>&nbsp;</li>
<li class="game game-top "><%= match.w1_name %> <span></span></li>
<li><%= match.bout_number %> <%= match.bracketScore %>&nbsp;</li>
<li><%= match.bout_number %> <%= match.bracket_score_string %>&nbsp;</li>
<li class="game game-bottom "><%= match.w2_name %><span></span></li>
<li>&nbsp;</li>
@@ -50,7 +50,7 @@
<ul class="round round-2">
<li>&nbsp;</li>
<li class="bracket-winner"><%= match.winnerName %><span></span></li>
<li class="bracket-winner"><%= match.winner_name %><span></span></li>
3rd
<li>&nbsp;</li>

View File

@@ -74,7 +74,7 @@ li:first-child,li:last-child {
<% @weight = w %>
<% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %>
<% @wrestlers = Wrestler.where(weight_id: @weight.id) %>
<% @pools = w.poolRounds(@matches) %>
<% @pools = w.pool_rounds(@matches) %>
<%= render 'pool' %>
</td>

View File

@@ -65,7 +65,7 @@ li:first-child,li:last-child {
<td valign="top" style="padding: 10px;">
<% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %>
<% @wrestlers = Wrestler.where(weight_id: @weight.id) %>
<% @pools = @weight.poolRounds(@matches) %>
<% @pools = @weight.pool_rounds(@matches) %>
<%= render 'pool' %>
</td>

View File

@@ -1,3 +1,3 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
<br><br>
<%= @tournament.tournamentMatchGenerationError %>
<%= @tournament.match_generation_error %>

View File

@@ -17,7 +17,7 @@
<% @schools.each do |school| %>
<tr>
<td><%= school.name %></td>
<td><%= school.pageScore %></td>
<td><%= school.page_score_string %></td>
</tr>
<% end %>
</tbody>

View File

@@ -29,10 +29,10 @@
<% @mats.each.map do |m| %>
<tr>
<td><%= m.name %></td>
<td><% if m.unfinishedMatches.first %><strong><%=m.unfinishedMatches.first.bout_number%></strong> - <%= m.unfinishedMatches.first.weight_max %> lbs<br><%= m.unfinishedMatches.first.w1_name %> vs. <%= m.unfinishedMatches.first.w2_name %><% end %></td>
<td><% if m.unfinishedMatches.second %><strong><%=m.unfinishedMatches.second.bout_number%></strong> - <%= m.unfinishedMatches.second.weight_max %> lbs<br><%= m.unfinishedMatches.second.w1_name %> vs. <%= m.unfinishedMatches.second.w2_name %><% end %></td>
<td><% if m.unfinishedMatches.third %><strong><%=m.unfinishedMatches.third.bout_number%></strong> - <%= m.unfinishedMatches.third.weight_max %> lbs<br><%= m.unfinishedMatches.third.w1_name %> vs. <%= m.unfinishedMatches.third.w2_name %><% end %></td>
<td><% if m.unfinishedMatches.fourth %><strong><%=m.unfinishedMatches.fourth.bout_number%></strong> - <%= m.unfinishedMatches.fourth.weight_max %> lbs<br><%= m.unfinishedMatches.fourth.w1_name %> vs. <%= m.unfinishedMatches.fourth.w2_name %><% end %></td>
<td><% if m.unfinished_matches.first %><strong><%=m.unfinished_matches.first.bout_number%></strong> - <%= m.unfinished_matches.first.weight_max %> lbs<br><%= m.unfinished_matches.first.w1_name %> vs. <%= m.unfinished_matches.first.w2_name %><% end %></td>
<td><% if m.unfinished_matches.second %><strong><%=m.unfinished_matches.second.bout_number%></strong> - <%= m.unfinished_matches.second.weight_max %> lbs<br><%= m.unfinished_matches.second.w1_name %> vs. <%= m.unfinished_matches.second.w2_name %><% end %></td>
<td><% if m.unfinished_matches.third %><strong><%=m.unfinished_matches.third.bout_number%></strong> - <%= m.unfinished_matches.third.weight_max %> lbs<br><%= m.unfinished_matches.third.w1_name %> vs. <%= m.unfinished_matches.third.w2_name %><% end %></td>
<td><% if m.unfinished_matches.fourth %><strong><%=m.unfinished_matches.fourth.bout_number%></strong> - <%= m.unfinished_matches.fourth.weight_max %> lbs<br><%= m.unfinished_matches.fourth.w1_name %> vs. <%= m.unfinished_matches.fourth.w2_name %><% end %></td>
</tr>
<% end %>
</tbody>

View File

@@ -42,7 +42,7 @@
<% end %>
</td>
<td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
<td><%= wrestler.criteria %> Win <%= wrestler.seasonWinPercentage %>%</td>
<td><%= wrestler.criteria %> Win <%= wrestler.season_win_percentage %>%</td>
<td><% if wrestler.extra? == true %>
Yes
<% end %></td>

View File

@@ -55,7 +55,7 @@
</tr>
<tr>
<td>Placement Points</td>
<td>+<%= @wrestler_points_calc.placementPoints %></td>
<td>+<%= @wrestler_points_calc.placement_points %></td>
</tr>
<tr>
<td>Deducted Points</td>
@@ -86,12 +86,12 @@
</tr>
</thead>
<tbody>
<% @wrestler.allMatches.each do |m| %>
<% @wrestler.all_matches.each do |m| %>
<tr>
<td><%= m.bout_number %></td>
<td><%= m.bracket_position %></td>
<td><%= m.list_w1_stats %><br><%= m.list_w2_stats %></td>
<td><%= @wrestler.resultByBout(m.bout_number) %>
<td><%= @wrestler.result_by_bout(m.bout_number) %>
</tr>
<% end %>
</tbody>