1 <% require 'whois/whois' %>
4 <span class="header">Quickvote</span>
5 <span class="subheader">Results</span>
8 <div class="main-content">
10 <% if @election.shortdesc %>
11 <p><strong>Vote Description:</strong></p>
12 <blockquote><em><%=h @election.shortdesc %></em>
13 <% if @election.longdesc -%>
15 <%= h(@election.longdesc) -%>
20 <p><strong>Candidates/choices:</strong></p>
23 <% for candidate in @election.candidates.sort %>
24 <li><%=h candidate.name.capitalize %></li>
28 <p><strong>Number of voters:</strong></p>
30 <%= @election.voters.reject {|v| not v.voted? }.length %> (see below for details)
33 <div class="plain-header">
34 <span class="header">Winner</span>
35 <span class="subheader"></span>
38 <div class="mainresultbox">
39 <%= render :partial => 'result_' + @election.election_method,
40 :object => @results[@election.election_method] %>
43 <div class="plain-header">
44 <span class="header">Other Voting Methods</span>
45 <span class="subheader"></span>
48 <% for result_type in @election.other_methods %>
49 <div class="resultbox">
50 <%= render :partial => 'result_' + result_type,
51 :object => @results[result_type] %>
56 <div class="clear-div"></div>
58 <h2>Voters <%= link_to "[Stalk Voters]", :controller => "quickvote", :action => "mapvoters", :id => @election.id %></h2>
59 <table class="voterbox">
65 <% for voter in @election.voters %>
66 <% next unless voter.voted? %>
69 <% raise ArgumentError.new, "Local Server" if voter.ipaddress == "127.0.0.1" %>
70 <% raise ArgumentError.new, "XML-RPC Voter" if voter.ipaddress == "XMLRPC Request" %>
71 <% w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true)%>
72 <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host)%>
76 <%=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 %>
78 <% rescue ArgumentError => err %>
82 <% rescue NoMethodError %>
88 <td><%= voter.vote.votestring %></td>
93 <%=image_tag( graph_url( :action => 'votes_per_interval', :id => @election ))%>
96 <%= image_tag( graph_url( :action => 'choices_positions', :id => @election ) ) %><br />