mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
|
|
|
|
<h1>All <%= @tournament.name %> matches</h1>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#matchesList').dataTable();
|
|
pagingType: "bootstrap";
|
|
} );
|
|
</script>
|
|
</br>
|
|
<table class="table table-striped table-bordered table-condensed" id="matchesList">
|
|
<thead>
|
|
<tr>
|
|
<th>Bout number</th>
|
|
<th>Bracket Position</th>
|
|
<th>Matchup</th>
|
|
<th>Finished?</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<% @matches.each do |match| %>
|
|
<tr>
|
|
<td><%= match.bout_number %></td>
|
|
<td><%= match.bracket_position %></td>
|
|
<td><%= match.w1_bracket_name.html_safe %> vs <%= match.w2_bracket_name.html_safe %></td>
|
|
<td><%= match.finished %></td>
|
|
<td><%= link_to 'Show', match, :class=>"btn btn-default btn-sm" %>
|
|
<%= link_to 'Edit Wrestlers', edit_match_path(match), :class=>"btn btn-primary btn-sm" %>
|
|
<%= link_to 'Stat Match', "/matches/#{match.id}/stat", :class=>"btn btn-primary btn-sm" %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<br>
|
|
<p>Total matches without byes: <%= @matches.select{|m| m.loser1_name != 'BYE' and m.loser2_name != 'BYE'}.size %></p>
|
|
<p>Unfinished matches: <%= @matches.select{|m| m.finished != 1 and m.loser1_name != 'BYE' and m.loser2_name != 'BYE'}.size %></p> |