Added processing and presentatin of results.
[selectricity] / app / views / elections / _winner_details.rhtml
diff --git a/app/views/elections/_winner_details.rhtml b/app/views/elections/_winner_details.rhtml
new file mode 100644 (file)
index 0000000..0903952
--- /dev/null
@@ -0,0 +1,28 @@
+<% %>
+<p>The matrix listing the number of times that any candidate was
+preferred to any other candidates is listed here:</p>
+
+<table border="1">
+<tr>
+<th></th>
+<% for candidate in @election.candidates.sort %>
+  <th><%= candidate.name %></th>
+<% end %>
+</tr>
+<% for cand1 in @election.candidates.sort %>
+  <tr>
+  <th><%= cand1.name %></th>
+  <% for cand2 in @election.candidates.sort %>
+    <td>
+    <% if cand1 == cand2 %>
+      N/A
+      <% next %>
+    <% else %>
+      <%= @voteobj.votes[cand1.id][cand2.id] %>
+    <% end %>
+    </td>
+  <% end %>
+  </tr>
+<% end %>
+</table>
+

Benjamin Mako Hill || Want to submit a patch?