7152072d4c54d26c641842f880f3c9384296ca84
[selectricity] / app / views / quickvote / results.rhtml
1 <% %>
2 <h1>Results</h1>
3
4 <% if @election.shortdesc %>
5   <p><strong>Description:</strong></p>
6   <blockquote><em><%= @election.shortdesc %></em>
7     <% if @election.longdesc -%>
8       <br />
9       <%= h(@election.longdesc) -%>
10     <% end -%>
11   </blockquote>
12 <% end %>
13
14 <p><strong>Candidates/choices:</strong></p>
15
16 <ol>
17   <% for candidate in @election.candidates.sort %>
18     <li><%= candidate.name.capitalize %></li>
19   <% end %>
20 </ol>
21
22 <p><strong>Number of voters:</strong></p>
23    <blockquote>
24      <%= @election.voters.reject {|v| not v.voted? }.length %> (see below for details) 
25    </blockquote>
26
27 <h2>Winners</h2>
28
29 <div class="mainresultbox">
30 <h3>Schulze Method Results</h3>
31 <%= render :partial => 'result', :object => @ssd_result %>
32
33 <div class="rbmoreinfo"
34 <h4>About the Schulze Method</h4>
35
36 <p>The <%= link_to "Schulze method",
37 "http://en.wikipedia.org/wiki/Schulze_method" %> is a preferential
38 voting system. It is based on the Condorcet method but includes a set of
39 methods for resolving "circular" defeats.</p>
40
41 <p>The Schulze method is also known as Schwartz Sequential Dropping
42 (SSD), Cloneproof Schwartz Sequential Dropping (CSSD), Beatpath Method,
43 Beatpath Winner, Path Voting, and Path Winner.</p>
44 </div>
45
46 </div>
47
48 <div class="resultbox">
49 <h3>Plurality Results</h3>
50 <%= render :partial => 'result', :object => @plurality_result %>
51
52 <div class="rbmoreinfo"
53 <h4>About Plurality Voting</h4>
54
55 <p><%= link_to "Plurality voting",
56 "http://en.wikipedia.org/wiki/Plurality_electoral_system" %> selects the
57 winner who has received the most "number one" votes, regardless of
58 whether or not he or she has a majority of votes.</p>
59
60 <p>Plurality voting is also variously referred to as, "first past the
61 post," "winner-take-all," "majoritarian" or "simple majority"
62 voting.</p>
63
64 </div>
65 </div>
66
67 <div class="resultbox">
68 <h3>Approval Result</h3>
69 <p><font size="-1">(This algorithm assumes that top two choices are "approved.")</font></p>
70 <%= render :partial => 'result', :object => @approval_result %>
71
72 <div class="rbmoreinfo"
73 <h4>About Approval Voting</h4>
74
75 <p><%= link_to "Approval voting",
76 "http://en.wikipedia.org/wiki/Approval_voting" %> is a voting system in
77 which each voter can vote for as many or as few candidates as the voter
78 chooses.  Approval voting is a limited form of range voting, where the
79 range that voters are allowed to express is extremely constrained:
80 accept or not.</p>
81
82 </div>
83
84 </div>
85
86 <div class="resultbox">
87 <h3>Simple Condorcet Results</h3>
88 <%= render :partial => 'result', :object => @condorcet_result %>
89
90 <div class="rbmoreinfo"
91 <h4>About Simple Cordorcet Voting</h4>
92
93 <p><%= link_to "Condorcet",
94 "http://en.wikipedia.org/wiki/Condorcet_method" %> allows voters to rank
95 candidates in order of preference.  If there is a choice whom voters
96 prefer to each other choice when compared to one at a time, that choice
97 will be the winner.</p>
98
99 <p>There is a family of Condorcet methods. This method is referred to as
100 "Simple Condorcet" to distinguish it from the Schulze method which is
101 another Condorcet system.</p>
102
103 </div>
104 </div>
105
106 <div class="resultbox">
107 <h3>Borda Count Results</h3>
108 <%= render :partial => 'result', :object => @borda_result %>
109
110 <div class="rbmoreinfo"
111 <h4>About Borda Count</h4>
112
113 <p><%= link_to "Borda count",
114 "http://en.wikipedia.org/wiki/Borda_count" %> 
115 is an election method in which voters rank
116 candidates in order of preference. The Borda count determines the winner
117 of an election by giving each candidate a certain number of points
118 corresponding to the position in which he or she is ranked by each
119 voter. Once all votes have been counted the candidate with the most
120 points is the winner.</p>
121 </div>
122 </div>
123
124 <div class="resultbox">
125 <h3>Instant Runoff (IRV) Results</h3>
126
127 <div class="rbmoreinfo"
128 <h4>About Instant Runoff Voting</h4>
129
130 <p><%= link_to "Instant runoff voting",
131 "http://en.wikipedia.org/wiki/Instant_Runoff_Voting" %> is an electoral
132 system in which voters rank candidates in order of preference. In an IRV
133 election, if no candidate receives an overall majority of first
134 preferences the candidates with fewest votes are eliminated one by one,
135 and their votes transferred according to their second and third
136 preferences (and so on), until one candidate achieves a majority.</p>
137
138 <p>Instant-runoff voting (IRV) is also known as the Alternative Vote (AV) and
139 by several other names.</p>
140
141 </div>
142
143 </div>
144
145 <div class="clearbox"></div>
146
147 <h2>Voters</h2>
148
149 <table class="voterbox">
150 <tr>
151 <th>IP Address</th>
152 <th>DNS/Host</th>
153 <th>Vote</th>
154 </tr>
155 <% for voter in @election.voters %>
156   <% next unless voter.voted? %>
157   <tr>
158   <td><%= voter.ipaddress %></td>
159   <td><%= `host #{voter.ipaddress}`.sub(/^.*pointer (.*)\.$/, '\1') %></td>
160   <td><%= voter.vote.votestring %></td>
161   </tr>
162 <% end %>
163 </table>
164
165 <img src="<% url_for(:action => 'day_votes', :id => @election)%>" />
166 <%= image_tag( graph_url( :action => 'day_votes', :id => @election ) ) %>
167 <%= image_tag( graph_url( :action => 'show' ) ) %>

Benjamin Mako Hill || Want to submit a patch?