mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
108 lines
3.4 KiB
Plaintext
108 lines
3.4 KiB
Plaintext
<% cache ["#{@tournament.id}_up_matches", @tournament] do %>
|
|
<script>
|
|
// $(document).ready(function() {
|
|
// $('#matchList').dataTable();
|
|
// } );
|
|
</script>
|
|
<script>
|
|
const setUpMatchesRefresh = () => {
|
|
if (window.__upMatchesRefreshTimeout) {
|
|
clearTimeout(window.__upMatchesRefreshTimeout);
|
|
}
|
|
window.__upMatchesRefreshTimeout = setTimeout(() => {
|
|
window.location.reload(true);
|
|
}, 30000);
|
|
};
|
|
|
|
document.addEventListener("turbo:load", setUpMatchesRefresh);
|
|
// turbo:before-cache stops the timer refresh from occurring if you navigate away from up_matches
|
|
document.addEventListener("turbo:before-cache", () => {
|
|
if (window.__upMatchesRefreshTimeout) {
|
|
clearTimeout(window.__upMatchesRefreshTimeout);
|
|
window.__upMatchesRefreshTimeout = null;
|
|
}
|
|
});
|
|
</script>
|
|
<br>
|
|
<br>
|
|
<h5 style="color:red">This page reloads every 30s</h5>
|
|
<br>
|
|
<h3>Upcoming Matches</h3>
|
|
<br>
|
|
<table class="table table-striped table-bordered table-condensed">
|
|
<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>
|
|
<% if m.queue1_match %><strong><%=m.queue1_match.bout_number%></strong> (<%= m.queue1_match.bracket_position %>)<br>
|
|
<%= m.queue1_match.weight_max %> lbs
|
|
<br><%= m.queue1_match.w1_bracket_name %> vs. <br>
|
|
<%= m.queue1_match.w2_bracket_name %>
|
|
<% end %>
|
|
</td>
|
|
<td>
|
|
<% if m.queue2_match %><strong><%=m.queue2_match.bout_number%></strong> (<%= m.queue2_match.bracket_position %>)<br>
|
|
<%= m.queue2_match.weight_max %> lbs
|
|
<br><%= m.queue2_match.w1_bracket_name %> vs. <br>
|
|
<%= m.queue2_match.w2_bracket_name %>
|
|
<% end %>
|
|
</td>
|
|
<td>
|
|
<% if m.queue3_match %><strong><%=m.queue3_match.bout_number%></strong> (<%= m.queue3_match.bracket_position %>)<br>
|
|
<%= m.queue3_match.weight_max %> lbs
|
|
<br><%= m.queue3_match.w1_bracket_name %> vs. <br>
|
|
<%= m.queue3_match.w2_bracket_name %>
|
|
<% end %>
|
|
</td>
|
|
<td>
|
|
<% if m.queue4_match %><strong><%=m.queue4_match.bout_number%></strong> (<%= m.queue4_match.bracket_position %>)<br>
|
|
<%= m.queue4_match.weight_max %> lbs
|
|
<br><%= m.queue4_match.w1_bracket_name %> vs. <br>
|
|
<%= m.queue4_match.w2_bracket_name %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<br>
|
|
<h3>Matches not assigned</h3>
|
|
<br>
|
|
<table class="table table-striped table-bordered table-condensed" id="matchList">
|
|
<thead>
|
|
<tr>
|
|
<th>Round</th>
|
|
<th>Bout Number</th>
|
|
<th>Weight Class</th>
|
|
<th>Matchup</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<% if @matches.size > 0 %>
|
|
<% @matches.each.map do |m| %>
|
|
<tr>
|
|
<td>Round <%= m.round %></td>
|
|
<td><%= m.bout_number %></td>
|
|
<td><%= m.weight_max %></td>
|
|
<td><%= m.w1_bracket_name %> vs. <%= m.w2_bracket_name %></td>
|
|
</tr>
|
|
<% end %>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<br>
|
|
<% end %>
|