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 <div class="mainresultbox">
31 <%= render :partial => 'result_' + @election.election_method,
32 :object => @results[@election.election_method] %>
35 <h3> Other Voting Methods </h3>
36 <% for result_type in @election.other_methods %>
37 <div class="resultbox">
38 <%= render :partial => 'result_' + result_type,
39 :object => @results[result_type] %>
44 <div class="clearbox"></div>
46 <h2>Voters <%= link_to "[Stalk Voters]", :controller => "quickvote", :action => "mapvoters", :id => @election.id %></h2>
47 <table class="voterbox">
53 <% for voter in @election.voters %>
54 <% next unless voter.voted? %>
57 <% raise ArgumentError.new, "Local Server" if voter.ipaddress == "127.0.0.1" %>
58 <% raise ArgumentError.new, "XML-RPC Voter" if voter.ipaddress == "XMLRPC Request" %>
59 <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)%>
60 <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host)%>
64 <%=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 %>
66 <% rescue ArgumentError => err %>
70 <% rescue NoMethodError %>
76 <td><%= voter.vote.votestring %></td>
81 <%=image_tag( graph_url( :action => 'votes_per_interval', :id => @election ))%>
84 <%= image_tag( graph_url( :action => 'choices_positions', :id => @election ) ) %><br />