diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2014-04-27 21:30:16 -0400 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2014-04-27 21:30:16 -0400 |
commit | ee1eaebb77048d3e3537b5f1f9aead5dc379f849 (patch) | |
tree | 0b6c73f2641c94dd353f6b28550260f26aaed25d /app/views/tournaments/standings.html.erb | |
parent | 83aa6970f730005d8322402ee316e2731fd42506 (diff) | |
parent | 0f6489cdfcc1c75500a66bc906a13b98629e0617 (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/views/tournaments/standings.html.erb')
-rw-r--r-- | app/views/tournaments/standings.html.erb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/app/views/tournaments/standings.html.erb b/app/views/tournaments/standings.html.erb index 28d3c22..b8739de 100644 --- a/app/views/tournaments/standings.html.erb +++ b/app/views/tournaments/standings.html.erb @@ -1,4 +1,7 @@ -<% playerscores = @tournament.players.collect {|player| player => tournament.statistics.getStatistic(player.matches.last, player, :score) } %> +<% playerscores = @tournament.players.collect {|player| player => @tournament.statistics.getStatistic(player.matches.last, player, :score) } %> +<% teams = tournament_stage.matches.collect +{ |match| match.teams.collect { |team| team.id => team.players.collect +{ |player| player.user_name => @tournament.statistics.getStatistic(player.matches.last, player, :score } } } %> <table> <tr> @@ -9,4 +12,17 @@ <% place += 1%> <% end %> </tr> -</table>
\ No newline at end of file +</table> + +<% teams.each do |team| %> + <table> + <tr> + <td>Standings:</td> + <% place = 0 %> + <% team.values.sort {|player1, player2| playerscores[player1] <=> playerscores[player2] }.each |player| %> + <td><%= place.to_s + ":" %> <%= player.user_name %></td> + <% place += 1%> + <% end %> + </tr> + </table> +<% end %>
\ No newline at end of file |