1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-24 17:04:43 +00:00

Added info to match edit (mat -> show) and up_matches pages.

This commit is contained in:
2017-11-13 08:42:16 -05:00
parent 94bb5affa3
commit 5cfcfe0448
4 changed files with 21 additions and 21 deletions

BIN
.tmux.sh.swp Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -10,15 +10,15 @@
</ul>
</div>
<% 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">
<thead>
<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="red">Red</option>
</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="green">Green</option>
</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">
<%= 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>
<% end %>
@@ -116,17 +116,17 @@
w1.stats=document.getElementById("match_w1_stat").value;
w2.stats=document.getElementById("match_w2_stat").value;
}
function takedown(wrestler){
updateStats(wrestler,"T2")
}
function updateStats(wrestler,text){
updatejsvalues();
wrestler.stats = wrestler.stats + text + " ";
updatehtmlvalues();
}
//For Changing button colors
function changeW1Color(color){
if (color.value == "red") {
@@ -140,7 +140,7 @@
document.getElementById("w2-color").value = "red";
}
}
function changeW2Color(color){
if (color.value == "red") {
w2Red();
@@ -153,15 +153,15 @@
document.getElementById("w1-color").value = "red";
}
}
function redColor(id){
document.getElementById(id).className = "btn btn-danger btn-sm";
}
function greenColor(id){
document.getElementById(id).className = "btn btn-success btn-sm";
}
function w1Red(){
redColor("w1-takedown");
redColor("w1-escape");
@@ -177,7 +177,7 @@
redColor("w1-stalling");
redColor("w1-caution");
}
function w1Green(){
greenColor("w1-takedown");
greenColor("w1-escape");
@@ -193,7 +193,7 @@
greenColor("w1-stalling");
greenColor("w1-caution");
}
function w2Red(){
redColor("w2-takedown");
redColor("w2-escape");
@@ -209,7 +209,7 @@
redColor("w2-stalling");
redColor("w2-caution");
}
function w2Green(){
greenColor("w2-takedown");
greenColor("w2-escape");

View File

@@ -24,15 +24,15 @@
<th>Warm Up</th>
</tr>
</thead>
<tbody>
<% @mats.each.map do |m| %>
<tr>
<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.second %><%=m.unfinishedMatches.second.bout_number%><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.fourth %><%=m.unfinishedMatches.fourth.bout_number%><br><%= m.unfinishedMatches.fourth.w1_name %> vs. <%= m.unfinishedMatches.fourth.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 %><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 %><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 %><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>
<% end %>
</tbody>
@@ -49,7 +49,7 @@
<th>Matchup</th>
</tr>
</thead>
<tbody>
<% if @matches.size > 0 %>
<% @matches.each.map do |m| %>
@@ -63,6 +63,6 @@
<% end %>
</tbody>
</table>
<br>
<% end %>