1 <%require 'whois/whois' %>
4 <% if @election.shortdesc %>
5 <p><strong>Description:</strong></p>
6 <blockquote><em><%= @election.shortdesc %></em>
7 <% if @election.longdesc -%>
9 <%= h(@election.longdesc) -%>
14 <p><strong>Candidates/choices:</strong></p>
17 <% for candidate in @election.candidates.sort %>
18 <li><%= candidate.name.capitalize %></li>
22 <p><strong>Number of voters:</strong></p>
24 <%= @election.voters.reject {|v| not v.voted? }.length %> (see below for details)
29 <div class="mainresultbox">
30 <h3>Schulze Method Results</h3>
31 <%= render :partial => 'result', :object => @election.ssd_result %>
33 <div class="rbmoreinfo"
34 <h4>About the Schulze Method</h4>
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>
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>
48 <div class="resultbox">
49 <h3>Plurality Results</h3>
50 <%= render :partial => 'result', :object => @election.plurality_result %>
52 <div class="rbmoreinfo"
53 <h4>About Plurality Voting</h4>
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>
60 <p>Plurality voting is also variously referred to as, "first past the
61 post," "winner-take-all," "majoritarian" or "simple majority"
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 => @election.approval_result %>
72 <div class="rbmoreinfo"
73 <h4>About Approval Voting</h4>
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:
86 <div class="resultbox">
87 <h3>Simple Condorcet Results</h3>
88 <%= render :partial => 'result', :object => @election.condorcet_result %>
90 <div class="rbmoreinfo"
91 <h4>About Simple Cordorcet Voting</h4>
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>
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>
106 <div class="resultbox">
107 <h3>Borda Count Results</h3>
108 <%= render :partial => 'result', :object => @election.borda_result %>
110 <div class="rbmoreinfo"
111 <h4>About Borda Count</h4>
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>
124 <div class="resultbox">
125 <h3>Instant Runoff (IRV) Results</h3>
127 <div class="rbmoreinfo"
128 <h4>About Instant Runoff Voting</h4>
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>
138 <p>Instant-runoff voting (IRV) is also known as the Alternative Vote (AV) and
139 by several other names.</p>
145 <div class="clearbox"></div>
147 <h2>Voters <%= link_to "[Stalk Voters]", :controller => "quickvote", :action => "mapvoters", :id => @election.id %></h2>
148 <table class="voterbox">
154 <% for voter in @election.voters %>
155 <% next unless voter.voted? %>
158 <% raise ArgumentError.new, "Local Server" if voter.ipaddress == "127.0.0.1" %>
159 <% raise ArgumentError.new, "XML-RPC Voter" if voter.ipaddress == "XMLRPC Request" %>
160 <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress).to_s,true)%>
161 <%=(w.host == nil or w.host.empty?) ? voter.ipaddress : w.host%>
165 <%= (w.all.grep(/^(OrgName|org-name)/)[0] or "").sub(/^(OrgName|org-name)\:/,'').strip -%> - <%= (w.all.grep(/^(NetName|netname)/)[0] or "").sub(/^(NetName|netname)\:/,'').strip %>
167 <% rescue ArgumentError => err %>
173 <td><%= voter.vote.votestring %></td>
178 <%= render :partial => 'defeats_list' %>
179 <%= render :partial => 'pref_table' %>
181 <%= image_tag( graph_url( :action => 'votes_per_day', :id => @election ) ) %><br />
182 <%= image_tag( graph_url( :action => 'votes_per_interval', :id => @election ))%><br />
183 <%= image_tag( graph_url( :action => 'borda_bar', :id => @election ) ) %><br />
184 <%= image_tag( graph_url( :action => 'choices_positions', :id => @election ) ) %>