mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-05-12 16:48:59 +00:00
Finished setting owner for tournamenr and protecting paths
This commit is contained in:
@@ -31,9 +31,9 @@
|
||||
<%= f.label :tournament_type %><br>
|
||||
<%= f.select :tournament_type, @tournament.tournament_types %>
|
||||
</div>
|
||||
<%= f.hidden_field :user_id, :value => current_user.id %>
|
||||
<br>
|
||||
<br>
|
||||
<%= f.hidden_field :user_id, :value => current_user.id %>
|
||||
<div class="actions">
|
||||
<%= f.submit 'Submit',:class=>"btn btn-success" %>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
<% if user_signed_in? %>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= link_to "Edit #{@tournament.name}", edit_tournament_path(@tournament), :class=>"btn btn-primary" %> |
|
||||
<% end %>
|
||||
<%= link_to 'Back', root_path, :class=>"btn btn-default" %>
|
||||
<%= link_to 'Back', '/static_pages/tournaments', :class=>"btn btn-default" %>
|
||||
|
||||
<h1>
|
||||
<%= @tournament.name %>
|
||||
@@ -30,7 +30,7 @@
|
||||
<%= @tournament.tournament_type %>
|
||||
</p>
|
||||
<br>
|
||||
<% if user_signed_in? %>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= link_to "Generate Pool Matches" , "/static_pages/generate_matches?tournament=#{@tournament.id}", data: { confirm: 'Are you sure? This will delete all current matches.' }, :class=>"btn btn-success" %>
|
||||
<br><br>
|
||||
<%= link_to "Weigh In Page" , "/static_pages/weigh_in?tournament=#{@tournament.id}", :class=>"btn btn-primary" %>
|
||||
@@ -40,7 +40,7 @@
|
||||
<br>
|
||||
<h3>School Lineups</h3>
|
||||
<br>
|
||||
<% if user_signed_in? %>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= link_to "New #{@tournament.name} School" , "/schools/new?tournament=#{@tournament.id}", :class=>"btn btn-success" %>
|
||||
<br>
|
||||
<br>
|
||||
@@ -59,7 +59,7 @@
|
||||
<tr>
|
||||
<td><%= school.name %></td>
|
||||
<td><%= link_to 'Show', school, :class=>"btn btn-default" %>
|
||||
<% if user_signed_in? %>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= link_to 'Edit', edit_school_path(school), :class=>"btn btn-primary" %>
|
||||
<%= link_to 'Destroy', school, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
|
||||
<% end %>
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
<h3>Weight Class Seeds</h3>
|
||||
<br>
|
||||
<% if user_signed_in? %>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= link_to "New #{@tournament.name} Weight" , "/weights/new?tournament=#{@tournament.id}", :class=>"btn btn-success" %>
|
||||
<br><br>
|
||||
<%= link_to "Create HS Weights" , "/static_pages/createCustomWeights?tournament=#{@tournament.id}&customValue=hs",data: { confirm: 'Are you sure? This will delete all current weights.' }, :class=>"btn btn-success" %>
|
||||
@@ -96,7 +96,7 @@
|
||||
<td><%= weight.max %></td>
|
||||
<td><%= weight.bracket_size %></td>
|
||||
<td><%= link_to 'Show', weight, :class=>"btn btn-default" %>
|
||||
<% if user_signed_in? %>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= link_to 'Edit', edit_weight_path(weight), :class=>"btn btn-primary" %>
|
||||
<%= link_to 'Destroy', weight, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
|
||||
<% end %>
|
||||
@@ -106,7 +106,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% if user_signed_in? %>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<br>
|
||||
<br>
|
||||
<h3>Mats</h3>
|
||||
@@ -127,7 +127,7 @@
|
||||
<tr>
|
||||
<td><%= mat.name %></td>
|
||||
<td>
|
||||
<% if user_signed_in? %>
|
||||
<% if tournament_permissions(@tournament) %>
|
||||
<%= link_to 'Destroy', mat, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user