X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/4e7a42adf9f2cb9319265596d73ed10d978e5f81..ee7a5c7130df812e96922e9f47ed9355cc78e72c:/app/views/quickvote/_pref_table.rhtml diff --git a/app/views/quickvote/_pref_table.rhtml b/app/views/quickvote/_pref_table.rhtml index a3ba63d..011fcbe 100644 --- a/app/views/quickvote/_pref_table.rhtml +++ b/app/views/quickvote/_pref_table.rhtml @@ -1,6 +1,6 @@ <% 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 -%> @@ -19,9 +19,9 @@ <% candidates.each do |loser| -%> <% if winner == loser -%> -- - <% else %> - <% wins = @election.condorcet_result.matrix[winner][loser]%> - <%=h wins %> + <% else %> + <% 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' %>