fixes #2530: improved ip addr search

This commit is contained in:
r888888888
2015-10-08 17:26:32 -07:00
parent 643ab7b2c6
commit 1eb2d515fd
4 changed files with 54 additions and 7 deletions

View File

@@ -2,11 +2,24 @@
<div id="a-index">
<h1>IP Addresses</h1>
<% if params[:search][:user_id].present? || params[:search][:user_name].present? %>
<%= render "ip_listing" %>
<% else %>
<%= render "user_listing" %>
<% end %>
<p>The following users share IP addresses used by <%= params[:user_name] %>. This searches across comments, post changes, note changes, pool changes, wiki changes, and dmails over the past 3 months.</p>
<table class="striped">
<thead>
<tr>
<th>User</th>
<th>Count</th>
</tr>
</thead>
<tbody>
<% @search.find_common_users.each do |user_id, count| %>
<tr>
<td><%= link_to User.id_to_name(user_id), users_path(user_id) %></td>
<td><%= count %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>

View File

@@ -4,7 +4,6 @@
<%= form_tag(moderator_ip_addrs_path, :method => :get, :class => "simple_form") do %>
<%= search_field "user_name", :label => "User" %>
<%= search_field "ip_addr", :label => "IP Addr" %>
<%= submit_tag "Search" %>
<% end %>
</div>