diff options
author | guntasgrewal <guntasgrewal@gmail.com> | 2014-04-24 18:42:04 -0400 |
---|---|---|
committer | guntasgrewal <guntasgrewal@gmail.com> | 2014-04-24 18:42:04 -0400 |
commit | 4f89e129721b3740d09d9984ec6da3d6751608a8 (patch) | |
tree | 148a97cbd197438bf1357042415e26e382038cea /lib/scheduling | |
parent | c38a00c8fbc549d1ec45834ee05b19a38d2dd246 (diff) | |
parent | 589149f637cbe5d38c60d6abfa23bc1dfcb8a712 (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'lib/scheduling')
-rw-r--r-- | lib/scheduling/elimination.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb index e66a29a..cf0d625 100644 --- a/lib/scheduling/elimination.rb +++ b/lib/scheduling/elimination.rb @@ -17,7 +17,7 @@ module Scheduling def create_matches num_teams = (self.tournament.players.count/self.tournament.min_players_per_team).floor - num_matches = num_teams - 1 + num_matches = (Float(num_teams - tournament.min_teams_per_match)/(tournament.min_teams_per_match - 1)).ceil + 1 for i in 1..num_matches self.tournament_stage.matches.create(status: 0, submitted_peer_evaluations: 0) end @@ -108,7 +108,7 @@ STRING t = 1 while t <= numTeams - color = (matches[i].teams[t-1] and matches[i].teams[t-1].users.include?(current_user)) ? "#BCED91" : "white" + color = (matches[i].teams[t-1] and matches[i].teams[t-1].users.include?(current_user)) ? "#5BC0DE" : "white" str += "\t\t<rect width=\"#{rw-5}%\" height=\"#{rh*Float(30)/(matchHeight)}%\" x=\"#{rx + 2.5}%\" y=\"#{ry + (Float(t-1)/numTeams)*rh + 2 }%\" fill=\"#{color}\" />\n" if matches[i].teams[t-1] str += "\t\t<text x=\"#{rx + rw/4}%\" y=\"#{ry + (Float(t-1)/numTeams + Float(30)/(matchHeight))*rh}%\" font-size=\"#{rh}\">Team #{matches[i].teams[t-1].id}</text>\n" |