mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-10 23:53:06 +00:00
Showing next bout number and mat on school show page
This commit is contained in:
@@ -20,6 +20,14 @@ class Match < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mat_assigned
|
||||||
|
if self.mat
|
||||||
|
"Mat #{self.mat.name}"
|
||||||
|
else
|
||||||
|
""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def advance_wrestlers
|
def advance_wrestlers
|
||||||
if self.w1? && self.w2?
|
if self.w1? && self.w2?
|
||||||
@w1 = wrestler1
|
@w1 = wrestler1
|
||||||
|
|||||||
@@ -34,6 +34,30 @@ class Wrestler < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
points
|
points
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def nextMatch
|
||||||
|
unfinishedMatches.first
|
||||||
|
end
|
||||||
|
|
||||||
|
def nextMatchBoutNumber
|
||||||
|
if nextMatch
|
||||||
|
nextMatch.bout_number
|
||||||
|
else
|
||||||
|
""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def nextMatchMatName
|
||||||
|
if nextMatch
|
||||||
|
nextMatch.mat_assigned
|
||||||
|
else
|
||||||
|
""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def unfinishedMatches
|
||||||
|
allMatches.select{|m| m.finished != 1}.sort_by{|m| m.bout_number}
|
||||||
|
end
|
||||||
|
|
||||||
def resultByBout(bout)
|
def resultByBout(bout)
|
||||||
@match = allMatches.select{|m| m.bout_number == bout and m.finished == 1}
|
@match = allMatches.select{|m| m.bout_number == bout and m.finished == 1}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
<th>Seed Criteria</th>
|
<th>Seed Criteria</th>
|
||||||
<th>Team Points Scored</th>
|
<th>Team Points Scored</th>
|
||||||
<th>Extra?</th>
|
<th>Extra?</th>
|
||||||
|
<th>Next Bout/Mat</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
<td><% if wrestler.extra? == true %>
|
<td><% if wrestler.extra? == true %>
|
||||||
Yes
|
Yes
|
||||||
<% end %></td>
|
<% end %></td>
|
||||||
|
<td><%= wrestler.nextMatchBoutNumber %> <%= wrestler.nextMatchMatName %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to 'Show', wrestler , :class=>"btn btn-default" %>
|
<%= link_to 'Show', wrestler , :class=>"btn btn-default" %>
|
||||||
<% if tournament_permissions(@school.tournament) %>
|
<% if tournament_permissions(@school.tournament) %>
|
||||||
|
|||||||
Reference in New Issue
Block a user