projects
/
selectricity-live
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from head
[selectricity-live]
/
app
/
views
/
quickvote
/
_pref_table.rhtml
diff --git
a/app/views/quickvote/_pref_table.rhtml
b/app/views/quickvote/_pref_table.rhtml
index a3ba63d7faac2af1dfa85a02c67c3dc26fa78e42..011fcbe8ac2d29aa7b2147797e249f99c3b57389 100644
(file)
--- 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 %>
<% 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 -%>
<% names = Hash.new -%>
<% candidates.each do |candidate| -%>
<%names[candidate] = Candidate.find(candidate).name -%>
@@
-19,9
+19,9
@@
<% candidates.each do |loser| -%>
<% if winner == loser -%>
<td> -- </td>
<% candidates.each do |loser| -%>
<% if winner == loser -%>
<td> -- </td>
- <% else %>
- <td><% wins =
@election.condorcet_result.matrix[winner][loser]
%>
- <%=
h
wins %>
+ <% 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' %>
</td>
<%= sparkline_tag [(wins.to_f/voters.to_f)*100.0], :type => 'pie',
:diameter => 25, :share_color => '#74ce00' %>
</td>
Benjamin Mako Hill
||
Want to submit a patch?