X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/215cf287e52da41605cb033da236a6b0aeee4f3a..a48ffbac5ce1517a369ef84426bfe44d6ebad7cb:/app/views/common/_pref_tables.rhtml?ds=inline diff --git a/app/views/common/_pref_tables.rhtml b/app/views/common/_pref_tables.rhtml index 567873b..3a53144 100644 --- a/app/views/common/_pref_tables.rhtml +++ b/app/views/common/_pref_tables.rhtml @@ -2,7 +2,6 @@ <% voters = @election.voters.size %> <% matrix = @election.ssd_result.matrix %> <% victories = @election.ssd_result.victories_and_ties %> -

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.

@@ -47,13 +46,16 @@ parenthesis.

<% candidates.each do |victor| %> <%= white_list(@names[victor]) %> - <% victories[victor].keys.each do |loser| %> - <% margin = victories[victor][loser]%> - <%= white_list(@names[loser]) %> - <% if margin == 0%> + + <% sorted = victories[victor].sort { |first,second| first[1] <=> second[1] }%> + <% sorted.each do |loserpair| %> + <%= white_list(@names[loserpair[0]]) %> + <% if loserpair[1] == 0%> Tied! <% else -%> - (<%= margin%>) + (<%= loserpair[1] %>) <% end -%> <% end -%> @@ -62,3 +64,4 @@ parenthesis.

+