Finished organzing preferential vote tables into one partial. Also changed RubyVote...
[selectricity] / app / views / quickvote / _pref_table.rhtml
diff --git a/app/views/quickvote/_pref_table.rhtml b/app/views/quickvote/_pref_table.rhtml
deleted file mode 100644 (file)
index 011fcbe..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<% 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 -%>
-<% end -%>
-<table class="voterbox">
-  <tr>
-       <td> </td>
-       <% candidates.each do |candidate| -%>
-         <th><%=h names[candidate] -%></th>
-  <% end -%>
-</tr>
-
-<% candidates.each do |winner| -%>
-  <tr>
-       <th><%=h names[winner] %></th>
-  <% candidates.each do |loser| -%> 
-    <% if winner == loser -%>
-      <td> -- </td>
-    <% 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>
-    <% end -%>
-  <% end -%>
- </tr>
-<% end -%>
-</table>

Benjamin Mako Hill || Want to submit a patch?