

<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>