mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-07 23:17:25 +00:00
Fixed redirect for match editing and added controller tests. Added wrestler school name to match edit form. Added authorization tests to all matches page.
This commit is contained in:
@@ -14,14 +14,18 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= @w1.name %> <select id="w1-color" onchange="changeW1Color(this)">
|
||||
<th>Name: <%= @w1.name %> <select id="w1-color" onchange="changeW1Color(this)">
|
||||
<option value="green">Green</option>
|
||||
<option value="red">Red</option>
|
||||
</select><br>Last Match: <%= if @w1.last_match != nil then time_ago_in_words(@w1.last_match.updated_at) end%></th>
|
||||
<th><%= @w2.name %> <select id="w2-color" onchange="changeW2Color(this)">
|
||||
</select>
|
||||
<br>School: <%= @w1.school.name %>
|
||||
<br>Last Match: <%= if @w1.last_match != nil then time_ago_in_words(@w2.last_match.updated_at) else "N/A" end%></th>
|
||||
<th>Name: <%= @w2.name %> <select id="w2-color" onchange="changeW2Color(this)">
|
||||
<option value="red">Red</option>
|
||||
<option value="green">Green</option>
|
||||
</select><br>Last Match: <%= if @w2.last_match != nil then time_ago_in_words(@w2.last_match.updated_at) end%></th>
|
||||
</select>
|
||||
<br>School: <%= @w2.school.name %>
|
||||
<br>Last Match: <%= if @w2.last_match != nil then time_ago_in_words(@w2.last_match.updated_at) else "N/A" end%></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -89,7 +93,6 @@
|
||||
|
||||
<%= f.hidden_field :finished, :value => 1 %>
|
||||
<%= f.hidden_field :round, :value => @match.round %>
|
||||
<%= f.hidden_field :redirect_path, :value => @redirect_path %>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
<h1><%= @w1.name %> VS. <%= @w2.name %></h1>
|
||||
<% @redirect_path = "/tournaments/#{@tournament.id}/matches" %>
|
||||
<%= render 'form' %>
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
<strong>Mat <%= @mat.name %></strong>
|
||||
</p>
|
||||
<h3>Mat <%= @mat.name %></h3>
|
||||
<h3>Tournament: <%= @mat.tournament.name %></h3>
|
||||
|
||||
<p>
|
||||
<strong>Tournament:</strong>
|
||||
<%= @mat.tournament.name %>
|
||||
</p>
|
||||
<% @redirect_path = request.original_fullpath %>
|
||||
<% if @match %>
|
||||
<%= render 'matches/form' %>
|
||||
<% else %>
|
||||
|
||||
Reference in New Issue
Block a user