1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00
Files
wrestlingdev.com/app/views/tournaments/show.html.erb

138 lines
3.2 KiB
Plaintext

<% if can? :manage, @tournament %>
<%= link_to "Edit #{@tournament.name}", edit_tournament_path(@tournament), :class=>"btn btn-primary" %>
<% end %>
<h1>
<%= @tournament.name %>
</h1>
<p>
<strong>Address:</strong>
<%= @tournament.address %>
</p>
<p>
<strong>Director:</strong>
<%= @tournament.director %>
</p>
<p>
<strong>Director email:</strong>
<%= @tournament.director_email %>
</p>
<p>
<strong>Tournament Type:</strong>
<%= @tournament.tournament_type %>
</p>
<br>
<br>
<h3>School Lineups</h3>
<br>
<% if can? :manage, @tournament %>
<%= link_to "New #{@tournament.name} School" , "/schools/new?tournament=#{@tournament.id}", :class=>"btn btn-success btn-sm" %>
<br>
<br>
<% end %>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
<% @schools.each do |school| %>
<tr>
<td><%= school.name %></td>
<td><%= link_to 'Show', school, :class=>"btn btn-default btn-sm" %>
<% if can? :manage, school %>
<%= link_to 'Edit', edit_school_path(school), :class=>"btn btn-primary btn-sm" %>
<% end %>
<% if can? :manage, @tournament %>
<%= link_to 'Destroy', school, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger btn-sm" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<br>
<br>
<h3>Weight Class Seeds</h3>
<br>
<% if can? :manage, @tournament %>
<%= link_to "New #{@tournament.name} Weight" , "/weights/new?tournament=#{@tournament.id}", :class=>"btn btn-success btn-sm" %>
<br>
<br>
<% end %>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Weight Class</th>
<th>Bracket Size</th>
<th></th>
</tr>
</thead>
<tbody>
<% @weights.each do |weight| %>
<tr>
<td><%= weight.max %></td>
<td><%= weight.bracket_size %></td>
<td><%= link_to 'Show', weight, :class=>"btn btn-default btn-sm" %>
<% if can? :manage, @tournament %>
<%= link_to 'Edit', edit_weight_path(weight), :class=>"btn btn-primary btn-sm" %>
<%= link_to 'Destroy', weight, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger btn-sm" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% if can? :manage, @tournament %>
<br>
<br>
<h3>Mats</h3>
<br>
<%= link_to "New #{@tournament.name} Mat" , "/mats/new?tournament=#{@tournament.id}", :class=>"btn btn-success btn-sm" %>
<br>
<br>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
<% @mats.each do |mat| %>
<tr>
<td><%= mat.name %></td>
<td>
<% if can? :manage, @tournament %>
<%= link_to 'Show', mat, :class=>"btn btn-default btn-sm" %>
<%= link_to 'Destroy', mat, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger btn-sm" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<br>
<%= render 'import_form' %>