1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-05 22:21:26 +00:00

Swap wrestlers moved from edit wrestler to the bracket page

This commit is contained in:
2017-01-31 13:43:56 +00:00
parent bb30b0f916
commit b5d07e103e
3 changed files with 19 additions and 14 deletions

View File

@@ -27,4 +27,21 @@
<% if @weight.wrestlers.size <= 6 && @weight.allPoolMatchesFinished(1) %>
<%= render 'onePoolResults' %>
<% end %>
<% end %>
<% if can? :manage, @tournament %>
<br><br>
<h3>Swap Bracket Position</h3>
<%= form_for(Wrestler.new, url: swap_wrestlers_path(@tournament)) do |f| %>
<div class="field">
<%= f.label 'Wrestler 1' %><br>
<%= f.collection_select :originalId, @weight.wrestlers, :id, :name %>
</div>
<div class="field">
<%= f.label 'Wrestler 2' %><br>
<%= f.collection_select :swapId, @weight.wrestlers, :id, :name %>
</div>
<br>
<%= submit_tag "Swap", :class=>"btn btn-success"%>
<% end %>
<% end %>

View File

@@ -52,19 +52,7 @@
</div>
<% end %>
<% if can? :manage, @wrestler.tournament %>
<br><br>
<h3>Swap Bracket Position</h3>
<%= form_for(Wrestler.new, url: swap_wrestlers_path(@wrestler.tournament)) do |f| %>
<%= f.hidden_field :originalId, :value => @wrestler.id %>
<div class="field">
<%= f.label 'Swap With' %><br>
<%= f.collection_select :swapId, @wrestler.weight.wrestlers, :id, :name %>
</div>
<br>
<%= submit_tag "Swap", :class=>"btn btn-success"%>
<% end %>
<% end %>