added support for results for full elections
[selectricity] / app / views / quickvote / _pref_tables.rhtml
diff --git a/app/views/quickvote/_pref_tables.rhtml b/app/views/quickvote/_pref_tables.rhtml
deleted file mode 100644 (file)
index b9d41ec..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<% candidates = @election.ssd_result.ranked_candidates.flatten -%>
-<% voters = @election.voters.size %>
-<% matrix = @election.ssd_result.matrix %>
-<% victories = @election.ssd_result.victories_and_ties %>
-
-<% if candidates.size <= 7 -%>
-
-<p>Each number in the table below shows how many times the candidate on
-the left beat the matching candidate on the top. The winner is on the
-top of the left column.</p>
-
-<!-- This table shows how many times each choice was ranked above the other, 
-       with percentages-->
-<div class="result_table">
-<table class="preftable">
-  <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>
-</div>
-<!-- This table generates a margin of victory -->
-
-<p>A simplification of the above data. The winner is on the left; each
-cell names the defeated candidate and the magnitude of the victory in
-parenthesis.</p>
-
-<div class="result_table">
-<table class="preftable">
-  <% candidates.each do |victor| %>
-  <tr>
-    <th><%=h @names[victor] %></th>
-       <% victories[victor].keys.each do |loser| %>
-       <% margin = victories[victor][loser]%>
-       <td><%=h @names[loser] %> 
-           <% if margin == 0%>
-                 Tied!
-               <% else -%>
-                 (<%= margin%>)
-               <% end -%>
-       </td>
-       <% end -%>
-  </tr>
-  <% end -%>
-</table>
-</div>
-<% end -%>
-

Benjamin Mako Hill || Want to submit a patch?