1 <% candidates = @election.candidates.sort.collect {|candidate| candidate.id}-%>
2 <% voters = @election.voters.size %>
4 <% names = Hash.new -%>
5 <% candidates.each do |candidate| -%>
6 <%names[candidate] = Candidate.find(candidate).name -%>
8 <table class="voterbox">
11 <% candidates.each do |candidate| -%>
12 <th><%= names[candidate] -%></th>
14 <% candidates.each do |winner| -%>
16 <th><%= names[winner] %></th>
17 <% candidates.each do |loser| -%>
18 <% if winner == loser -%>
21 <td><% wins = @election.condorcet_result.matrix[winner][loser]%>
23 <%= sparkline_tag [(wins.to_f/voters.to_f)*100.0], :type => 'pie',
24 :diameter => 25, :share_color => '#74ce00' %>