mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-04 22:03:49 +00:00
Added logic to delegate tournament access
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
<p id="notice"><%= notice %></p>
|
||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}",:class=>"btn btn-default" %>
|
||||
<% if tournament_permissions(@school.tournament) %>
|
||||
<% if can? :manage, @tournament %>
|
||||
| <%= link_to "Edit #{@school.name}", edit_school_path(@school),:class=>"btn btn-primary" %>
|
||||
<% end %>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<p>
|
||||
<strong>Tournament:</strong>
|
||||
<%= Tournament.find(@school.tournament_id).name %>
|
||||
<%= @school.tournament.name %>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
|
||||
<br>
|
||||
<% if tournament_permissions(@school.tournament) %>
|
||||
<% if can? :manage, @tournament %>
|
||||
<%= link_to "New #{@school.name} Wrestler" , "/wrestlers/new?school=#{@school.id}", :class=>"btn btn-success"%>
|
||||
<% end %>
|
||||
<br>
|
||||
<br>
|
||||
<% cache ["schools", @school] do %>
|
||||
<table class="table table-striped table-bordered">
|
||||
<table class="table table-striped table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
@@ -53,7 +53,7 @@
|
||||
<% if wrestler.school_id == @school.id %>
|
||||
<tr>
|
||||
<td><%= wrestler.name %></td>
|
||||
<td><%= Weight.find(wrestler.weight_id).max %></td>
|
||||
<td><%= wrestler.weight.max %></td>
|
||||
<td>
|
||||
<%= wrestler.original_seed %>
|
||||
</td>
|
||||
@@ -65,10 +65,10 @@
|
||||
<% end %></td>
|
||||
<td><%= wrestler.nextMatchBoutNumber %> <%= wrestler.nextMatchMatName %></td>
|
||||
<td>
|
||||
<%= link_to 'Show', wrestler , :class=>"btn btn-default" %>
|
||||
<% if tournament_permissions(@school.tournament) %>
|
||||
<%= link_to 'Edit', edit_wrestler_path(wrestler),:class=>"btn btn-primary" %>
|
||||
<%= link_to 'Destroy', wrestler, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
|
||||
<%= link_to 'Show', wrestler , :class=>"btn btn-default btn-sm" %>
|
||||
<% if can? :manage, @tournament %>
|
||||
<%= 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>
|
||||
|
||||
Reference in New Issue
Block a user