mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-12 08:18:44 +00:00
Added pages for teampointsadjust and spearated wrestler and school deducted points
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
<br><%= link_to "Weigh In Page" , "/tournaments/#{@tournament.id}/weigh_in" %>
|
||||
<br><%= link_to "All Matches" , "/tournaments/#{@tournament.id}/matches" %>
|
||||
<br><%= link_to "Full Screen Bout Board" , "/tournaments/#{@tournament.id}/up_matches?print=true" %>
|
||||
<br><%= link_to "Deduct Team Points" , "/tournaments/#{@tournament.id}/teampointadjust" %>
|
||||
<% if can? :destroy, @tournament %>
|
||||
<br><%= link_to "Tournament Delegation" , "/tournaments/#{@tournament.id}/delegate" %>
|
||||
<% end %>
|
||||
|
||||
62
app/views/tournaments/teampointadjust.html.erb
Normal file
62
app/views/tournaments/teampointadjust.html.erb
Normal file
@@ -0,0 +1,62 @@
|
||||
<%= link_to "Back to #{@tournament_name}", "/tournaments/#{@tournament_id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
<h1>New Point Adjustment</h1>
|
||||
</br>
|
||||
</br>
|
||||
<table class="table table-striped table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Wrestler Deducted</th>
|
||||
<th>School Deducted</th>
|
||||
<th>Points To Deduct</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
|
||||
<%= form_for Teampointadjust.new, :url => url_for(:controller => 'tournaments', :action => 'teampointadjust', :method => "post") do |f| %>
|
||||
<td><%= f.collection_select :wrestler_id, @tournament.wrestlers, :id, :name, :include_blank => true %></td>
|
||||
<td><%= f.collection_select :school_id, @tournament.schools, :id, :name, :include_blank => true %></td>
|
||||
<td><%= f.number_field :points, :step => 'any' %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Please leave either wrestler or school blank. Please do not choose both (the team will be double decuted the points)</p>
|
||||
<% if can? :manage, @tournament %>
|
||||
<%= submit_tag "Deduct Points", :class=>"btn btn-success"%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<br>
|
||||
<% if @point_adjustments.size > 0 %>
|
||||
<h1>Point Adjustments</h1>
|
||||
</br>
|
||||
</br>
|
||||
<table class="table table-striped table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Against</th>
|
||||
<th>Points Deducted</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @point_adjustments.each do |point_adjustment| %>
|
||||
<tr>
|
||||
<td><% if point_adjustment.school_id != nil %>
|
||||
<%= point_adjustment.school.name %>
|
||||
<% elsif point_adjustment.wrestler_id != nil %>
|
||||
<%= point_adjustment.wrestler.name %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= point_adjustment.points %></td>
|
||||
<td><%= link_to 'Remove Point Adjustment', "/tournaments/#{@tournament.id}/#{point_adjustment.id}/remove_teampointadjust", method: :delete, confirm: 'Are you sure?', :class=>"btn btn-danger btn-sm" %></td>
|
||||
</tr>
|
||||
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user