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

80 lines
2.2 KiB
Plaintext

<p id="notice"><%= notice %></p>
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}",:class=>"btn btn-default" %>
<% if can? :manage, @school %>
| <%= link_to "Edit #{@school.name}", edit_school_path(@school),:class=>"btn btn-primary" %>
<% end %>
<br>
<br>
<p>
<strong>Name:</strong>
<%= @school.name %>
</p>
<p>
<strong>Team Points Deducted:</strong>
<%= @school.totalDeductedPoints %>
</p>
<p>
<strong>Score:</strong>
<%= @school.score %>
</p>
<p>
<strong>Tournament:</strong>
<%= @school.tournament.name %>
</p>
<br>
<% if can? :manage, @school %>
<%= link_to "New #{@school.name} Wrestler" , "/wrestlers/new?school=#{@school.id}", :class=>"btn btn-success"%>
<% end %>
<br>
<br>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Weight</th>
<th>Seed</th>
<th>Team Points Scored</th>
<th>Extra?</th>
<th>Next Bout/Mat</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @wrestlers.sort_by{|w| w.weight.max}.each do |wrestler| %>
<% cache ["schools_view_wrestler", wrestler] do %>
<tr>
<td><%= wrestler.name %></td>
<td><%= wrestler.weight.max %></td>
<td>
<%= wrestler.original_seed %>
</td>
<td><%= wrestler.totalTeamPoints - wrestler.totalDeductedPoints %></td>
<td><% if wrestler.extra? == true %>
Yes
<% end %></td>
<td><%= wrestler.nextMatchBoutNumber %> <%= wrestler.nextMatchMatName %></td>
<% end %>
<td>
<%= link_to 'Show', wrestler , :class=>"btn btn-default btn-sm" %>
<% if can? :manage, wrestler.school %>
<%= link_to 'Edit', edit_wrestler_path(wrestler),:class=>"btn btn-primary btn-sm" %>
<%= link_to 'Destroy', wrestler, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger btn-sm" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>