1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-10 07:48:29 +00:00

Moving pages to tournament from static_pages

This commit is contained in:
2015-11-04 16:10:56 -05:00
parent 0ad274b421
commit f86a577c8b
15 changed files with 111 additions and 114 deletions

View File

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

View File

@@ -1,14 +1,19 @@
<h1>Listing tournaments</h1>
<table>
<h1>Pick A Tournament</h1>
<script>
$(document).ready(function() {
$('#tournamentList').dataTable();
pagingType: "bootstrap";
} );
</script>
<% if user_signed_in? %>
<%= link_to 'New Tournament', new_tournament_path, :class=>"btn btn-success" %>
<% end %>
</br>
</br>
<table class="display compact cell-border" id="tournamentList">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>Director</th>
<th>Director email</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
@@ -17,12 +22,12 @@
<% @tournaments.each do |tournament| %>
<tr>
<td><%= tournament.name %></td>
<td><%= tournament.address %></td>
<td><%= tournament.director %></td>
<td><%= tournament.director_email %></td>
<td><%= link_to 'Show', tournament %></td>
<td><%= link_to 'Edit', edit_tournament_path(tournament) %></td>
<td><%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' } %></td>
<td><%= link_to 'Show', tournament, :class=>"btn btn-default" %>
<% if tournament_permissions(tournament) %>
<%= link_to 'Edit', edit_tournament_path(tournament), :class=>"btn btn-primary" %>
<%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
@@ -30,4 +35,4 @@
<br>
<%= link_to 'New Tournament', new_tournament_path %>

View File

@@ -0,0 +1,5 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %>
<br>
<br>
<h1>No Matches</h1>
<p>This view will not render until matches have been generated by the tournament director.</p>

View File

@@ -2,7 +2,7 @@
<% if tournament_permissions(@tournament) %>
<%= link_to "Edit #{@tournament.name}", edit_tournament_path(@tournament), :class=>"btn btn-primary" %> |
<% end %>
<%= link_to 'Back', '/static_pages/tournaments', :class=>"btn btn-default" %>
<%= link_to 'Back', '/tournaments', :class=>"btn btn-default" %>
<h1>
<%= @tournament.name %>
@@ -31,7 +31,7 @@
</p>
<br>
<% if tournament_permissions(@tournament) %>
<%= link_to "Generate Pool Matches" , "/static_pages/generate_matches?tournament=#{@tournament.id}", data: { confirm: 'Are you sure? This will delete all current matches.' }, :class=>"btn btn-success" %>
<%= 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" %>
<br>

View File

@@ -0,0 +1,22 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" , :class=>"btn btn-default"%>
<br>
<br>
<h3>Team Scores</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<% @schools.each do |school| %>
<tr>
<td><%= school.name %></td>
<td><%= school.score %></td>
</tr>
<% end %>
</tbody>
</table>

View File

@@ -0,0 +1,68 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default"%>
<script>
$(document).ready(function() {
$('#matchList').dataTable();
} );
</script>
<script>
setTimeout("location.reload(true);",30000);
</script>
<br>
<br>
<h5 style="color:red">This page reloads every 30s</h5>
<br>
<br>
<h3>Upcoming Matches</h3>
<br>
<br>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Mat</th>
<th>On Mat</th>
<th>On Deck</th>
<th>In The Hole</th>
<th>Warm Up</th>
</tr>
</thead>
<tbody>
<% @mats.each.map do |m| %>
<tr>
<td><%= m.name %></td>
<td><%=m.unfinishedMatches.first.bout_number%><br><%= m.unfinishedMatches.first.w1_name %> vs. <%= m.unfinishedMatches.first.w2_name %></td>
<td><%=m.unfinishedMatches.second.bout_number%><br><%= m.unfinishedMatches.second.w1_name %> vs. <%= m.unfinishedMatches.second.w2_name %></td>
<td><%=m.unfinishedMatches.third.bout_number%><br><%= m.unfinishedMatches.third.w1_name %> vs. <%= m.unfinishedMatches.third.w2_name %></td>
<td><%=m.unfinishedMatches.fourth.bout_number%><br><%= m.unfinishedMatches.fourth.w1_name %> vs. <%= m.unfinishedMatches.fourth.w2_name %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<br>
<h3>Matches not assigned</h3>
<br>
<br>
<table class="display compact cell-border" id="matchList">
<thead>
<tr>
<th>Round</th>
<th>Bout Number</th>
<th>Weight Class</th>
<th>Matchup</th>
</tr>
</thead>
<tbody>
<% @matches.each.map do |m| %>
<tr>
<td>Round <%= m.round %></td>
<td><%= m.bout_number %></td>
<td><%= m.weight_max %> lbs</td>
<td><%= m.w1_name %> vs. <%= m.w2_name %></td>
</tr>
<% end %>
</tbody>
</table>
<br>

View 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}" , "/static_pages/brackets?weight=#{weight.id}" %>
<br>
<% end %>
<%= link_to "All Brackets", "/static_pages/all_brackets?print=true&tournament=#{@tournament.id}" %>