1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-07 22:55:09 +00:00

Added a stats page for teams

This commit is contained in:
2017-12-18 07:51:38 -05:00
parent 7831bfaf6b
commit d88000f06a
5 changed files with 58 additions and 19 deletions

View File

@@ -1,16 +1,16 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}",:class=>"btn btn-default" %>
<%= 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 %>
| <%= link_to "#{@school.name} Stat Summary", "/schools/#{@school.id}/stats",:class=>"btn btn-primary" %>
<br>
<br>
<p>
<strong>Name:</strong>
<%= @school.name %>
</p>
<p>
<strong>Team Points Deducted:</strong>
<%= @school.totalDeductedPoints %>
@@ -19,23 +19,23 @@
<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>
@@ -48,7 +48,7 @@
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @wrestlers.sort_by{|w| w.weight.max}.each do |wrestler| %>
<tr>
@@ -67,7 +67,7 @@
<% 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 %>
<% end %>
</td>
</tr>
<% end %>