Fixed the detailed results so that they return anonymized results in
[selectricity] / app / views / elections / detailed_results.rhtml
index 48296d6c667ce9608f60721fe115c5210b79ec25..cfb0e5a273c6f5e1a3738f01742b44511eed6adb 100644 (file)
@@ -1,29 +1,35 @@
-<p>The voting rolls for the last election are are follows.</p>
+<% %>
+
+<p>The voting rolls -- displayed here in alphabetical order -- for the
+last election are are follows.</p>
 
 <h2>Voters</h2>
 <table>
-<% for voter in @voting_rolls.randomize %>
+<% for email in @voter_list %>
 <tr>
-<td><%= voter.email %></td>
+<td><%= email %></td>
 </tr>
 <% end %>
 </table>
 
 <h2>Votes (by Token)</h2>
+
+<p>The votes, listed in alphabetical order by token.</p>
+
 <table border="1">
 <tr>
   <th rowspan="2">Token</th>
   <th colspan="<%= @election.candidates.length %>">Rank of Candidates</th>
 </tr>
 <tr>
-<% for candidate in @election.candidates.sort %>
+<% for candidate in @election.candidates.sort.reverse %>
   <th><%= candidate %></th>
 <% end %>
 </tr>
-<% for voter in @voting_rolls.randomize %>
+<% for vote in @vote_list %>
 <tr>
-<td><%= voter.vote.token %></td>
-<% for ranking in voter.vote %>
+<td><%= vote.token %></td>
+<% for ranking in vote.rankings %>
 <td><%= ranking %></td>
 <% end %>
 </tr>

Benjamin Mako Hill || Want to submit a patch?