2 <%require 'whois/whois' %>
5 <% if @election.shortdesc %>
6 <p><strong>Description:</strong></p>
7 <blockquote><em><%= @election.shortdesc %></em>
8 <% if @election.longdesc -%>
10 <%= h(@election.longdesc) -%>
15 <p><strong>Candidates/choices:</strong></p>
18 <% for candidate in @election.candidates.sort %>
19 <li><%= candidate.name.capitalize %></li>
23 <p><strong>Number of voters:</strong></p>
25 <%= @election.voters.reject {|v| not v.voted? }.length %> (see below for details)
30 <div class="mainresultbox">
31 <h3>Schulze Method Results</h3>
32 <%= render :partial => 'result', :object => @election.ssd_result %>
34 <div class="rbmoreinfo"
35 <h4>About the Schulze Method</h4>
37 <p>The <%= link_to "Schulze method",
38 "http://en.wikipedia.org/wiki/Schulze_method" %> is a preferential
39 voting system. It is based on the Condorcet method but includes a set of
40 methods for resolving "circular" defeats.</p>
42 <p>The Schulze method is also known as Schwartz Sequential Dropping
43 (SSD), Cloneproof Schwartz Sequential Dropping (CSSD), Beatpath Method,
44 Beatpath Winner, Path Voting, and Path Winner.</p>
49 <div class="resultbox">
50 <h3>Plurality Results</h3>
51 <%= render :partial => 'result', :object => @election.plurality_result %>
53 <div class="rbmoreinfo"
54 <h4>About Plurality Voting</h4>
56 <p><%= link_to "Plurality voting",
57 "http://en.wikipedia.org/wiki/Plurality_electoral_system" %> selects the
58 winner who has received the most "number one" votes, regardless of
59 whether or not he or she has a majority of votes.</p>
61 <p>Plurality voting is also variously referred to as, "first past the
62 post," "winner-take-all," "majoritarian" or "simple majority"
68 <div class="resultbox">
69 <h3>Approval Result</h3>
70 <p><font size="-1">(This algorithm assumes that top two choices are "approved.")</font></p>
71 <%= render :partial => 'result', :object => @election.approval_result %>
73 <div class="rbmoreinfo"
74 <h4>About Approval Voting</h4>
76 <p><%= link_to "Approval voting",
77 "http://en.wikipedia.org/wiki/Approval_voting" %> is a voting system in
78 which each voter can vote for as many or as few candidates as the voter
79 chooses. Approval voting is a limited form of range voting, where the
80 range that voters are allowed to express is extremely constrained:
87 <div class="resultbox">
88 <h3>Simple Condorcet Results</h3>
89 <%= render :partial => 'result', :object => @election.condorcet_result %>
91 <div class="rbmoreinfo"
92 <h4>About Simple Cordorcet Voting</h4>
94 <p><%= link_to "Condorcet",
95 "http://en.wikipedia.org/wiki/Condorcet_method" %> allows voters to rank
96 candidates in order of preference. If there is a choice whom voters
97 prefer to each other choice when compared to one at a time, that choice
98 will be the winner.</p>
100 <p>There is a family of Condorcet methods. This method is referred to as
101 "Simple Condorcet" to distinguish it from the Schulze method which is
102 another Condorcet system.</p>
107 <div class="resultbox">
108 <h3>Borda Count Results</h3>
109 <%= render :partial => 'result', :object => @election.borda_result %>
111 <div class="rbmoreinfo"
112 <h4>About Borda Count</h4>
114 <p><%= link_to "Borda count",
115 "http://en.wikipedia.org/wiki/Borda_count" %>
116 is an election method in which voters rank
117 candidates in order of preference. The Borda count determines the winner
118 of an election by giving each candidate a certain number of points
119 corresponding to the position in which he or she is ranked by each
120 voter. Once all votes have been counted the candidate with the most
121 points is the winner.</p>
125 <div class="resultbox">
126 <h3>Instant Runoff (IRV) Results</h3>
128 <div class="rbmoreinfo"
129 <h4>About Instant Runoff Voting</h4>
131 <p><%= link_to "Instant runoff voting",
132 "http://en.wikipedia.org/wiki/Instant_Runoff_Voting" %> is an electoral
133 system in which voters rank candidates in order of preference. In an IRV
134 election, if no candidate receives an overall majority of first
135 preferences the candidates with fewest votes are eliminated one by one,
136 and their votes transferred according to their second and third
137 preferences (and so on), until one candidate achieves a majority.</p>
139 <p>Instant-runoff voting (IRV) is also known as the Alternative Vote (AV) and
140 by several other names.</p>
146 <div class="clearbox"></div>
148 <h2>Voters <%= link_to "[Stalk Voters]", :controller => "quickvote", :action => "mapvoters", :id => @election.id %></h2>
149 <table class="voterbox">
155 <% for voter in @election.voters %>
156 <% next unless voter.voted? %>
159 <% raise ArgumentError.new, "Local Server" if voter.ipaddress == "127.0.0.1" %>
160 <% raise ArgumentError.new, "XML-RPC Voter" if voter.ipaddress == "XMLRPC Request" %>
161 <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress).to_s,true)%>
162 <%=(w.host == nil or w.host.empty?) ? voter.ipaddress : w.host%>
166 <%= (w.all.grep(/^(OrgName|org-name)/)[0] or "").sub(/^(OrgName|org-name)\:/,'').strip -%> - <%= (w.all.grep(/^(NetName|netname)/)[0] or "").sub(/^(NetName|netname)\:/,'').strip %>
168 <% rescue ArgumentError => err %>
174 <td><%= voter.vote.votestring %></td>
179 <%= render :partial => 'victories_ties' %>
180 <%= render :partial => 'pref_table' %>
182 <%= image_tag( graph_url( :action => 'votes_per_day', :id => @election ) ) %><br />
183 <%= image_tag( graph_url( :action => 'votes_per_interval', :id => @election ))%><br />
184 <%= image_tag( graph_url( :action => 'borda_bar', :id => @election ) ) %><br />
185 <%= image_tag( graph_url( :action => 'choices_positions', :id => @election ) ) %>