mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-06 22:44:14 +00:00
Added info to match edit (mat -> show) and up_matches pages.
This commit is contained in:
BIN
.tmux.sh.swp
Normal file
BIN
.tmux.sh.swp
Normal file
Binary file not shown.
BIN
app/views/mats/._match_edit_form.html.erb.swp
Normal file
BIN
app/views/mats/._match_edit_form.html.erb.swp
Normal file
Binary file not shown.
@@ -10,15 +10,15 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<h4>Bout <%= @match.bout_number %></h4>
|
<h4>Bout: <%= @match.bout_number %> </h4><h4>Round: <%= @match.round %></h4><h4>Weight: <%= @match.weight_max %> lbs</h4>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= @w1.name %> <select id="w1-color" onchange="changeW1Color(this)">
|
<th><%= @w1.name %> - <%= @w1.school.name %> <select id="w1-color" onchange="changeW1Color(this)">
|
||||||
<option value="green">Green</option>
|
<option value="green">Green</option>
|
||||||
<option value="red">Red</option>
|
<option value="red">Red</option>
|
||||||
</select><br>Last Match: <%= if @w1.lastMatch != nil then time_ago_in_words(@w1.lastMatch.updated_at) end%></th>
|
</select><br>Last Match: <%= if @w1.lastMatch != nil then time_ago_in_words(@w1.lastMatch.updated_at) end%></th>
|
||||||
<th><%= @w2.name %> <select id="w2-color" onchange="changeW2Color(this)">
|
<th><%= @w2.name %> - <%= @w2.school.name %> <select id="w2-color" onchange="changeW2Color(this)">
|
||||||
<option value="red">Red</option>
|
<option value="red">Red</option>
|
||||||
<option value="green">Green</option>
|
<option value="green">Green</option>
|
||||||
</select><br>Last Match: <%= if @w2.lastMatch != nil then time_ago_in_words(@w2.lastMatch.updated_at) end%></th>
|
</select><br>Last Match: <%= if @w2.lastMatch != nil then time_ago_in_words(@w2.lastMatch.updated_at) end%></th>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<%= f.submit onclick: "return confirm('Is the name of the winner ' + document.getElementById('match_winner_id').options[document.getElementById('match_winner_id').selectedIndex].text + '?')", :class=>"btn btn-success" %>
|
<%= f.submit onclick: "return confirm('Is the name of the winner ' + document.getElementById('match_winner_id').options[document.getElementById('match_winner_id').selectedIndex].text + '?')", :class=>"btn btn-success" %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@@ -116,17 +116,17 @@
|
|||||||
w1.stats=document.getElementById("match_w1_stat").value;
|
w1.stats=document.getElementById("match_w1_stat").value;
|
||||||
w2.stats=document.getElementById("match_w2_stat").value;
|
w2.stats=document.getElementById("match_w2_stat").value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function takedown(wrestler){
|
function takedown(wrestler){
|
||||||
updateStats(wrestler,"T2")
|
updateStats(wrestler,"T2")
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateStats(wrestler,text){
|
function updateStats(wrestler,text){
|
||||||
updatejsvalues();
|
updatejsvalues();
|
||||||
wrestler.stats = wrestler.stats + text + " ";
|
wrestler.stats = wrestler.stats + text + " ";
|
||||||
updatehtmlvalues();
|
updatehtmlvalues();
|
||||||
}
|
}
|
||||||
|
|
||||||
//For Changing button colors
|
//For Changing button colors
|
||||||
function changeW1Color(color){
|
function changeW1Color(color){
|
||||||
if (color.value == "red") {
|
if (color.value == "red") {
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
document.getElementById("w2-color").value = "red";
|
document.getElementById("w2-color").value = "red";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeW2Color(color){
|
function changeW2Color(color){
|
||||||
if (color.value == "red") {
|
if (color.value == "red") {
|
||||||
w2Red();
|
w2Red();
|
||||||
@@ -153,15 +153,15 @@
|
|||||||
document.getElementById("w1-color").value = "red";
|
document.getElementById("w1-color").value = "red";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function redColor(id){
|
function redColor(id){
|
||||||
document.getElementById(id).className = "btn btn-danger btn-sm";
|
document.getElementById(id).className = "btn btn-danger btn-sm";
|
||||||
}
|
}
|
||||||
|
|
||||||
function greenColor(id){
|
function greenColor(id){
|
||||||
document.getElementById(id).className = "btn btn-success btn-sm";
|
document.getElementById(id).className = "btn btn-success btn-sm";
|
||||||
}
|
}
|
||||||
|
|
||||||
function w1Red(){
|
function w1Red(){
|
||||||
redColor("w1-takedown");
|
redColor("w1-takedown");
|
||||||
redColor("w1-escape");
|
redColor("w1-escape");
|
||||||
@@ -177,7 +177,7 @@
|
|||||||
redColor("w1-stalling");
|
redColor("w1-stalling");
|
||||||
redColor("w1-caution");
|
redColor("w1-caution");
|
||||||
}
|
}
|
||||||
|
|
||||||
function w1Green(){
|
function w1Green(){
|
||||||
greenColor("w1-takedown");
|
greenColor("w1-takedown");
|
||||||
greenColor("w1-escape");
|
greenColor("w1-escape");
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
greenColor("w1-stalling");
|
greenColor("w1-stalling");
|
||||||
greenColor("w1-caution");
|
greenColor("w1-caution");
|
||||||
}
|
}
|
||||||
|
|
||||||
function w2Red(){
|
function w2Red(){
|
||||||
redColor("w2-takedown");
|
redColor("w2-takedown");
|
||||||
redColor("w2-escape");
|
redColor("w2-escape");
|
||||||
@@ -209,7 +209,7 @@
|
|||||||
redColor("w2-stalling");
|
redColor("w2-stalling");
|
||||||
redColor("w2-caution");
|
redColor("w2-caution");
|
||||||
}
|
}
|
||||||
|
|
||||||
function w2Green(){
|
function w2Green(){
|
||||||
greenColor("w2-takedown");
|
greenColor("w2-takedown");
|
||||||
greenColor("w2-escape");
|
greenColor("w2-escape");
|
||||||
|
|||||||
@@ -24,15 +24,15 @@
|
|||||||
<th>Warm Up</th>
|
<th>Warm Up</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @mats.each.map do |m| %>
|
<% @mats.each.map do |m| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= m.name %></td>
|
<td><%= m.name %></td>
|
||||||
<td><% if m.unfinishedMatches.first %><%=m.unfinishedMatches.first.bout_number%><br><%= m.unfinishedMatches.first.w1_name %> vs. <%= m.unfinishedMatches.first.w2_name %><% end %></td>
|
<td><% if m.unfinishedMatches.first %><strong><%=m.unfinishedMatches.first.bout_number%></strong> - <%= m.unfinishedMatches.first.weight_max %> lbs<br><%= m.unfinishedMatches.first.w1_name %> vs. <%= m.unfinishedMatches.first.w2_name %><% end %></td>
|
||||||
<td><% if m.unfinishedMatches.second %><%=m.unfinishedMatches.second.bout_number%><br><%= m.unfinishedMatches.second.w1_name %> vs. <%= m.unfinishedMatches.second.w2_name %><% end %></td>
|
<td><% if m.unfinishedMatches.second %><strong><%=m.unfinishedMatches.second.bout_number%></strong> - <%= m.unfinishedMatches.second.weight_max %> lbs<br><%= m.unfinishedMatches.second.w1_name %> vs. <%= m.unfinishedMatches.second.w2_name %><% end %></td>
|
||||||
<td><% if m.unfinishedMatches.third %><%=m.unfinishedMatches.third.bout_number%><br><%= m.unfinishedMatches.third.w1_name %> vs. <%= m.unfinishedMatches.third.w2_name %><% end %></td>
|
<td><% if m.unfinishedMatches.third %><strong><%=m.unfinishedMatches.third.bout_number%></strong> - <%= m.unfinishedMatches.third.weight_max %> lbs<br><%= m.unfinishedMatches.third.w1_name %> vs. <%= m.unfinishedMatches.third.w2_name %><% end %></td>
|
||||||
<td><% if m.unfinishedMatches.fourth %><%=m.unfinishedMatches.fourth.bout_number%><br><%= m.unfinishedMatches.fourth.w1_name %> vs. <%= m.unfinishedMatches.fourth.w2_name %><% end %></td>
|
<td><% if m.unfinishedMatches.fourth %><strong><%=m.unfinishedMatches.fourth.bout_number%></strong> - <%= m.unfinishedMatches.fourth.weight_max %> lbs<br><%= m.unfinishedMatches.fourth.w1_name %> vs. <%= m.unfinishedMatches.fourth.w2_name %><% end %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<th>Matchup</th>
|
<th>Matchup</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<% if @matches.size > 0 %>
|
<% if @matches.size > 0 %>
|
||||||
<% @matches.each.map do |m| %>
|
<% @matches.each.map do |m| %>
|
||||||
@@ -63,6 +63,6 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user