Link IP addresses to IP searches.

This commit is contained in:
evazion
2017-01-12 05:21:35 +00:00
parent 63d5c7900d
commit bdf3366bcf
11 changed files with 14 additions and 10 deletions

View File

@@ -89,6 +89,10 @@ module ApplicationHelper
time_tag(time.strftime("%Y-%m-%d %H:%M"), time)
end
def link_to_ip(ip)
link_to ip, moderator_ip_addrs_path(:search => {:ip_addr => ip})
end
def link_to_user(user, options = {})
user_class = user.level_class
user_class = user_class + " user-post-approver" if user.can_approve_posts?

View File

@@ -32,7 +32,7 @@
</td>
<% if CurrentUser.is_moderator? %>
<td>
<%= commentary_version.updater_ip_addr %>
<%= link_to_ip commentary_version.updater_ip_addr %>
</td>
<% end %>
<td><%= link_to_user commentary_version.updater %></td>

View File

@@ -37,7 +37,7 @@
<td><%= link_to_user artist_version.updater %></td>
<% if CurrentUser.is_moderator? %>
<td>
<%= artist_version.updater_ip_addr %>
<%= link_to_ip artist_version.updater_ip_addr %>
</td>
<% end %>
<td><%= artist_version.is_active? %></td>

View File

@@ -9,7 +9,7 @@
<li><strong>Recipient</strong>: <%= link_to_user @dmail.to %></li>
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
<% if CurrentUser.user.is_moderator? %>
<li><strong>Sender IP</strong>: <%= @dmail.creator_ip_addr %></li>
<li><strong>Sender IP</strong>: <%= link_to_ip @dmail.creator_ip_addr %></li>
<% end %>
</ul>

View File

@@ -14,7 +14,7 @@
<tbody>
<% @ip_bans.each do |ip_ban| %>
<tr>
<td><%= ip_ban.ip_addr %></td>
<td><%= link_to_ip ip_ban.ip_addr %></td>
<td><%= ip_ban.creator.name %></td>
<td><%= ip_ban.reason %></td>
<td><%= link_to "Unban", ip_ban_path(ip_ban), :remote => true, :method => :delete, :data => {:confirm => "Do your really want to unban #{ip_ban.ip_addr}?"} %></td>

View File

@@ -10,7 +10,7 @@
<li><strong>Recipient</strong>: <%= link_to_user @dmail.to, :raw => true %></li>
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
<% if CurrentUser.user.is_moderator? %>
<li><strong>Sender IP</strong>: <%= @dmail.creator_ip_addr %></li>
<li><strong>Sender IP</strong>: <%= link_to_ip @dmail.creator_ip_addr %></li>
<% end %>
</ul>

View File

@@ -10,7 +10,7 @@
<tbody>
<% @results.each do |ip_address, count| %>
<tr>
<td><%= link_to ip_address, moderator_ip_addrs_path(:search => {:ip_addr => ip_address}) %></td>
<td><%= link_to_ip ip_address %></td>
<td><%= count %></td>
</tr>
<% end %>

View File

@@ -38,7 +38,7 @@
</td>
<% if CurrentUser.is_moderator? %>
<td>
<%= note_version.updater_ip_addr %>
<%= link_to_ip note_version.updater_ip_addr %>
</td>
<% end %>
<td><%= link_to_user note_version.updater %></td>

View File

@@ -27,7 +27,7 @@
<td><%= link_to_user pool_version.updater %></td>
<% if CurrentUser.is_moderator? %>
<td>
<%= pool_version.updater_ip_addr %>
<%= link_to_ip pool_version.updater_ip_addr %>
</td>
<% end %>
<td><%= compact_time pool_version.updated_at %></td>

View File

@@ -30,7 +30,7 @@
<td><%= post_version.parent_id %></td>
<% if CurrentUser.is_moderator? %>
<td>
<%= post_version.updater_ip_addr %>
<%= link_to_ip post_version.updater_ip_addr %>
</td>
<% end %>
<td><%= post_version_diff(post_version) %></td>

View File

@@ -54,7 +54,7 @@
<td><%= link_to "wiki", wiki_page_path(wiki_page_version.wiki_page_id) %></td>
<% if CurrentUser.is_moderator? %>
<td>
<%= wiki_page_version.updater_ip_addr %>
<%= link_to_ip wiki_page_version.updater_ip_addr %>
</td>
<% end %>
<td>