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

136 lines
3.6 KiB
Plaintext

<h3>
Info
</h3>
<p>
<strong>Address:</strong>
<%= @tournament.address %>
</p>
<p>
<strong>Director:</strong>
<%= @tournament.director %>
</p>
<p>
<strong>Director email:</strong>
<%= @tournament.director_email %>
</p>
<p>
<strong>Tournament Type:</strong>
<%= @tournament.tournament_type %>
</p>
<br>
<h3>Schools</h3>
<p>Click to see lineups, bout numbers, score breakdowns, and stats. Brackets can be found in the white nav-bar up top.</p>
<br>
<table class="table table-hover table-condensed">
<thead>
<tr>
<th>Name</th>
<% if can? :manage, @tournament %><th><%= link_to " New School" , "/schools/new?tournament=#{@tournament.id}", :class=>"fas fa-plus" %></th><% end %>
</tr>
</thead>
<tbody>
<% @schools.each do |school| %>
<tr>
<td><%= link_to "#{school.name}", school %>
<% if can? :manage, school %>
<td><%= link_to '', edit_school_path(school), :class=>"fas fa-edit" %>
<% if can? :manage, @tournament %>
<%= link_to '', school, method: :delete, data: { confirm: "Are you sure you want to delete #{school.name}?" }, :class=>"fas fa-trash-alt" %>
<% end %>
</td>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<br>
<h3>Weight Class Seeds</h3>
<br>
<table class="table table-hover table-condensed">
<thead>
<tr>
<th>Weight Class</th>
<th>Bracket Size</th>
<% if can? :manage, @tournament %><th><%= link_to " New Weight Class" , "/weights/new?tournament=#{@tournament.id}", :class=>"fas fa-plus" %></th><% end %>
</tr>
</thead>
<tbody>
<% @weights.each do |weight| %>
<tr>
<td><%= link_to "#{weight.max} lbs", weight %></td>
<td><%= weight.bracket_size %></td>
<% if can? :manage, @tournament %>
<td>
<%= link_to '', edit_weight_path(weight), :class=>"fas fa-edit" %>
<%= link_to '', weight, method: :delete, data: { confirm: "Are you sure you want to delete the #{weight.max} weight class?" }, :class=>"fas fa-trash-alt" %>
</td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
<% if can? :manage, @tournament %>
<br>
<br>
<h3>Mats</h3><br>
<table class="table table-hover table-condensed">
<thead>
<tr>
<th>Name</th>
<th><%= link_to " New Mat" , "/mats/new?tournament=#{@tournament.id}", :class=>"fas fa-plus" %></th>
</tr>
</thead>
<tbody>
<% @mats.each do |mat| %>
<tr>
<td><%= link_to "Mat #{mat.name}", mat %></td>
<% if can? :manage, @tournament %>
<td>
<%= link_to '', mat, method: :delete, data: { confirm: "Are you sure you want to delete Mat #{mat.name}?" }, :class=>"fas fa-trash-alt" %>
</td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<% if can? :manage, @tournament %>
<br>
<h3>Background Jobs</h3>
<p>This is a list of queued or running background jobs. Match generation, bracket advancement, team score calculation, etc.</p>
<table class="table table-hover table-condensed">
<thead>
<tr>
<th>Name of Job</th>
<th>Job Status</th>
</tr>
</thead>
<tbody>
<% @tournament.deferred_jobs.each do |job| %>
<tr>
<td><%= job.job_owner_type %></td>
<td>
<% if job.locked_at %>
Running
<% elsif job.last_error %>
Error
<% elsif job.attempts == 0 and !job.locked_at %>
Pending
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<br>
<br>
<%= render 'import_form' %>