mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-14 08:58:29 +00:00
Moved static pages actions to tournament where it made sense
This commit is contained in:
201
app/views/tournaments/_fourPoolQuarterBracket.html.erb
Normal file
201
app/views/tournaments/_fourPoolQuarterBracket.html.erb
Normal file
@@ -0,0 +1,201 @@
|
||||
<style>
|
||||
/*
|
||||
* Flex Layout Specifics
|
||||
*/
|
||||
main{
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
}
|
||||
.round{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
justify-content:center;
|
||||
width:200px;
|
||||
list-style:none;
|
||||
padding:0;
|
||||
}
|
||||
.round .spacer{ flex-grow:1; }
|
||||
.round .spacer:first-child,
|
||||
.round .spacer:last-child{ flex-grow:.5; }
|
||||
|
||||
.round .game-spacer{
|
||||
flex-grow:1;
|
||||
}
|
||||
|
||||
/*
|
||||
* General Styles
|
||||
*/
|
||||
body{
|
||||
font-family:sans-serif;
|
||||
font-size:small;
|
||||
padding:10px;
|
||||
line-height:1.4em;
|
||||
}
|
||||
|
||||
li.game{
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
li.game.winner{
|
||||
font-weight:bold;
|
||||
}
|
||||
li.game span{
|
||||
float:right;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
li.game-top{ border-bottom:1px solid #aaa; }
|
||||
|
||||
li.game-spacer{
|
||||
border-right:1px solid #aaa;
|
||||
min-height:40px;
|
||||
}
|
||||
|
||||
li.game-bottom{
|
||||
border-top:1px solid #aaa;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<h5>Championship Bracket After Pool</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "Quarter"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<% @matches.select{|m|m.bracket_position == "Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul class="round round-3">
|
||||
<% @matches.select{|m|m.bracket_position == "1/2"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-4">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.winnerName %> <span></span></li>
|
||||
1st
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
</br>
|
||||
<h5>3rd/4th</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "3/4"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <%= match.winnerName %><span></span></li>
|
||||
3rd
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
</br>
|
||||
<h5>Consolation Bracket After Pool</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "Conso Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<% @matches.select{|m|m.bracket_position == "5/6"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-3">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <%= match.winnerName %><span></span></li>
|
||||
5th
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
<br>
|
||||
<h5>7th/8th</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "7/8"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.winnerName %> <span></span></li>
|
||||
7th
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
</br>
|
||||
|
||||
|
||||
|
||||
|
||||
192
app/views/tournaments/_fourPoolSemiBracket.html.erb
Normal file
192
app/views/tournaments/_fourPoolSemiBracket.html.erb
Normal file
@@ -0,0 +1,192 @@
|
||||
<style>
|
||||
/*
|
||||
* Flex Layout Specifics
|
||||
*/
|
||||
main{
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
}
|
||||
.round{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
justify-content:center;
|
||||
width:200px;
|
||||
list-style:none;
|
||||
padding:0;
|
||||
}
|
||||
.round .spacer{ flex-grow:1; }
|
||||
.round .spacer:first-child,
|
||||
.round .spacer:last-child{ flex-grow:.5; }
|
||||
|
||||
.round .game-spacer{
|
||||
flex-grow:1;
|
||||
}
|
||||
|
||||
/*
|
||||
* General Styles
|
||||
*/
|
||||
body{
|
||||
font-family:sans-serif;
|
||||
font-size:small;
|
||||
padding:10px;
|
||||
line-height:1.4em;
|
||||
}
|
||||
|
||||
li.game{
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
li.game.winner{
|
||||
font-weight:bold;
|
||||
}
|
||||
li.game span{
|
||||
float:right;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
li.game-top{ border-bottom:1px solid #aaa; }
|
||||
|
||||
li.game-spacer{
|
||||
border-right:1px solid #aaa;
|
||||
min-height:40px;
|
||||
}
|
||||
|
||||
li.game-bottom{
|
||||
border-top:1px solid #aaa;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<h5>Championship Bracket After Pool</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<% @matches.select{|m|m.bracket_position == "1/2"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-3">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <%= match.winnerName %><span></span></li>
|
||||
1st
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
</br>
|
||||
|
||||
<h5>3rd/4th</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "3/4"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <%= match.winnerName %><span></span></li>
|
||||
3rd
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
</br>
|
||||
|
||||
|
||||
<h5>Consolation Bracket After Pool</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "Conso Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<% @matches.select{|m|m.bracket_position == "5/6"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-3">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <%= match.winnerName %><span></span></li>
|
||||
5th
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
<br>
|
||||
<h5>7th/8th</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "7/8"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <%= match.winnerName %><span></span></li>
|
||||
7th
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
</br>
|
||||
|
||||
|
||||
|
||||
|
||||
35
app/views/tournaments/_pool.html.erb
Normal file
35
app/views/tournaments/_pool.html.erb
Normal file
@@ -0,0 +1,35 @@
|
||||
<% @round = 1 %>
|
||||
<% @pool = 1 %>
|
||||
<% until @wrestlers.select{|w| w.generatePoolNumber == @pool}.blank? %>
|
||||
<h5>Pool <%= @pool %></h5>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<% until @matches.select{|m| m.round == @round}.blank? %>
|
||||
<% if @round <= @pools %>
|
||||
<th>R<%= @round %></th>
|
||||
<% end %>
|
||||
<% @round = @round + 1 %>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @wrestlers.select{|w| w.generatePoolNumber == @pool}.sort_by{|w| w.original_seed}.each do |w| %>
|
||||
<tr>
|
||||
<td><%= w.original_seed %> <%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
|
||||
<% @round = 1 %>
|
||||
<% until @matches.select{|m| m.round == @round}.blank? %>
|
||||
<% if @round <= @pools %>
|
||||
<td><%= w.boutByRound(@round) %><br><%= w.resultByBout(w.boutByRound(@round)) %></td>
|
||||
<% end %>
|
||||
<% @round = @round + 1 %>
|
||||
<% end %>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% @pool = @pool + 1 %>
|
||||
<% @round = 1 %>
|
||||
<% end %>
|
||||
109
app/views/tournaments/_twoPoolFinalBracket.html.erb
Normal file
109
app/views/tournaments/_twoPoolFinalBracket.html.erb
Normal file
@@ -0,0 +1,109 @@
|
||||
<style>
|
||||
/*
|
||||
* Flex Layout Specifics
|
||||
*/
|
||||
main{
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
}
|
||||
.round{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
justify-content:center;
|
||||
width:200px;
|
||||
list-style:none;
|
||||
padding:0;
|
||||
}
|
||||
.round .spacer{ flex-grow:1; }
|
||||
.round .spacer:first-child,
|
||||
.round .spacer:last-child{ flex-grow:.5; }
|
||||
|
||||
.round .game-spacer{
|
||||
flex-grow:1;
|
||||
}
|
||||
|
||||
/*
|
||||
* General Styles
|
||||
*/
|
||||
body{
|
||||
font-family:sans-serif;
|
||||
font-size:small;
|
||||
padding:10px;
|
||||
line-height:1.4em;
|
||||
}
|
||||
|
||||
li.game{
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
li.game.winner{
|
||||
font-weight:bold;
|
||||
}
|
||||
li.game span{
|
||||
float:right;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
li.game-top{ border-bottom:1px solid #aaa; }
|
||||
|
||||
li.game-spacer{
|
||||
border-right:1px solid #aaa;
|
||||
min-height:40px;
|
||||
}
|
||||
|
||||
li.game-bottom{
|
||||
border-top:1px solid #aaa;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
</br>
|
||||
<h5>Championship Match</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "1/2"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <%= match.winnerName %><span></span></li>
|
||||
1st
|
||||
|
||||
<li class="spacer"> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
|
||||
<h5>3rd/4th</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "3/4"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.winnerName %> <span></span></li>
|
||||
3rd
|
||||
|
||||
<li class="spacer"> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
|
||||
123
app/views/tournaments/_twoPoolSemiBracket.html.erb
Normal file
123
app/views/tournaments/_twoPoolSemiBracket.html.erb
Normal file
@@ -0,0 +1,123 @@
|
||||
<style>
|
||||
/*
|
||||
* Flex Layout Specifics
|
||||
*/
|
||||
main{
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
}
|
||||
.round{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
justify-content:center;
|
||||
width:200px;
|
||||
list-style:none;
|
||||
padding:0;
|
||||
}
|
||||
.round .spacer{ flex-grow:1; }
|
||||
.round .spacer:first-child,
|
||||
.round .spacer:last-child{ flex-grow:.5; }
|
||||
|
||||
.round .game-spacer{
|
||||
flex-grow:1;
|
||||
}
|
||||
|
||||
/*
|
||||
* General Styles
|
||||
*/
|
||||
body{
|
||||
font-family:sans-serif;
|
||||
font-size:small;
|
||||
padding:10px;
|
||||
line-height:1.4em;
|
||||
}
|
||||
|
||||
li.game{
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
li.game.winner{
|
||||
font-weight:bold;
|
||||
}
|
||||
li.game span{
|
||||
float:right;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
li.game-top{ border-bottom:1px solid #aaa; }
|
||||
|
||||
li.game-spacer{
|
||||
border-right:1px solid #aaa;
|
||||
min-height:40px;
|
||||
}
|
||||
|
||||
li.game-bottom{
|
||||
border-top:1px solid #aaa;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
</br>
|
||||
<h5>Championship Bracket After Pool</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<% @matches.select{|m|m.bracket_position == "1/2"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-3">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <%= match.winnerName %><span></span></li>
|
||||
1st
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
</br>
|
||||
|
||||
<h5>3rd/4th</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<% @matches.select{|m|m.bracket_position == "3/4"}.each do |match| %>
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "><%= match.w1_name %> <span>Score</span></li>
|
||||
<li class="game game-spacer"><%= match.bout_number %> <%= match.bracketScore %> </li>
|
||||
<li class="game game-bottom "><%= match.w2_name %><span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <%= match.winnerName %><span></span></li>
|
||||
3rd
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
</main>
|
||||
51
app/views/tournaments/all_brackets.html.erb
Normal file
51
app/views/tournaments/all_brackets.html.erb
Normal file
@@ -0,0 +1,51 @@
|
||||
<style>
|
||||
.pagebreak { page-break-after: always; width:100%;}
|
||||
#html, #body, #wrapper { width:100%; }
|
||||
|
||||
</style>
|
||||
<script src="https://rawgithub.com/eligrey/FileSaver.js/master/FileSaver.js" type="text/javascript"></script>
|
||||
<script>
|
||||
function exportDataToRtf() {
|
||||
var blob = new Blob([document.getElementById("exportable").innerHTML], {
|
||||
type: "application/octet-stream"
|
||||
});
|
||||
saveAs(blob, "brackets.rtf");
|
||||
}
|
||||
</script>
|
||||
|
||||
<%= link_to "Back to #{@tournament.name} weights", "/tournaments/#{@tournament.id}/brackets" %>
|
||||
<br>
|
||||
<br>
|
||||
<button type="submit" class="btn btn-primary" onclick="exportDataToRtf()">Export to file for printing</button>
|
||||
<!--[if lte IE 9]>
|
||||
<div>Excel export does not work on IE versions lower than 10. Please use chrome or update IE.</div>
|
||||
<!--<![endif]-->
|
||||
<br>
|
||||
<br>
|
||||
<div id="exportable">
|
||||
<% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
|
||||
<div class="pagebreak">
|
||||
<% @weight = w %>
|
||||
<% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %>
|
||||
<% @wrestlers = Wrestler.where(weight_id: @weight.id) %>
|
||||
<% @pools = w.poolRounds(@matches) %>
|
||||
<h5><%= @weight.max %> lbs Bracket</h5>
|
||||
|
||||
<%= render 'pool' %>
|
||||
</div>
|
||||
<div class="pagebreak">
|
||||
<% if w.pool_bracket_type == "twoPoolsToFinal" %>
|
||||
<%= render 'twoPoolFinalBracket' %>
|
||||
<% end %>
|
||||
<% if w.pool_bracket_type == "twoPoolsToSemi" %>
|
||||
<%= render 'twoPoolSemiBracket' %>
|
||||
<% end %>
|
||||
<% if w.pool_bracket_type == "fourPoolsToQuarter" %>
|
||||
<%= render 'fourPoolQuarterBracket' %>
|
||||
<% end %>
|
||||
<% if w.pool_bracket_type == "fourPoolsToSemi" %>
|
||||
<%= render 'fourPoolSemiBracket' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
23
app/views/tournaments/bracket.html.erb
Normal file
23
app/views/tournaments/bracket.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
</br>
|
||||
</br>
|
||||
</br>
|
||||
|
||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
<h1><%= @weight.max %> lbs Bracket</h1>
|
||||
|
||||
<%= render 'pool' %>
|
||||
|
||||
<% if @bracketType == "twoPoolsToFinal" %>
|
||||
<%= render 'twoPoolFinalBracket' %>
|
||||
<% end %>
|
||||
<% if @bracketType == "twoPoolsToSemi" %>
|
||||
<%= render 'twoPoolSemiBracket' %>
|
||||
<% end %>
|
||||
<% if @bracketType == "fourPoolsToQuarter" %>
|
||||
<%= render 'fourPoolQuarterBracket' %>
|
||||
<% end %>
|
||||
<% if @bracketType == "fourPoolsToSemi" %>
|
||||
<%= render 'fourPoolSemiBracket' %>
|
||||
<% end %>
|
||||
8
app/views/tournaments/brackets.html.erb
Normal file
8
app/views/tournaments/brackets.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
<% @weights.each do |weight| %>
|
||||
<%= link_to "#{weight.max}" , "/tournaments/#{@tournament.id}/brackets/#{weight.id}" %>
|
||||
<br>
|
||||
<% end %>
|
||||
<%= link_to "All Brackets", "/tournaments/#{@tournament.id}/all_brackets?print=true" %>
|
||||
5
app/views/tournaments/results.html.erb
Normal file
5
app/views/tournaments/results.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Results</h3>
|
||||
<p>Will be displayed here.</p>
|
||||
@@ -33,7 +33,7 @@
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= link_to "Generate Brackets" , "/tournaments/#{@tournament.id}/generate_matches", data: { confirm: 'Are you sure? This will delete all current matches.' }, :class=>"btn btn-success" %>
|
||||
<br><br>
|
||||
<%= link_to "Weigh In Page" , "/static_pages/weigh_in?tournament=#{@tournament.id}", :class=>"btn btn-primary" %>
|
||||
<%= link_to "Weigh In Page" , "/tournaments/#{@tournament.id}/weigh_in", :class=>"btn btn-primary" %>
|
||||
<br>
|
||||
<br>
|
||||
<% end %>
|
||||
@@ -77,7 +77,7 @@
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= link_to "New #{@tournament.name} Weight" , "/weights/new?tournament=#{@tournament.id}", :class=>"btn btn-success" %>
|
||||
<br><br>
|
||||
<%= link_to "Create HS Weights" , "/static_pages/createCustomWeights?tournament=#{@tournament.id}&customValue=hs",data: { confirm: 'Are you sure? This will delete all current weights.' }, :class=>"btn btn-success" %>
|
||||
<%= link_to "Create HS Weights" , "/tournaments/#{@tournament.id}/create_custom_weights?customValue=hs",data: { confirm: 'Are you sure? This will delete all current weights.' }, :class=>"btn btn-success" %>
|
||||
<br>
|
||||
<br>
|
||||
<% end %>
|
||||
|
||||
20
app/views/tournaments/weigh_in.html.erb
Normal file
20
app/views/tournaments/weigh_in.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<%= link_to "Back to #{@tournament_name}", "/tournaments/#{@tournament_id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
<% @weights.each do |weight| %>
|
||||
<%= link_to "#{weight.max}" , "/tournaments/#{@tournament.id}/weigh_in/#{weight.id}" %>
|
||||
<br>
|
||||
<% end %>
|
||||
<br>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= form_for(@tournament) do |f| %>
|
||||
<div class="field">
|
||||
<%= f.label :weigh_in_ref %><br>
|
||||
<%= f.text_field :weigh_in_ref %>
|
||||
</div>
|
||||
<br>
|
||||
<%= f.submit 'Submit', :class=>"btn btn-success" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
43
app/views/tournaments/weigh_in_weight.html.erb
Normal file
43
app/views/tournaments/weigh_in_weight.html.erb
Normal file
@@ -0,0 +1,43 @@
|
||||
<%= link_to "Back to #{@tournament_name}", "/tournaments/#{@tournament_id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
<%= link_to "Back to weigh ins","/tournaments/#{@tournament_id}/weigh_in", :class=>"btn btn-default" %>
|
||||
<br><br>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>School</th>
|
||||
<th>Seed</th>
|
||||
<th>Weight Class</th>
|
||||
<th>Offical Weight</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= form_tag @wrestlers_update_path do %>
|
||||
<% @wrestlers.order("original_seed asc").each do |wrestler| %>
|
||||
<% if wrestler.weight_id == @weight.id %>
|
||||
<tr>
|
||||
<td><%= wrestler.name %></td>
|
||||
<td><%= School.find(wrestler.school_id).name %></td>
|
||||
<td><%= wrestler.original_seed %></td>
|
||||
<td><%= wrestler.weight.max %></td>
|
||||
<td>
|
||||
<% if user_signed_in? %>
|
||||
<%= fields_for "wrestler[]", wrestler do |w| %>
|
||||
<%= w.number_field :offical_weight, :step => 'any' %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= wrestler.offical_weight %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= hidden_field_tag :tournament, @tournament_id %>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= submit_tag "Save", :class=>"btn btn-success"%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -1,8 +0,0 @@
|
||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
<% @weights.each do |weight| %>
|
||||
<%= link_to "#{weight.max}" , "/static_pages/brackets?weight=#{weight.id}" %>
|
||||
<br>
|
||||
<% end %>
|
||||
<%= link_to "All Brackets", "/static_pages/all_brackets?print=true&tournament=#{@tournament.id}" %>
|
||||
Reference in New Issue
Block a user