-<%require 'IPAddr' %>
+<%require 'whois/whois' %>
<h1>Results</h1>
<% if @election.shortdesc %>
<div class="clearbox"></div>
<h2>Voters</h2>
-
<table class="voterbox">
<tr>
<th>IP Address</th>
<tr>
<td><%= voter.ipaddress %></td>
<td><% begin %>
- <%= `host #{IPAddr.new(voter.ipaddress).to_s}`.sub(/^.*pointer (.*)\.$/, '\1') %>
+ <% raise ArgumentError.new if voter.ipaddress == "127.0.0.1" %>
+ <%= Whois::Whois.new(IPAddr.new(voter.ipaddress).to_s).search_whois.grep(/^OrgName/)[0].sub(/^OrgName\:/,'').strip %>
<% rescue ArgumentError => err %>
- <%= " - " %>
+ <%= voter.ipaddress %>
<% end %>
</td>
<td><%= voter.vote.votestring %></td>
<% end %>
</table>
+<%= render :partial => 'pref_table' %>
+
<%= image_tag( graph_url( :action => 'votes_per_day', :id => @election ) ) %><br />
<%= image_tag( graph_url( :action => 'votes_per_interval', :id => @election ))%><br />
<%= image_tag( graph_url( :action => 'borda_bar', :id => @election ) ) %><br />
<%= image_tag( graph_url( :action => 'choices_positions', :id => @election ) ) %>
-