fixed a large number of bugs in the software (see wiki) over a days work
[selectricity] / app / views / common / details.rhtml
diff --git a/app/views/common/details.rhtml b/app/views/common/details.rhtml
new file mode 100644 (file)
index 0000000..ae09c29
--- /dev/null
@@ -0,0 +1,63 @@
+<% @votes = @election.votes.select {|v| v.confirmed? }.shuffle %>
+<% @voters = @votes.collect {|v| v.voter}.shuffle %>
+
+<div id="title-header">
+  <span class="header">Details</span>
+  <span class="subheader"><%= @election.name %></span>
+</div>
+
+<p>This page contains information useful for auditing elections and
+verifying that votes were tabulated correctly.</p>
+
+<p>The following invididuals (in random order) voted in this
+election:</p>
+
+<ol>
+<%- @voters.each do |voter| -%>
+<li><% if voter.email %>
+       <%= voter.email %>
+    <% elsif @election.kiosk? %>
+       Kiosk Voter
+    <% else %>
+       Unknown voter
+    <% end %></li>
+<%- end -%>
+</ol>
+
+<p>The following table lists the votes cast in random order.</p>
+
+<p><% if @election.verifiable %>The column marked <em>Verification
+Token</em> lists tokens that were given to voters at the time of voting.
+Voters can check to see that the vote that corresponds to their token
+was recorded correctly.<% end %> The column marked <em>Vote</em> lists
+the candidates in order of the voter's preference. To read these votes,
+refer to the key below.</p>
+
+<table class="preftable">
+<tr>
+<th></th>
+<% if @election.verifiable %><th>Verification Token</th><% end %>
+<th>Vote</th>
+<%- @votes.each_with_index do |vote, i| -%>
+<tr>
+<td><%= i + 1 %></td>
+<% if @election.verifiable %><td><%= vote.token %></td><% end %>
+<td><%= vote.votestring%></td>
+</tr>
+<%- end -%>
+</table>
+
+<p style="margin-top: 1em;">Key:</p>
+
+<table class="preftable">
+<tr>
+<th>Code</th>
+<th>Candidate</th>
+<%- @election.candidates.sort.each_with_index do |c, i| -%>
+<tr>
+<td><%= (i + 65).chr %></td>
+<td><%= c.name %></td>
+</tr>
+<%- end -%>
+</table>
+

Benjamin Mako Hill || Want to submit a patch?