1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-11 16:01:56 +00:00

Cleaning up main tournament page and tournament controller

This commit is contained in:
2015-06-30 13:43:09 +00:00
parent 3f3cc7014b
commit 0fddccf6f5
2 changed files with 36 additions and 45 deletions

View File

@@ -61,14 +61,6 @@ class TournamentsController < ApplicationController
end end
end end
def createHsWeights
if params[:tournament]
if user_signed_in?
@tournament.createHsWeights
end
redirect_to "/tournaments/#{@tournament.id}"
end
end
# DELETE /tournaments/1 # DELETE /tournaments/1
# DELETE /tournaments/1.json # DELETE /tournaments/1.json
def destroy def destroy

View File

@@ -30,19 +30,19 @@
<%= @tournament.tournament_type %> <%= @tournament.tournament_type %>
</p> </p>
<br> <br>
<br>
<% if user_signed_in? %> <% if user_signed_in? %>
<br>
<%= link_to "Generate Pool Matches" , "/static_pages/generate_matches?tournament=#{@tournament.id}", :class=>"btn btn-danger" %> <%= link_to "Generate Pool Matches" , "/static_pages/generate_matches?tournament=#{@tournament.id}", :class=>"btn btn-danger" %>
<% end %>
<br> <br>
<br> <br>
<% end %>
<br>
<h3>School Lineups</h3> <h3>School Lineups</h3>
<br> <br>
<% if user_signed_in? %><%= link_to "New #{@tournament.name} School" , "/schools/new?tournament=#{@tournament.id}", :class=>"btn btn-default" %><% end %> <% if user_signed_in? %>
<br> <%= link_to "New #{@tournament.name} School" , "/schools/new?tournament=#{@tournament.id}", :class=>"btn btn-default" %>
<br> <br>
<br>
<% end %>
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead> <thead>
<tr> <tr>
@@ -76,9 +76,9 @@
<%= link_to "New #{@tournament.name} Weight" , "/weights/new?tournament=#{@tournament.id}", :class=>"btn btn-default" %> <%= link_to "New #{@tournament.name} Weight" , "/weights/new?tournament=#{@tournament.id}", :class=>"btn btn-default" %>
<br> <br>
<%= link_to "Create HS Weights" , "/static_pages/createCustomWeights?tournament=#{@tournament.id}&customValue=hs", :class=>"btn btn-default" %> <%= link_to "Create HS Weights" , "/static_pages/createCustomWeights?tournament=#{@tournament.id}&customValue=hs", :class=>"btn btn-default" %>
<br>
<br>
<% end %> <% end %>
<br>
<br>
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead> <thead>
<tr> <tr>
@@ -104,37 +104,36 @@
</tbody> </tbody>
</table> </table>
<br>
<br>
<h3>Mats</h3>
<br>
<% if user_signed_in? %> <% if user_signed_in? %>
<%= link_to "New #{@tournament.name} Mat" , "/mats/new?tournament=#{@tournament.id}", :class=>"btn btn-default" %> <br>
<br> <br>
<br> <h3>Mats</h3>
<% end %> <br>
<table class="table table-striped table-bordered"> <%= link_to "New #{@tournament.name} Mat" , "/mats/new?tournament=#{@tournament.id}", :class=>"btn btn-default" %>
<thead> <br>
<tr> <br>
<th>Name</th> <table class="table table-striped table-bordered">
<th></th> <thead>
</tr>
</thead>
<tbody>
<% @mats.each do |mat| %>
<tr> <tr>
<td><%= mat.name %></td> <th>Name</th>
<td> <th></th>
<% if user_signed_in? %>
<%= link_to 'Destroy', mat, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
<% end %>
</td>
</tr> </tr>
<% end %> </thead>
</tbody>
</table> <tbody>
<% @mats.each do |mat| %>
<tr>
<td><%= mat.name %></td>
<td>
<% if user_signed_in? %>
<%= link_to 'Destroy', mat, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"btn btn-danger" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>