2 <%require 'whois/whois' %>
5 <% if @election.shortdesc %>
6 <p><strong>Description:</strong></p>
7 <blockquote><em><%=h @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><%=h 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 <%= render :partial => 'result_' + @election.election_method,
31 :object => @results[@election.election_method] %>
34 <h3> Other Voting Methods </h3>
35 <% for result_type in @election.other_methods %>
36 <%= render :partial => 'result_' + result_type,
37 :object => @results[result_type] %>
41 <div class="clearbox"></div>
43 <h2>Voters <%= link_to "[Stalk Voters]", :controller => "quickvote", :action => "mapvoters", :id => @election.id %></h2>
44 <table class="voterbox">
50 <% for voter in @election.voters %>
51 <% next unless voter.voted? %>
54 <% raise ArgumentError.new, "Local Server" if voter.ipaddress == "127.0.0.1" %>
55 <% raise ArgumentError.new, "XML-RPC Voter" if voter.ipaddress == "XMLRPC Request" %>
56 <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress).to_s,true)%>
57 <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host)%>
61 <%=h (w.all.grep(/^(OrgName|org-name)/)[0] or "").sub(/^(OrgName|org-name)\:/,'').strip -%> - <%= (w.all.grep(/^(NetName|netname)/)[0] or "").sub(/^(NetName|netname)\:/,'').strip %>
63 <% rescue ArgumentError => err %>
69 <td><%= voter.vote.votestring %></td>
74 <%= render :partial => 'pref_tables' %>
76 <%=image_tag( graph_url( :action => 'votes_per_interval', :id => @election ))%>
78 <%= image_tag( graph_url( :action => 'borda_bar', :id => @election ) ) %><br />
79 <%= image_tag( graph_url( :action => 'choices_positions', :id => @election ) ) %><br />
80 <%= image_tag(graph_url( :action => 'plurality_pie', :id => @election ) )%>