mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-08 23:34:51 +00:00
Created a weigh in page
This commit is contained in:
63
app/views/static_pages/weigh_in.html.erb
Normal file
63
app/views/static_pages/weigh_in.html.erb
Normal file
@@ -0,0 +1,63 @@
|
||||
<%= link_to "Back to #{@tournament_name}", "/tournaments/#{@tournament_id}", :class=>"btn btn-default" %>
|
||||
<br>
|
||||
<br>
|
||||
<% if @tournament %>
|
||||
<% @weights.each do |weight| %>
|
||||
<%= link_to "#{weight.max}" , "/static_pages/weigh_in?weight=#{weight.id}" %>
|
||||
<br>
|
||||
<% end %>
|
||||
<br>
|
||||
<% if user_signed_in? %>
|
||||
<%= form_for(@tournament) do |f| %>
|
||||
<div class="field">
|
||||
<%= f.label :weigh_in_ref %><br>
|
||||
<%= f.text_field :weigh_in_ref %>
|
||||
</div>
|
||||
<br>
|
||||
<%= f.submit 'Submit', :class=>"btn btn-success" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if @weight %>
|
||||
<%= link_to "Back to weigh in weights","/static_pages/weigh_in?tournament=#{@tournament_id}", :class=>"btn btn-default" %>
|
||||
<br><br>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>School</th>
|
||||
<th>Seed</th>
|
||||
<th>Weight Class</th>
|
||||
<th>Offical Weight</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= form_tag @wrestlers_update_path do %>
|
||||
<% @wrestlers.order("original_seed asc").each do |wrestler| %>
|
||||
<% if wrestler.weight_id == @weight.id %>
|
||||
<tr>
|
||||
<td><%= wrestler.name %></td>
|
||||
<td><%= School.find(wrestler.school_id).name %></td>
|
||||
<td><%= wrestler.weight.max %></td>
|
||||
<td><%= wrestler.original_seed %></td>
|
||||
<td>
|
||||
<% if user_signed_in? %>
|
||||
<%= fields_for "wrestler[]", wrestler do |w| %>
|
||||
<%= w.number_field :offical_weight, :step => 'any' %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= wrestler.offical_weight %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= hidden_field_tag :tournament, @tournament_id %>
|
||||
<% if user_signed_in? %>
|
||||
<%= submit_tag "Save", :class=>"btn btn-success"%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -32,6 +32,8 @@
|
||||
<br>
|
||||
<% if user_signed_in? %>
|
||||
<%= 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" %>
|
||||
<br>
|
||||
<br>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user