Added the Gruff library to the lib/ directory of the the rails folder, and the
[selectricity] / app / views / quickvote / _pref_tables.rhtml
index 66e0cbf2df1fbf7870581ca6ed849b66db2c7f21..628ce55ca5d873474e149fdc4097109cf8512799 100644 (file)
@@ -2,22 +2,20 @@
 <% voters = @election.voters.size %>
 <% matrix = @election.condorcet_result.matrix %>
 <% victories = @election.condorcet_result.victories_and_ties %>
-<% names = @election.names_by_id %>
-
 
 <!-- This table shows how many times each choice was ranked above the other, 
        with percentages-->
-<table class="voterbox">
+<table class="preftable">
   <tr>
-       <td> </td>
+       <td></td>
        <% candidates.each do |candidate| -%>
-         <th><%=h names[candidate] -%></th>
+         <th><%=h @names[candidate] -%></th>
   <% end -%>
  </tr>
 
 <% candidates.each do |winner| -%>
   <tr>
-       <th><%=h names[winner] %></th>
+       <th><%=h @names[winner] %></th>
   <% candidates.each do |loser| -%> 
     <% if winner == loser -%>
       <td> -- </td>
 </table>
 
 <!-- This table generates a margin of victory -->
-<table class="voterbox">
+<table class="preftable">
   <% candidates.each do |victor| %>
   <tr>
-    <th><%=h names[victor] %></th>
+    <th><%=h @names[victor] %></th>
        <% victories[victor].keys.each do |loser| %>
        <% margin = victories[victor][loser]%>
-       <td><%=h names[loser] %> 
+       <td><%=h @names[loser] %> 
            <% if margin == 0%>
                  Tied!
                <% else -%>
                  (<%= margin%>)
                <% end -%>
-                 </td>
+       </td>
        <% end -%>
   </tr>
   <% end -%>
 </table>
-

Benjamin Mako Hill || Want to submit a patch?