<% candidates = @election.candidates.sort.collect {|candidate| candidate.id}-%>
<% voters = @election.voters.size %>
-
+<% matrix = @election.condorcet_result.matrix %>
<% names = Hash.new -%>
<% candidates.each do |candidate| -%>
<%names[candidate] = Candidate.find(candidate).name -%>
<% candidates.each do |loser| -%>
<% if winner == loser -%>
<td> -- </td>
- <% else %>
- <td><% wins = @election.condorcet_result.matrix[winner][loser]%>
+ <% else %>
+ <td><% wins = matrix[winner][loser] unless matrix[winner].nil?%>
<%= wins %>
<%= sparkline_tag [(wins.to_f/voters.to_f)*100.0], :type => 'pie',
:diameter => 25, :share_color => '#74ce00' %>