1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Added winner name for final line of brackets

This commit is contained in:
2015-10-15 15:13:52 -04:00
parent 386dc1605f
commit 4b447b86f9
5 changed files with 36 additions and 26 deletions

View File

@@ -44,7 +44,17 @@ class Match < ActiveRecord::Base
self.loser2_name
end
end
def winnerName
if self.finished != 1
return ""
end
if self.winner_id == self.w1
return self.w1_name
end
if self.winner_id == self.w2
return self.w2_name
end
end
def weight_max
Weight.find(self.weight_id).max
end

View File

@@ -95,17 +95,17 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-4">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "><%= match.winnerName %> <span></span></li>
1st
<li class="spacer">&nbsp;</li>
</ul>
</ul>
<% end %>
</main>
</br>
<h5>3rd/4th</h5>
@@ -120,17 +120,17 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-2">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "> <%= match.winnerName %><span></span></li>
3rd
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>
</br>
<h5>Consolation Bracket After Pool</h5>
@@ -157,17 +157,17 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-3">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "> <%= match.winnerName %><span></span></li>
5th
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>
<br>
<h5>7th/8th</h5>
@@ -182,17 +182,17 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-2">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "><%= match.winnerName %> <span></span></li>
7th
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>
</br>

View File

@@ -83,17 +83,17 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-3">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "> <%= match.winnerName %><span></span></li>
1st
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>
</br>
@@ -109,17 +109,17 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-2">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "> <%= match.winnerName %><span></span></li>
3rd
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>
</br>
@@ -148,17 +148,17 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-3">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "> <%= match.winnerName %><span></span></li>
5th
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>
<br>
<h5>7th/8th</h5>
@@ -173,17 +173,17 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-2">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "> <%= match.winnerName %><span></span></li>
7th
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>
</br>

View File

@@ -71,16 +71,16 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-2">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "> <%= match.winnerName %><span></span></li>
1st
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>
<h5>3rd/4th</h5>
@@ -95,15 +95,15 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-2">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "><%= match.winnerName %> <span></span></li>
3rd
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>

View File

@@ -83,17 +83,17 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-3">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "> <%= match.winnerName %><span></span></li>
1st
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>
</br>
@@ -109,15 +109,15 @@ li.game{
<li class="spacer">&nbsp;</li>
<% end %>
</ul>
<ul class="round round-2">
<li class="spacer">&nbsp;</li>
<li class="game game-top "> <span></span></li>
<li class="game game-top "> <%= match.winnerName %><span></span></li>
3rd
<li class="spacer">&nbsp;</li>
</ul>
<% end %>
</main>