]> projects.mako.cc - selectricity/blob - app/views/quickvote/_pref_table.rhtml
Merge from Justin
[selectricity] / app / views / quickvote / _pref_table.rhtml
1 <% candidates = @election.candidates.sort.collect {|candidate| candidate.id} -%>
2 <table class="voterbox">
3   <tr>
4         <td> </td>
5         <% candidates.each do |candidate| -%>
6           <th><%= candidate -%></th>
7         <% end -%>
8 <% candidates.each do |winner| -%>
9   <tr>
10         <th><%= winner %></th>
11   <% candidates.each do |loser| -%> 
12     <% if winner == loser -%>
13       <td> -- </td>
14     <% else %>         
15       <td><%= @election.condorcet_result.matrix[winner][loser] %></td>
16     <% end -%>
17   <% end -%>
18  </tr>
19 <%end -%>

Benjamin Mako Hill || Want to submit a patch?