summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/intruders_controller.rb6
-rw-r--r--app/views/intruders/show.html.haml11
2 files changed, 14 insertions, 3 deletions
diff --git a/app/controllers/intruders_controller.rb b/app/controllers/intruders_controller.rb
index eb34f2b..708e11a 100644
--- a/app/controllers/intruders_controller.rb
+++ b/app/controllers/intruders_controller.rb
@@ -5,6 +5,12 @@ class IntrudersController < ApplicationController
def show
@intruder = Intruder.find(params[:id])
+ if ! params[:whois].blank?
+ @whois = @intruder.whois(params[:whois])
+ if @whois.blank?
+ @whois = 'no information'
+ end
+ end
end
def new
diff --git a/app/views/intruders/show.html.haml b/app/views/intruders/show.html.haml
index 4941e89..325c5e3 100644
--- a/app/views/intruders/show.html.haml
+++ b/app/views/intruders/show.html.haml
@@ -21,6 +21,10 @@
%p
%strong= t('intruders.show.contact_ip') + ":"
= @intruder.contact_ip
+ - if ! @intruder.contact_ip.blank? && Object.const_defined?('Whois')
+ %a.btn.btn-small.btn-success{ :href => intruder_path(@intruder, :whois => @intruder.contact_ip) }
+ %i.icon-info-sign.icon-white
+ = 'Whois'
%p
%strong= t('intruders.show.contact_port') + ":"
= @intruder.contact_port
@@ -46,7 +50,8 @@
%strong= t('intruders.show.comment') + ":"
= @intruder.comment
-%p
- %pre= @intruder.whois
-
= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @intruder }
+
+- if ! @whois.blank?
+ %p
+ %pre= @whois