1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-17 05:15:36 +00:00

Pretty up wrestler show page

This commit is contained in:
2017-12-14 09:03:31 -05:00
parent 03f3b8dcff
commit ba05573928
3 changed files with 95 additions and 46 deletions

View File

@@ -13,7 +13,7 @@ class CalculateWrestlerTeamScore
end end
def earnedPoints def earnedPoints
return poolPoints + bracketPoints + placementPoints + bonusWinPoints return poolPoints + bracketPoints + placementPoints + bonusWinPoints + byePoints
end end
def deductedPoints def deductedPoints
@@ -33,14 +33,22 @@ class CalculateWrestlerTeamScore
end end
def poolPoints def poolPoints
if @tournament.tournament_type == "Pool to bracket"
(@wrestler.poolWins.size * 2)
else
0
end
end
def byePoints
if @tournament.tournament_type == "Pool to bracket" if @tournament.tournament_type == "Pool to bracket"
if @wrestler.poolWins.size >= 1 and @wrestler.hasAPoolBye == true if @wrestler.poolWins.size >= 1 and @wrestler.hasAPoolBye == true
((@wrestler.poolWins.size * 2) + 2) 2
else else
(@wrestler.poolWins.size * 2) 0
end end
else else
0 0
end end
end end

Binary file not shown.

View File

@@ -22,37 +22,78 @@
<%= @wrestler.weight.max %> <%= @wrestler.weight.max %>
</p> </p>
<p> <p>
<strong>Team Points Earned:</strong> <strong>Extra?:</strong>
<%= @wrestler.teamPointsEarned %> <%= @wrestler.extra %>
</p> </p>
<p> <br>
<strong>Team Points Deducted:</strong> <br>
<%= @wrestler.totalDeductedPoints %> <h4>Point Breakdown</h4>
</p> <br>
<p> <table class="table">
<strong>Total Team Points Scored:</strong> <thead>
<%= @wrestler.totalTeamPoints %> <tr>
</p> <th>Point Modifier</th>
<p> <th>Points</th>
<strong>Points Breakdown:</strong></br> </tr>
Pool Win Points (including BYE points): <%= @wrestler_points_calc.poolPoints %></br> </thead>
Bracket Win Points: <%= @wrestler_points_calc.bracketPoints %></br> <tbody>
Bonus Points: <%= @wrestler_points_calc.bonusWinPoints %></br> <tr>
Placement Points:<%= @wrestler_points_calc.placementPoints %></br> <td>Pool Win Points</td>
</p> <td>+<%= @wrestler_points_calc.poolPoints %></td>
</tr>
<tr>
<td>BYE Points</td>
<td>+<%= @wrestler_points_calc.byePoints %></td>
</tr>
<tr>
<td>Bracket Win Points</td>
<td>+<%= @wrestler_points_calc.bracketPoints %></td>
</tr>
<tr>
<td>Bonus Points (pins,major,tech,etc)</td>
<td>+<%= @wrestler_points_calc.bonusWinPoints %></td>
</tr>
<tr>
<td>Placement Points</td>
<td>+<%= @wrestler_points_calc.placementPoints %></td>
</tr>
<tr>
<td>Deducted Points</td>
<td>-<%= @wrestler_points_calc.deductedPoints %></td>
</tr>
<tr>
<td>Total Points Earned</td>
<td><%= @wrestler_points_calc.earnedPoints %></td>
</tr>
<tr>
<td><strong>Total Points Toward Team Score (0 if entered as extra)</strong></td>
<td><strong><%= @wrestler_points_calc.totalScore %></strong></td>
</tr>
</tbody>
</table>
<br> <br>
<br> <br>
<h4>Matches</h4> <h4>Matches</h4>
<br> <br>
<% @wrestler.allMatches.each do |m| %> <table class="table">
<div> Bout: <%= m.bout_number %> <%= m.bracket_position %> <%= m.wrestler1.name %> vs. <%= m.wrestler2.name %> <%= @wrestler.resultByBout(m.bout_number) %></div> <thead>
<% if m.w1_stat || m.w2_stat %> <tr>
<div>Stats:</div> <th>Bout</th>
<div><%= m.list_w1_stats %></div> <th>Match Bracket Position</th>
<div><%= m.list_w2_stats %></div> <th>Stats</th>
</br> <th>Result</th>
<% end %> </tr>
<% end %> </thead>
<tbody>
<% @wrestler.allMatches.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) %>
</tr>
<% end %>
</tbody>
</table>
<% end %> <% end %>