summaryrefslogtreecommitdiff
path: root/lib/scheduling
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-22 18:33:41 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-22 18:33:41 -0400
commit7bb14aca1a6881e37c4bc6c1bd89fc2f126386db (patch)
treeccb3fddeebea616f38a9dd3f7eb6fba591bbd9ce /lib/scheduling
parentc0ae56e4974a14433a58951c031d4b4c74f57935 (diff)
fix paren thing
Diffstat (limited to 'lib/scheduling')
-rw-r--r--lib/scheduling/elimination.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb
index 5ce71ca..055fdbd 100644
--- a/lib/scheduling/elimination.rb
+++ b/lib/scheduling/elimination.rb
@@ -92,7 +92,7 @@ STRING
end
str += "/>\n"
- color = matches[i].teams.first and matches[i].teams.first.users.include?(current_user) ? "#BCED91" : "white"
+ color = (matches[i].teams[0] and matches[i].teams[0].users.include?(current_user)) ? "#BCED91" : "white"
str += "\t\t<rect width=\"#{rw-5}%\" height=\"#{rh/4}%\" x=\"#{rx + 2.5}%\" y=\"#{ry + rh/6}%\" fill=\"#{color}\" />\n"
if matches[i].teams.first
str += "\t\t<text x=\"#{rx + rw/4}%\" y=\"#{ry + rh/3}%\" font-size=\"#{rh}\">Team #{matches[i].teams.first.id}</text>\n"
@@ -100,7 +100,7 @@ STRING
str += "\t\t<text x=\"#{rx + 1.3*rw/3}%\" y=\"#{ry + 5.2*rh/9}%\" font-size=\"#{rh}\"> VS </text>\n"
- color = matches[i].teams[1] and matches[i].teams[1].users.include?(current_user) ? "#BCED91" : "white"
+ color = (matches[i].teams[1] and matches[i].teams[1].users.include?(current_user)) ? "#BCED91" : "white"
str += "\t\t<rect width=\"#{rw-5}%\" height=\"#{rh/4}%\" x=\"#{rx + 2.5}%\" y=\"#{ry + 3*rh/5}%\" fill=\"#{color}\" />\n"
if matches[i].teams[1]
str += "\t\t<text x=\"#{rx + rw/4}%\" y=\"#{ry + 4*rh/5}%\" font-size=\"#{rh}\">Team #{matches[i].teams[1].id}</text>\n"