1 <% require 'whois/whois' %>
4 <span class="header">Quickvote</span>
5 <span class="subheader">Results</span>
8 <% if @election.shortdesc %>
9 <p><strong>Vote Description:</strong></p>
10 <blockquote><em><%=h @election.shortdesc %></em>
11 <% if @election.longdesc -%>
13 <%= h(@election.longdesc) -%>
18 <p><strong>Candidates/choices:</strong></p>
21 <% for candidate in @election.candidates.sort %>
22 <li><%=h candidate.name.capitalize %></li>
26 <p><strong>Number of voters:</strong></p>
28 <%= @election.voters.reject {|v| not v.voted? }.length %> (see below for details)
31 <div class="plain-header">
32 <span class="header">Winner</span>
33 <span class="subheader"></span>
36 <div class="mainresultbox">
37 <%= render :partial => 'result_' + @election.election_method,
38 :object => @results[@election.election_method] %>
41 <div class="plain-header">
42 <span class="header">Other Voting Methods</span>
43 <span class="subheader"></span>
46 <% for result_type in @election.other_methods %>
47 <div class="resultbox">
48 <%= render :partial => 'result_' + result_type,
49 :object => @results[result_type] %>
54 <div class="clear-div"></div>
56 <h2>Voters <%= link_to "[Stalk Voters]", :controller => "quickvote", :action => "mapvoters", :id => @election.id %></h2>
57 <table class="voterbox">
63 <% for voter in @election.voters %>
64 <% next unless voter.voted? %>
67 <% raise ArgumentError.new, "Local Server" if voter.ipaddress == "127.0.0.1" %>
68 <% raise ArgumentError.new, "XML-RPC Voter" if voter.ipaddress == "XMLRPC Request" %>
69 <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)%>
70 <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host)%>
74 <%=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 %>
76 <% rescue ArgumentError => err %>
80 <% rescue NoMethodError %>
86 <td><%= voter.vote.votestring %></td>
94 <%= image_tag( graph_url( :action => 'choices_positions', :id => @election ) ) %><br />