fixed a large number of bugs in the software (see wiki) over a days work
[selectricity-live] / app / views / common / details.rhtml
1 <% @votes = @election.votes.select {|v| v.confirmed? }.shuffle %>
2 <% @voters = @votes.collect {|v| v.voter}.shuffle %>
3
4 <div id="title-header">
5   <span class="header">Details</span>
6   <span class="subheader"><%= @election.name %></span>
7 </div>
8
9 <p>This page contains information useful for auditing elections and
10 verifying that votes were tabulated correctly.</p>
11
12 <p>The following invididuals (in random order) voted in this
13 election:</p>
14
15 <ol>
16 <%- @voters.each do |voter| -%>
17 <li><% if voter.email %>
18        <%= voter.email %>
19     <% elsif @election.kiosk? %>
20        Kiosk Voter
21     <% else %>
22        Unknown voter
23     <% end %></li>
24 <%- end -%>
25 </ol>
26
27 <p>The following table lists the votes cast in random order.</p>
28
29 <p><% if @election.verifiable %>The column marked <em>Verification
30 Token</em> lists tokens that were given to voters at the time of voting.
31 Voters can check to see that the vote that corresponds to their token
32 was recorded correctly.<% end %> The column marked <em>Vote</em> lists
33 the candidates in order of the voter's preference. To read these votes,
34 refer to the key below.</p>
35
36 <table class="preftable">
37 <tr>
38 <th></th>
39 <% if @election.verifiable %><th>Verification Token</th><% end %>
40 <th>Vote</th>
41 <%- @votes.each_with_index do |vote, i| -%>
42 <tr>
43 <td><%= i + 1 %></td>
44 <% if @election.verifiable %><td><%= vote.token %></td><% end %>
45 <td><%= vote.votestring%></td>
46 </tr>
47 <%- end -%>
48 </table>
49
50 <p style="margin-top: 1em;">Key:</p>
51
52 <table class="preftable">
53 <tr>
54 <th>Code</th>
55 <th>Candidate</th>
56 <%- @election.candidates.sort.each_with_index do |c, i| -%>
57 <tr>
58 <td><%= (i + 65).chr %></td>
59 <td><%= c.name %></td>
60 </tr>
61 <%- end -%>
62 </table>
63

Benjamin Mako Hill || Want to submit a patch?